##// END OF EJS Templates
Rails3: test: replace deprecated Errors#on to Errors#[] and join with to_s at test/unit/user_test.rb...
Toshi MARUYAMA -
r8017:8e5242ef6351
parent child
Show More
@@ -54,7 +54,8 class UserTest < ActiveSupport::TestCase
54 54 u = User.new
55 55 u.mail = ''
56 56 assert !u.valid?
57 assert_equal I18n.translate('activerecord.errors.messages.blank'), u.errors.on(:mail)
57 assert_equal I18n.translate('activerecord.errors.messages.blank'),
58 u.errors[:mail].to_s
58 59 end
59 60
60 61 def test_create
@@ -99,7 +100,8 class UserTest < ActiveSupport::TestCase
99 100 u.login = 'NewUser'
100 101 u.password, u.password_confirmation = "password", "password"
101 102 assert !u.save
102 assert_equal I18n.translate('activerecord.errors.messages.taken'), u.errors.on(:login)
103 assert_equal I18n.translate('activerecord.errors.messages.taken'),
104 u.errors[:login].to_s
103 105 end
104 106 end
105 107
@@ -113,7 +115,8 class UserTest < ActiveSupport::TestCase
113 115 u.login = 'newuser2'
114 116 u.password, u.password_confirmation = "password", "password"
115 117 assert !u.save
116 assert_equal I18n.translate('activerecord.errors.messages.taken'), u.errors.on(:mail)
118 assert_equal I18n.translate('activerecord.errors.messages.taken'),
119 u.errors[:mail].to_s
117 120 end
118 121
119 122 def test_update
General Comments 0
You need to be logged in to leave comments. Login now