for artist urls, normalize https

This commit is contained in:
albert
2013-02-21 16:13:06 -05:00
parent 19398df28e
commit d16a240eda
4 changed files with 13 additions and 0 deletions

View File

@@ -94,10 +94,13 @@ class ArtistTest < ActiveSupport::TestCase
should "find matches by url" do
a1 = FactoryGirl.create(:artist, :name => "rembrandt", :url_string => "http://rembrandt.com/test.jpg")
a2 = FactoryGirl.create(:artist, :name => "subway", :url_string => "http://subway.com/test.jpg")
a3 = FactoryGirl.create(:artist, :name => "minko", :url_string => "https://minko.com/test.jpg")
assert_equal(["rembrandt"], Artist.find_all_by_url("http://rembrandt.com/test.jpg").map(&:name))
assert_equal(["rembrandt"], Artist.find_all_by_url("http://rembrandt.com/another.jpg").map(&:name))
assert_equal([], Artist.find_all_by_url("http://nonexistent.com/test.jpg").map(&:name))
assert_equal(["minko"], Artist.find_all_by_url("https://minko.com/test.jpg").map(&:name))
assert_equal(["minko"], Artist.find_all_by_url("http://minko.com/test.jpg").map(&:name))
end
should "not allow duplicates" do