X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/0814b4096c443e2ab3c09baa058aa81a00d205d1..3666b674330ec8d14a224932a191d6121c5974e2:/test/models/client_application_test.rb diff --git a/test/models/client_application_test.rb b/test/models/client_application_test.rb index 9684513c4..c0b7b7977 100644 --- a/test/models/client_application_test.rb +++ b/test/models/client_application_test.rb @@ -3,7 +3,7 @@ require "test_helper" class ClientApplicationTest < ActiveSupport::TestCase def test_url_valid ok = ["http://example.com/test", "https://example.com/test"] - bad = ["", "ftp://example.com/test", "myapp://somewhere"] + bad = ["", "ftp://example.com/test", "myapp://somewhere", "http://example.com\nhttp://example.net"] ok.each do |url| app = build(:client_application) @@ -14,13 +14,13 @@ class ClientApplicationTest < ActiveSupport::TestCase bad.each do |url| app = build(:client_application) app.url = url - assert !app.valid?, "#{url} is valid when it shouldn't be" + assert_not app.valid?, "#{url} is valid when it shouldn't be" end end def test_support_url_valid ok = ["", "http://example.com/test", "https://example.com/test"] - bad = ["ftp://example.com/test", "myapp://somewhere", "gibberish"] + bad = ["ftp://example.com/test", "myapp://somewhere", "gibberish", "http://example.com\nhttp://example.net"] ok.each do |url| app = build(:client_application) @@ -31,13 +31,13 @@ class ClientApplicationTest < ActiveSupport::TestCase bad.each do |url| app = build(:client_application) app.support_url = url - assert !app.valid?, "#{url} is valid when it shouldn't be" + assert_not app.valid?, "#{url} is valid when it shouldn't be" end end def test_callback_url_valid ok = ["", "http://example.com/test", "https://example.com/test", "ftp://example.com/test", "myapp://somewhere"] - bad = ["gibberish"] + bad = ["gibberish", "http://example.com\nhttp://example.net"] ok.each do |url| app = build(:client_application) @@ -48,7 +48,7 @@ class ClientApplicationTest < ActiveSupport::TestCase bad.each do |url| app = build(:client_application) app.callback_url = url - assert !app.valid?, "#{url} is valid when it shouldn't be" + assert_not app.valid?, "#{url} is valid when it shouldn't be" end end end