X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f2d13c075660efb9582d7fb600bd6798d7a382ca..a9a9ae2cbb2facd6910338ef3d3c50f4ebee11da:/test/models/user_test.rb diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 7f24469f6..f10e8c023 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -86,7 +86,10 @@ class UserTest < ActiveSupport::TestCase # These need to be 3 chars in length, otherwise the length test above # should be used. bad = [ "
", "test@example.com", "s/f", "aa/", "aa;", "aa.", - "aa,", "aa?", "/;.,?", "も対応します/", "#ping" ] + "aa,", "aa?", "/;.,?", "も対応します/", "#ping", + "foo\x1fbar", "foo\x7fbar", "foo\ufffebar", "foo\uffffbar", + "new", "terms", "save", "confirm", "confirm-email", + "go_public", "reset-password", "forgot-password", "suspended" ] ok.each do |display_name| user = users(:normal_user) user.display_name = display_name @@ -97,7 +100,6 @@ class UserTest < ActiveSupport::TestCase user = users(:normal_user) user.display_name = display_name assert !user.valid?, "#{display_name} is valid when it shouldn't be" - assert user.errors[:display_name].include?("is invalid") end end @@ -179,10 +181,10 @@ class UserTest < ActiveSupport::TestCase end end - def test_public - assert_equal 16, User.public.count + def test_identifiable + assert_equal 16, User.identifiable.count assert_raise ActiveRecord::RecordNotFound do - User.public.find(users(:normal_user).id) + User.identifiable.find(users(:normal_user).id) end end