diff options
Diffstat (limited to 'spec/lib')
| -rw-r--r-- | spec/lib/stif/permission_translator_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/stif/permission_translator_spec.rb b/spec/lib/stif/permission_translator_spec.rb index ae1a2d1d5..9771af187 100644 --- a/spec/lib/stif/permission_translator_spec.rb +++ b/spec/lib/stif/permission_translator_spec.rb @@ -1,3 +1,4 @@ +# coding: utf-8 RSpec.describe Stif::PermissionTranslator do context "No SSO Permissions" do @@ -42,4 +43,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 STIF 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 STIF permission" do + expect(described_class.translate([], organisation).sort).to eq permissions + end + end + end end |
