Replaced the custom weighting calculation by making use of MusicBrainz scoring scheme.

This commit is contained in:
Sander Nieuwenhuizen
2012-09-05 21:17:31 +02:00
parent 88c4128d82
commit 0b68c0c570
3 changed files with 14 additions and 14 deletions
+13
View File
@@ -20,6 +20,19 @@ describe MusicBrainz::Artist do
matches.first[:name].should == "Kasabian"
end
it "should return search results in the right order and pass back the correct score" do
matches = MusicBrainz::Artist.search('Chris Martin')
matches.first[:score].should == 100
matches.first[:mbid].should == "98d1ec5a-dd97-4c0b-9c83-7928aac89bca"
matches[1][:score].should == 100
matches[1][:mbid].should == "af2ab893-3212-4226-9e73-73a1660b6952"
matches[2][:score].should == 95
matches[2][:mbid].should == "444d1b63-534b-4ea6-89f0-0af6ab2e20c3"
matches[3][:score].should == 95
matches[3][:mbid].should == "90fff570-a4ef-4cd4-ba21-e00c7261b05a"
end
it "finds name first than alias" do
matches = MusicBrainz::Artist.search('Chris Martin')
matches.length.should be > 0