We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf91cd6 commit 7b81957Copy full SHA for 7b81957
app/policies/comment_policy.rb
@@ -16,7 +16,7 @@ def show?
16
end
17
18
def index?
19
- show?
+ everyone
20
21
22
def report?
spec/policies/comment_policy_spec.rb
@@ -5,7 +5,17 @@
5
RSpec.describe CommentPolicy do
6
let(:user_types) { %i[learner teacher admin] }
7
8
- permissions :create?, :show?, :index? do
+ permissions :index? do
9
+ let(:comment) { build_stubbed(:comment) }
10
+
11
+ it 'grants access to all user types' do
12
+ user_types.each do |user_type|
13
+ expect(described_class).to permit(build_stubbed(user_type), comment)
14
+ end
15
+ permissions :create?, :show? do
let(:comment) { build_stubbed(:comment) }
it 'grants access to all user types' do
0 commit comments