aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
authorZog2017-12-18 17:18:25 +0100
committerZog2017-12-19 14:21:52 +0100
commit98c08c6fae5b0bf59231b3e402ca91307c200297 (patch)
tree51dc7a30198d6fa83df13948fc2223effb01cc28 /spec/lib
parent3aa5ff0d1f5e74b4c46c14e6240e7def82f0451d (diff)
downloadchouette-core-98c08c6fae5b0bf59231b3e402ca91307c200297.tar.bz2
Refs #5333@1.5h; Use permissions to sync StopAreas and Lines
- add missing policies - update permissions translator - update views to check for the permission - update views helper to check for the permission - uipdate controllers to check for the permission
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/stif/permission_translator_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/stif/permission_translator_spec.rb b/spec/lib/stif/permission_translator_spec.rb
index ae1a2d1d5..04fc1c6f3 100644
--- a/spec/lib/stif/permission_translator_spec.rb
+++ b/spec/lib/stif/permission_translator_spec.rb
@@ -42,4 +42,19 @@ 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" }
+ let(:permissions){ %w{calendars.share stop_area_referentials.synchronize line_referentials.synchronize}.sort }
+ it "adds the calendars.share permission" do
+ expect(described_class.translate([], organisation).sort).to eq permissions
+ 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).sort).to eq permissions
+ end
+ end
+ end
end