diff options
| author | Zog | 2017-12-18 17:18:25 +0100 | 
|---|---|---|
| committer | Zog | 2017-12-19 14:21:52 +0100 | 
| commit | 98c08c6fae5b0bf59231b3e402ca91307c200297 (patch) | |
| tree | 51dc7a30198d6fa83df13948fc2223effb01cc28 /spec/policies | |
| parent | 3aa5ff0d1f5e74b4c46c14e6240e7def82f0451d (diff) | |
| download | chouette-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/policies')
| -rw-r--r-- | spec/policies/calendar_policy_spec.rb | 3 | ||||
| -rw-r--r-- | spec/policies/line_referential_policy_spec.rb | 9 | ||||
| -rw-r--r-- | spec/policies/sto_area_referential_policy_spec.rb | 9 | 
3 files changed, 21 insertions, 0 deletions
| diff --git a/spec/policies/calendar_policy_spec.rb b/spec/policies/calendar_policy_spec.rb index 294be8198..8b1facc71 100644 --- a/spec/policies/calendar_policy_spec.rb +++ b/spec/policies/calendar_policy_spec.rb @@ -7,6 +7,9 @@ RSpec.describe CalendarPolicy, type: :policy do    permissions :create? do      it_behaves_like 'permitted policy', 'calendars.create', archived: true    end +  permissions :share? do +    it_behaves_like 'permitted policy and same organisation', 'calendars.share', archived: true +  end    permissions :destroy? do      it_behaves_like 'permitted policy and same organisation', 'calendars.destroy', archived: true    end diff --git a/spec/policies/line_referential_policy_spec.rb b/spec/policies/line_referential_policy_spec.rb new file mode 100644 index 000000000..7e0a9da8e --- /dev/null +++ b/spec/policies/line_referential_policy_spec.rb @@ -0,0 +1,9 @@ +RSpec.describe LineReferentialPolicy, type: :policy do + +  let( :record ){ build_stubbed :line_referential } +  before { stub_policy_scope(record) } + +  permissions :synchronize? do +    it_behaves_like 'permitted policy', 'line_referentials.synchronize' +  end +end diff --git a/spec/policies/sto_area_referential_policy_spec.rb b/spec/policies/sto_area_referential_policy_spec.rb new file mode 100644 index 000000000..5bd6da427 --- /dev/null +++ b/spec/policies/sto_area_referential_policy_spec.rb @@ -0,0 +1,9 @@ +RSpec.describe StopAreaReferentialPolicy, type: :policy do + +  let( :record ){ build_stubbed :stop_area_referential } +  before { stub_policy_scope(record) } + +  permissions :synchronize? do +    it_behaves_like 'permitted policy', 'stop_area_referentials.synchronize' +  end +end | 
