Artist urls can be prepended with a '-' to mark is inactive (#3388)

This commit is contained in:
Albert Yi
2018-05-16 15:33:32 -07:00
parent 6acaf999a1
commit fcd80b6043
7 changed files with 52 additions and 6 deletions

View File

@@ -12,6 +12,13 @@ class ArtistUrlTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
should "allow urls to be marked as inactive" do
url = FactoryBot.create(:artist_url, :url => "-http://monet.com")
assert_equal("http://monet.com", url.url)
assert_equal("http://monet.com/", url.normalized_url)
refute(url.is_active?)
end
should "always add a trailing slash when normalized" do
url = FactoryBot.create(:artist_url, :url => "http://monet.com")
assert_equal("http://monet.com", url.url)