2013-11-06 02:15:09 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2013-01-22 15:04:15 +00:00
|
|
|
|
|
|
|
require "spec_helper"
|
|
|
|
|
|
|
|
describe MusicBrainz::Bindings::ReleaseGroupSearch do
|
|
|
|
describe '.parse' do
|
2015-03-13 19:39:11 +00:00
|
|
|
let(:response) {
|
|
|
|
'<metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0"><release-group-list><release-group id="246bc928-2dc8-35ba-80ee-7a0079de1632" type="Single" ext:score="100"><title>Empire</title></release-group></release-group-list></metadata>'
|
|
|
|
}
|
|
|
|
let(:metadata) {
|
|
|
|
described_class.parse(Nokogiri::XML.parse(response).remove_namespaces!.xpath('/metadata'))
|
|
|
|
}
|
|
|
|
|
2013-01-22 15:04:15 +00:00
|
|
|
it "gets correct release group data" do
|
2015-03-13 19:39:11 +00:00
|
|
|
expect(metadata).to eq([
|
2013-01-22 15:04:15 +00:00
|
|
|
{
|
2015-03-13 19:39:11 +00:00
|
|
|
id: '246bc928-2dc8-35ba-80ee-7a0079de1632', mbid: '246bc928-2dc8-35ba-80ee-7a0079de1632',
|
2013-01-22 15:04:15 +00:00
|
|
|
title: 'Empire', type: 'Single', score: 100
|
|
|
|
}
|
2015-03-13 19:39:11 +00:00
|
|
|
])
|
2013-01-22 15:04:15 +00:00
|
|
|
end
|
|
|
|
end
|
2013-05-05 23:14:44 +00:00
|
|
|
end
|