summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-09 08:14:21 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-09 08:14:21 +0000
commit907663f83c3b4ce177c1d626cccc05690a821a6b (patch)
tree0d0f99bb2bc866fc395b3902ec69cbe6eda0e583 /test
parentb3dbe07c952c1e241d2a751164b4e8c7eb7a40d9 (diff)
downloadredmine-907663f83c3b4ce177c1d626cccc05690a821a6b.tar.gz
redmine-907663f83c3b4ce177c1d626cccc05690a821a6b.zip
Rails4: replace deprecated find_all_by_* at UserTest
git-svn-id: http://svn.redmine.org/redmine/trunk@12571 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/user_test.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index b743e46c2..4e11ffecc 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -183,18 +183,18 @@ class UserTest < ActiveSupport::TestCase
end
def test_destroy_should_delete_members_and_roles
- members = Member.find_all_by_user_id(2)
- ms = members.size
+ members = Member.where(:user_id => 2)
+ ms = members.count
rs = members.collect(&:roles).flatten.size
-
+ assert ms > 0
+ assert rs > 0
assert_difference 'Member.count', - ms do
assert_difference 'MemberRole.count', - rs do
User.find(2).destroy
end
end
-
assert_nil User.find_by_id(2)
- assert Member.find_all_by_user_id(2).empty?
+ assert_equal 0, Member.where(:user_id => 2).count
end
def test_destroy_should_update_attachments