aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/pundit/policies.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-06-15 16:37:33 +0200
committerTeddy Wing2017-06-15 16:38:44 +0200
commitb011960b67c7cadecb8d948934f13071d9ae4df1 (patch)
tree972afaa0fa7dbf6a9fdc1e007a5165fb679a8c52 /spec/support/pundit/policies.rb
parent690428d470440c604dcac52549baca8887fcd4c3 (diff)
downloadchouette-core-b011960b67c7cadecb8d948934f13071d9ae4df1.tar.bz2
spec/Support::Pundit::Policies: Use UserContext instead of OpenStruct
There's a `UserContext` class that allows us to build user contexts. We should use the full type for this instead of creating an anonymous one for the context.
Diffstat (limited to 'spec/support/pundit/policies.rb')
-rw-r--r--spec/support/pundit/policies.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/support/pundit/policies.rb b/spec/support/pundit/policies.rb
index e18309226..56433b2ee 100644
--- a/spec/support/pundit/policies.rb
+++ b/spec/support/pundit/policies.rb
@@ -9,7 +9,7 @@ module Support
end
def create_user_context(user:, referential:)
- OpenStruct.new(user: user, context: {referential: referential})
+ UserContext.new(user, referential: referential)
end
def add_permissions(*permissions, for_user:)