Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
hunchr committed Sep 24, 2024
1 parent 5ac5c57 commit 2ee5db4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/abilities/sac_cas/person_ability_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,26 @@
end
end
end

describe "security" do
let(:person) { people(:mitglied) }

context "as employee" do
before do
role = person.roles.new(group_id: person.default_group_id,
type: Group::Geschaeftsstelle::Mitarbeiter.sti_name)
role.save(validate: false)
end

it "is permitted to show/edit security" do
expect(ability).to be_able_to(:security, person)
end
end

context "as member" do
it "is not permitted to show/edit security" do
expect(ability).not_to be_able_to(:security, person)
end
end
end
end

0 comments on commit 2ee5db4

Please sign in to comment.