diff options
| author | Zog | 2017-12-15 11:27:14 +0100 |
|---|---|---|
| committer | Zog | 2017-12-19 14:40:38 +0100 |
| commit | 357563bbf408aa2000097ee200dfbfba1f677121 (patch) | |
| tree | 295d5a413c3b5e0d592fd1d700f713746134120f /spec/support | |
| parent | 676f45e8fd85c1422345d4d27ba2385e4bd536fe (diff) | |
| download | chouette-core-357563bbf408aa2000097ee200dfbfba1f677121.tar.bz2 | |
- Fix specs on connections_links/index
- Fix specs on connections_links/show
- Update pundit view specs helper to use the current referential when it
has already been defined
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/pundit/pundit_view_policy.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/support/pundit/pundit_view_policy.rb b/spec/support/pundit/pundit_view_policy.rb index 02a78a4e0..6a663a471 100644 --- a/spec/support/pundit/pundit_view_policy.rb +++ b/spec/support/pundit/pundit_view_policy.rb @@ -5,8 +5,9 @@ module Pundit included do let(:permissions){ nil } - let(:current_referential){ build_stubbed :referential } - let(:current_user){ build_stubbed :user, permissions: permissions } + 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 allow(view).to receive(:pundit_user) { pundit_user } |
