created new track_search binding to allow searching for tracks (really recordings). Modified existing model classes to call super() to handle search (open/closed principle, attempting to reduce duplicate code). Fixed xml namespace issue in specs.

This commit is contained in:
Thomas Wolfe
2013-05-05 18:14:44 -05:00
parent 687ce1b785
commit d8184565a2
13 changed files with 96 additions and 26 deletions
+3 -3
View File
@@ -31,13 +31,13 @@ describe MusicBrainz::ReleaseGroup do
matches = MusicBrainz::ReleaseGroup.search('Kasabian', 'Empire')
matches.length.should be > 0
matches.first[:title].should == 'Empire'
matches.first[:type].should == 'Single'
matches.first[:type].should == 'Album'
end
end
context 'with type filter' do
it "searches release group by artist name and title" do
matches = MusicBrainz::ReleaseGroup.search('Kasabian', 'Empire', type: 'Album')
matches = MusicBrainz::ReleaseGroup.search('Kasabian', 'Empire', 'Album')
matches.length.should be > 0
matches.first[:title].should == 'Empire'
matches.first[:type].should == 'Album'
@@ -48,7 +48,7 @@ describe MusicBrainz::ReleaseGroup do
describe '.find_by_artist_and_title' do
it "gets first release group by artist name and title" do
release_group = MusicBrainz::ReleaseGroup.find_by_artist_and_title('Kasabian', 'Empire')
release_group.id.should == '246bc928-2dc8-35ba-80ee-7a0079de1632'
release_group.id.should == '6f33e0f0-cde2-38f9-9aee-2c60af8d1a61'
end
end