From e2998505b2403a70c233cf96fac8432e950bf47d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 21 Dec 2014 11:57:01 +0000 Subject: PermissionsAttributeCoder.load called twice when mocha expectation is set. git-svn-id: http://svn.redmine.org/redmine/trunk@13780 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/role_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/unit/role_test.rb b/test/unit/role_test.rb index 6f9289964..955986609 100644 --- a/test/unit/role_test.rb +++ b/test/unit/role_test.rb @@ -57,8 +57,9 @@ class RoleTest < ActiveSupport::TestCase end def test_permissions_should_be_unserialized_with_its_coder - Role::PermissionsAttributeCoder.expects(:load).once - Role.find(1).permissions + Role::PermissionsAttributeCoder.stubs(:load).returns([:foo, :bar]) + role = Role.find(1) + assert_equal [:foo, :bar], role.permissions end def test_add_permission -- cgit v1.2.3