aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/stif
diff options
context:
space:
mode:
authorZog2017-12-18 11:53:16 +0100
committerZog2017-12-19 19:12:09 +0100
commit818bacf718594441052820ea0e7b33b9491a5b71 (patch)
treebff0e695e24186782c20d0af8a805bb5558a4414 /spec/lib/stif
parentdb4c94186ce8a5b52cc5c2b54fe84899729cbfa6 (diff)
downloadchouette-core-818bacf718594441052820ea0e7b33b9491a5b71.tar.bz2
Refs #5325@0.5h; Use policies for calendar sharing
Use policies to determine if a user is allowed to share a calendar, instead of a hardcoded string
Diffstat (limited to 'spec/lib/stif')
-rw-r--r--spec/lib/stif/permission_translator_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/stif/permission_translator_spec.rb b/spec/lib/stif/permission_translator_spec.rb
index ae1a2d1d5..355b0e336 100644
--- a/spec/lib/stif/permission_translator_spec.rb
+++ b/spec/lib/stif/permission_translator_spec.rb
@@ -42,4 +42,18 @@ RSpec.describe Stif::PermissionTranslator do
).to match_array(Support::Permissions.all_permissions)
end
end
+
+ context "For the STIF organisation" do
+ let(:organisation){ build_stubbed :organisation, name: "STIF" }
+ it "adds the calendars.share permission" do
+ expect( described_class.translate([], organisation) ).to eq(%w{calendars.share})
+ end
+
+ context "with the case changed" do
+ let(:organisation){ build_stubbed :organisation, name: "StiF" }
+ it "adds the calendars.share permission" do
+ expect( described_class.translate([], organisation) ).to eq(%w{calendars.share})
+ end
+ end
+ end
end