fixes #3422
This commit is contained in:
@@ -3,6 +3,7 @@ require 'test_helper'
|
||||
class ArtistUrlTest < ActiveSupport::TestCase
|
||||
context "An artist url" do
|
||||
setup do
|
||||
User.any_instance.stubs(:validate_sock_puppets)
|
||||
CurrentUser.user = FactoryGirl.create(:user)
|
||||
CurrentUser.ip_addr = "127.0.0.1"
|
||||
end
|
||||
@@ -28,6 +29,16 @@ class ArtistUrlTest < ActiveSupport::TestCase
|
||||
assert_equal("http://google.com/", url.normalized_url)
|
||||
end
|
||||
|
||||
context "normalize twitter profile urls" do
|
||||
setup do
|
||||
@url = FactoryGirl.create(:artist_url, :url => "https://twitter.com/BLAH")
|
||||
end
|
||||
|
||||
should "downcase the url" do
|
||||
assert_equal("http://twitter.com/blah/", @url.normalized_url)
|
||||
end
|
||||
end
|
||||
|
||||
should "normalize fc2 urls" do
|
||||
url = FactoryGirl.create(:artist_url, :url => "http://blog55.fc2.com/monet")
|
||||
assert_equal("http://blog55.fc2.com/monet", url.url)
|
||||
|
||||
@@ -158,15 +158,5 @@ module Sources
|
||||
assert_equal(tags, @site.tags)
|
||||
end
|
||||
end
|
||||
|
||||
context "#normalize_for_artist_finder!" do
|
||||
setup do
|
||||
@site = Sources::Site.new("https://twitter.com/BLAH")
|
||||
end
|
||||
|
||||
should "downcase the url" do
|
||||
assert_equal("https://twitter.com/blah", @site.normalize_for_artist_finder!)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user