diff options
| author | Robert | 2017-05-24 08:02:31 +0200 | 
|---|---|---|
| committer | Robert | 2017-05-24 08:02:31 +0200 | 
| commit | 571ce311bb44e5042189529cfb63bd09106ddc22 (patch) | |
| tree | a5efc848ed6cb21339468057ab9bb0871b075027 /spec/policies | |
| parent | d5063b73ff1e794d32a73d85880c541113fe29c6 (diff) | |
| download | chouette-core-571ce311bb44e5042189529cfb63bd09106ddc22.tar.bz2 | |
Refs: #3446; Applying to routes policy
Diffstat (limited to 'spec/policies')
| -rw-r--r-- | spec/policies/route_policy_spec.rb | 22 | 
1 files changed, 22 insertions, 0 deletions
| diff --git a/spec/policies/route_policy_spec.rb b/spec/policies/route_policy_spec.rb new file mode 100644 index 000000000..706ead3a3 --- /dev/null +++ b/spec/policies/route_policy_spec.rb @@ -0,0 +1,22 @@ +RSpec.describe RoutePolicy, type: :policy do + +  permissions :create? do +    it_behaves_like 'permitted policy', 'routes.create', restricted_ready: true +  end + +  permissions :destroy? do +    it_behaves_like 'permitted policy and same organisation', 'routes.destroy', restricted_ready: true +  end + +  permissions :edit? do +    it_behaves_like 'permitted policy and same organisation', 'routes.edit', restricted_ready: true +  end + +  permissions :new? do +    it_behaves_like 'permitted policy', 'routes.create', restricted_ready: true +  end + +  permissions :update? do +    it_behaves_like 'permitted policy and same organisation', 'routes.edit', restricted_ready: true +  end +end | 
