Add testing for moderator users and issues
This commit is contained in:
parent
149c07fd2b
commit
41619593df
1 changed files with 14 additions and 0 deletions
|
@ -40,6 +40,20 @@ class UserAbilityTest < AbilityTest
|
|||
assert ability.cannot?(action, DiaryEntry), "should be able to #{action} DiaryEntries"
|
||||
assert ability.cannot?(action, DiaryComment), "should be able to #{action} DiaryEntries"
|
||||
end
|
||||
|
||||
[:index, :show, :resolve, :ignore, :reopen].each do |action|
|
||||
assert ability.cannot?(action, Issue), "should not be able to #{action} Issues"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
class ModeratorAbilityTest < AbilityTest
|
||||
test "Issue permissions" do
|
||||
ability = Ability.new create(:moderator_user)
|
||||
|
||||
[:index, :show, :resolve, :ignore, :reopen].each do |action|
|
||||
assert ability.can?(action, Issue), "should be able to #{action} Issues"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue