diff options
| author | cedricnjanga | 2017-07-19 10:13:12 +0200 |
|---|---|---|
| committer | cedricnjanga | 2017-07-19 10:13:23 +0200 |
| commit | a01acfaee6bbc4cd3630ad3ca2d749ff471d3c61 (patch) | |
| tree | 2108be48d659bff9d7ec2e2867c02a4072981969 | |
| parent | ca4902a828a702f677637029493d9de6a7b5433b (diff) | |
| download | chouette-core-a01acfaee6bbc4cd3630ad3ca2d749ff471d3c61.tar.bz2 | |
Adapt test for clone policies changes (user from different organisation)
| -rw-r--r-- | spec/decorators/referential_decorator_spec.rb | 5 | ||||
| -rw-r--r-- | spec/policies/referential_policy_spec.rb | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/spec/decorators/referential_decorator_spec.rb b/spec/decorators/referential_decorator_spec.rb index 5de6b7e95..16da8d30b 100644 --- a/spec/decorators/referential_decorator_spec.rb +++ b/spec/decorators/referential_decorator_spec.rb @@ -25,7 +25,7 @@ RSpec.describe ReferentialDecorator, type: [:helper, :decorator] do end end - context 'all rights and different organisation' do + context 'all rights and different organisation' do let( :user ){ build_stubbed :allmighty_user } @@ -33,10 +33,11 @@ RSpec.describe ReferentialDecorator, type: [:helper, :decorator] do expect_action_link_elements.to be_empty expect_action_link_hrefs.to eq([ referential_time_tables_path(object), + new_referential_path(from: object), ]) end end - context 'all rights and same organisation' do + context 'all rights and same organisation' do let( :user ){ build_stubbed :allmighty_user, organisation: referential.organisation } diff --git a/spec/policies/referential_policy_spec.rb b/spec/policies/referential_policy_spec.rb index 33d8e13e8..69d0eb17b 100644 --- a/spec/policies/referential_policy_spec.rb +++ b/spec/policies/referential_policy_spec.rb @@ -46,7 +46,7 @@ RSpec.describe ReferentialPolicy, type: :policy do # ------------------ permissions :clone? do - it_behaves_like 'permitted policy and same organisation', 'referentials.create', archived: true + it_behaves_like 'permitted policy', 'referentials.create', archived: true end permissions :archive? do |
