]> git.openstreetmap.org Git - rails.git/blobdiff - test/models/user_preference_test.rb
improve link ordering
[rails.git] / test / models / user_preference_test.rb
index bceec0719718bdb36048ee7315f26159a942c028..d6f1dcce5698acaed266f2c3da979e2dc0179c44 100644 (file)
@@ -15,7 +15,7 @@ class UserPreferenceTest < ActiveSupport::TestCase
   def test_check_valid_length
     key = "k"
     val = "v"
   def test_check_valid_length
     key = "k"
     val = "v"
-    (1..255).each do |i|
+    [1, 255].each do |i|
       up = UserPreference.new
       up.user = create(:user)
       up.k = key * i
       up = UserPreference.new
       up.user = create(:user)
       up.k = key * i
@@ -36,7 +36,7 @@ class UserPreferenceTest < ActiveSupport::TestCase
       up.user = create(:user)
       up.k = key * i
       up.v = val * i
       up.user = create(:user)
       up.k = key * i
       up.v = val * i
-      assert_equal false, up.valid?
+      assert_not up.valid?
       assert_raise(ActiveRecord::RecordInvalid) { up.save! }
     end
   end
       assert_raise(ActiveRecord::RecordInvalid) { up.save! }
     end
   end