for artist urls, normalize https
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -22,6 +22,12 @@ class ArtistUrlTest < ActiveSupport::TestCase
|
||||
assert_equal("http://monet.com/", url.url)
|
||||
assert_equal("http://monet.com/", url.normalized_url)
|
||||
end
|
||||
|
||||
should "normalise https" do
|
||||
url = FactoryGirl.create(:artist_url, :url => "https://google.com")
|
||||
assert_equal("https://google.com", url.url)
|
||||
assert_equal("http://google.com/", url.normalized_url)
|
||||
end
|
||||
|
||||
should "normalize fc2 urls" do
|
||||
url = FactoryGirl.create(:artist_url, :url => "http://blog55.fc2.com/monet")
|
||||
|
||||
Reference in New Issue
Block a user