From 3d1e6f5b96d55f4b279d1a44ad8cbdb2b0a0612f Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 3 Dec 2011 14:33:02 +0000 Subject: [PATCH] fix member validate test of empty role at unit test Id 2 user is already assigned. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8046 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/member_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/unit/member_test.rb b/test/unit/member_test.rb index 685ecfb20..4ef66e512 100644 --- a/test/unit/member_test.rb +++ b/test/unit/member_test.rb @@ -67,8 +67,12 @@ class MemberTest < ActiveSupport::TestCase # same use can't have more than one membership for a project assert !member.save - member = Member.new(:project_id => 1, :user_id => 2, :role_ids => []) # must have one role at least + user = User.new(:firstname => "new1", :lastname => "user1", :mail => "test_validate@somenet.foo") + user.login = "test_validate" + user.password, user.password_confirmation = "password", "password" + assert user.save + member = Member.new(:project_id => 1, :user_id => user.id, :role_ids => []) assert !member.save end