summaryrefslogtreecommitdiffstats
path: root/test/unit/member_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-08 11:13:24 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-08 11:13:24 +0000
commitd9699adce500d34ba7bd07959485e14de6031f92 (patch)
tree7f04b8d4f1d513b2b68f8bf684cd69ddf97a36b3 /test/unit/member_test.rb
parentc585d224d877e41e6eca039ccffb599f5239bfb0 (diff)
downloadredmine-d9699adce500d34ba7bd07959485e14de6031f92.tar.gz
redmine-d9699adce500d34ba7bd07959485e14de6031f92.zip
Rails3: model: Member: errors must be set on existing attributes
On Rails 3.0, test fails with following error. <pre> Error: test_validate(MemberTest): NoMethodError: undefined method `role' for #<Member:0x7f73caf8cd08> app/models/member.rb:87:in `validate_role' test/unit/member_test.rb:76:in `test_validate' </pre> Contributed by Sylvain Utard. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8124 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/member_test.rb')
-rw-r--r--test/unit/member_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/unit/member_test.rb b/test/unit/member_test.rb
index d8267158e..13a00c724 100644
--- a/test/unit/member_test.rb
+++ b/test/unit/member_test.rb
@@ -74,6 +74,7 @@ class MemberTest < ActiveSupport::TestCase
assert user.save
member = Member.new(:project_id => 1, :user_id => user.id, :role_ids => [])
assert !member.save
+ assert_equal I18n.translate('activerecord.errors.messages.empty'), member.errors[:roles].to_s
end
def test_validate_member_role