diff options
| author | Zog | 2017-12-18 09:25:10 +0100 |
|---|---|---|
| committer | Zog | 2017-12-19 14:40:38 +0100 |
| commit | 548fe7f13d698fe9a6620ef60fc239f28347af79 (patch) | |
| tree | 4ce7ceef8012ddee92cae6f9fb87f634ca0cf0d0 /spec/support/pundit | |
| parent | 2091a1ababa68810f42257fb392692f80b3bd78f (diff) | |
| download | chouette-core-548fe7f13d698fe9a6620ef60fc239f28347af79.tar.bz2 | |
Refs #5287; CR 1
- Get rid of ActiveSupport::Concern in the spec helpers
- Rename misnamed spec files
Diffstat (limited to 'spec/support/pundit')
| -rw-r--r-- | spec/support/pundit/pundit_view_policy.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/spec/support/pundit/pundit_view_policy.rb b/spec/support/pundit/pundit_view_policy.rb index 6a663a471..91be0624c 100644 --- a/spec/support/pundit/pundit_view_policy.rb +++ b/spec/support/pundit/pundit_view_policy.rb @@ -1,15 +1,12 @@ module Pundit module PunditViewPolicy - extend ActiveSupport::Concern - - included do - - let(:permissions){ nil } - let(:organisation){ referential.try(:organisation) } - let(:current_referential){ referential || build_stubbed(:referential) } - let(:current_user){ build_stubbed :user, permissions: permissions, organisation: organisation } - let(:pundit_user){ UserContext.new(current_user, referential: current_referential) } - before do + def self.included into + into.let(:permissions){ nil } + into.let(:organisation){ referential.try(:organisation) } + into.let(:current_referential){ referential || build_stubbed(:referential) } + into.let(:current_user){ build_stubbed :user, permissions: permissions, organisation: organisation } + into.let(:pundit_user){ UserContext.new(current_user, referential: current_referential) } + into.before do allow(view).to receive(:pundit_user) { pundit_user } allow(view).to receive(:policy) do |instance| |
