Sha256: 8a891a49176f38feb1c005cc817ef60634c5be113eb1f74b1a01fbbd896f2077

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

require "spec_helper"

describe MusicBrainz::Bindings::ReleaseGroupSearch do
  describe '.parse' do
    let(:response) {
      <<-XML
        <metadata xmlns="http://musicbrainz.org/ns/mmd-2.0#" xmlns:ext="http://musicbrainz.org/ns/ext#-2.0">
          <release-group-list>
            <release-group ext:score="100" id="246bc928-2dc8-35ba-80ee-7a0079de1632" type="Single">
              <title>Empire</title>
            </release-group>
          </release-group-list>
        </metadata>
      XML
    }
    let(:xml) {
      Nokogiri::XML.parse(response)
    }
    let(:metadata) {
      described_class.parse(xml.remove_namespaces!.xpath('/metadata'))
    }

    it "gets correct release group data" do
      expect(metadata).to eq [
        {
          id: '246bc928-2dc8-35ba-80ee-7a0079de1632',
          mbid: '246bc928-2dc8-35ba-80ee-7a0079de1632',
          title: 'Empire',
          type: 'Single',
          score: 100,
        }
      ]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
musicbrainz-0.8.0 spec/bindings/release_group_search_spec.rb