aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
authorRobert2017-05-24 13:57:51 +0200
committerRobert2017-05-24 13:57:51 +0200
commitf704e1366ac3185aefbc8ad4ee6312b9f1249684 (patch)
treed22440a31801faba4bc5d11bec7a346b80ee3a88 /spec/support
parenta83ee0d627ac4a9c4626bfdc2e5ecd2157577b24 (diff)
downloadchouette-core-f704e1366ac3185aefbc8ad4ee6312b9f1249684.tar.bz2
Refs: #3446; hotfix
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/pundit/shared_examples.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/support/pundit/shared_examples.rb b/spec/support/pundit/shared_examples.rb
index 51a25ba7a..4d14c46da 100644
--- a/spec/support/pundit/shared_examples.rb
+++ b/spec/support/pundit/shared_examples.rb
@@ -1,5 +1,5 @@
RSpec.shared_examples 'permitted policy and same organisation' do
- | permission, restricted_ready: false|
+ | permission, archived: false|
context 'permission absent → ' do
it "denies a user with a different organisation" do
@@ -25,10 +25,10 @@ RSpec.shared_examples 'permitted policy and same organisation' do
expect_it.to permit(user_context, referential)
end
- if restricted_ready
+ if archived
it 'removes the permission for archived referentials' do
user.update_attribute :organisation, referential.organisation
- referential.update_attribute :ready, true
+ referential.update_attribute :archived_at, 42.seconds.ago
expect_it.not_to permit(user_context, referential)
end
end
@@ -36,7 +36,7 @@ RSpec.shared_examples 'permitted policy and same organisation' do
end
RSpec.shared_examples 'permitted policy' do
- | permission, restricted_ready: false|
+ | permission, archived: false|
context 'permission absent → ' do
it "denies a user with a different organisation" do
expect_it.not_to permit(user_context, referential)
@@ -50,9 +50,9 @@ RSpec.shared_examples 'permitted policy' do
expect_it.to permit(user_context, referential)
end
- if restricted_ready
+ if archived
it 'removes the permission for archived referentials' do
- referential.update_attribute :ready, true
+ referential.update_attribute :archived_at, 42.seconds.ago
expect_it.not_to permit(user_context, referential)
end
end