1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 09:21:12 +00:00

PermissionsAttributeCoder.load called twice when mocha expectation is set.

git-svn-id: http://svn.redmine.org/redmine/trunk@13780 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2014-12-21 11:57:01 +00:00
parent 8ed791d690
commit e2998505b2

View File

@ -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