diff options
| author | Zog | 2018-01-31 11:39:39 +0100 |
|---|---|---|
| committer | Zog | 2018-01-31 11:39:39 +0100 |
| commit | fe7915ffac359db41c7737a3847f31a728f502e6 (patch) | |
| tree | e733b44018321cc8eec28b147813cb279db40b7a /spec/support | |
| parent | 4023ea52097a47458ac2fcad36d343aba0c8e68b (diff) | |
| download | chouette-core-fe7915ffac359db41c7737a3847f31a728f502e6.tar.bz2 | |
Refs #5683 @2H; Fix specs and refactor action_links
Note: Did not fix the missing workgroup in the calendar mailer
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/pundit/pundit_view_policy.rb | 5 | ||||
| -rw-r--r-- | spec/support/referential.rb | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/spec/support/pundit/pundit_view_policy.rb b/spec/support/pundit/pundit_view_policy.rb index 91be0624c..330209049 100644 --- a/spec/support/pundit/pundit_view_policy.rb +++ b/spec/support/pundit/pundit_view_policy.rb @@ -2,9 +2,8 @@ module Pundit module PunditViewPolicy 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(:current_referential){ referential || build_stubbed(:referential, organisation: organisation) } + into.let(:current_user){ create :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 } diff --git a/spec/support/referential.rb b/spec/support/referential.rb index 497ff47a8..9acdce73a 100644 --- a/spec/support/referential.rb +++ b/spec/support/referential.rb @@ -11,8 +11,8 @@ module ReferentialHelper def self.included(base) base.class_eval do extend ClassMethods - alias_method :referential, :first_referential - alias_method :organisation, :first_organisation + base.let(:referential){ first_referential } + base.let(:organisation){ first_organisation } end end |
