Skip to content

Commit

Permalink
Update test policies to match what we have in Centah
Browse files Browse the repository at this point in the history
Because we forked pundit we have to test against that forked pundit as well.
  • Loading branch information
Skipants committed Sep 23, 2024
1 parent 42da451 commit 690e22a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 7 additions & 1 deletion spec/dummy/app/policies/article_policy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
class ArticlePolicy
class Scope < Struct.new(:user, :scope)
class Scope
def initialize(user, scope, options: {})
@user = user
@scope = scope
@options = options
end

def resolve
raise NotImplementedError
end
Expand Down
8 changes: 7 additions & 1 deletion spec/dummy/app/policies/comment_policy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
class CommentPolicy
class Scope < Struct.new(:user, :scope)
class Scope
def initialize(user, scope, options: {})
@user = user
@scope = scope
@options = options
end

def resolve
raise NotImplementedError
end
Expand Down
8 changes: 7 additions & 1 deletion spec/dummy/app/policies/tag_policy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
class TagPolicy
class Scope < Struct.new(:user, :scope)
class Scope
def initialize(user, scope, options: {})
@user = user
@scope = scope
@options = options
end

def resolve
raise NotImplementedError
end
Expand Down
8 changes: 7 additions & 1 deletion spec/dummy/app/policies/user_policy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
class UserPolicy
class Scope < Struct.new(:user, :scope)
class Scope
def initialize(user, scope, options: {})
@user = user
@scope = scope
@options = options
end

def resolve
raise NotImplementedError
end
Expand Down

0 comments on commit 690e22a

Please sign in to comment.