Unit test for #1469

This commit is contained in:
Karel Pičman 2023-08-23 09:42:54 +02:00
parent 4120744315
commit 8190c2e07c

View File

@ -31,7 +31,7 @@ class DmsfFolderTest < RedmineDmsf::Test::UnitTest
@link2 = DmsfLink.find 2
end
def test_visiblity
def test_visibility
# The role has got permissions
User.current = @jsmith
assert_equal 7, DmsfFolder.where(project_id: @project1.id).all.size
@ -47,6 +47,17 @@ class DmsfFolderTest < RedmineDmsf::Test::UnitTest
assert_equal 5, DmsfFolder.visible.where(project_id: @project1.id).all.size
end
def test_visible
assert @folder1.visible?
assert @folder1.visible?(@jsmith)
@folder1.deleted = DmsfFolder::STATUS_DELETED
class << @folder1
attr_accessor :type
end
@folder1.type = 'folder'
assert_not @folder1.visible?
end
def test_permissions
User.current = @dlopper
assert DmsfFolder.permissions?(@folder7)