aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/pundit.rb
diff options
context:
space:
mode:
authorRobert2017-05-18 22:21:55 +0200
committerRobert2017-05-18 22:21:55 +0200
commitbf0dde36ac23cfa245ec946aade882342cf071bf (patch)
treed7f87d06939de10274e86c03ba14e263da6a7767 /spec/support/pundit.rb
parentf17c8bf33d42e46f7e8e1ffc7f8f63e6e50d5be8 (diff)
downloadchouette-core-bf0dde36ac23cfa245ec946aade882342cf071bf.tar.bz2
policies specs set up
Diffstat (limited to 'spec/support/pundit.rb')
-rw-r--r--spec/support/pundit.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/support/pundit.rb b/spec/support/pundit.rb
new file mode 100644
index 000000000..66225e82f
--- /dev/null
+++ b/spec/support/pundit.rb
@@ -0,0 +1,13 @@
+require 'pundit/rspec'
+
+module Support
+ module ApplicationPolicy
+ def create_user_context(user:, referential:)
+ OpenStruct.new(user: user, context: {referential: referential})
+ end
+ end
+end
+
+RSpec.configure do | c |
+ c.include Support::ApplicationPolicy, type: :policy
+end