artist urls: normalize trailing slashes and missing http://.
* Remove unnecessary trailing slashes when artist URLs are saved. * Automatically add `http://` to new artist URLs if it's missing (before this was an error; now it's automatically fixed).
This commit is contained in:
@@ -580,7 +580,8 @@ class ArtistTest < ActiveSupport::TestCase
|
||||
|
||||
should "not save invalid urls" do
|
||||
assert_no_difference("ArtistVersion.count") do
|
||||
@artist.update(:url_string => "http://foo.com www.example.com")
|
||||
@artist.update(url_string: "http://foo.com :42")
|
||||
|
||||
assert_equal(%w[http://foo.com], @artist.versions.last.urls)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user