Skip to content

Commit 299d923

Browse files
committed
add other authors to authorization context
1 parent a5392c1 commit 299d923

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

spec/policies/request_for_comment_policy_spec.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
context 'when no report email is configured' do
7272
it 'does not allow reports from anyone' do
7373
%i[admin external_user teacher].each do |factory_name|
74-
expect(policy).not_to permit(create(factory_name), RequestForComment.new)
74+
expect(policy).not_to permit(create(factory_name), rfc)
7575
end
7676
end
7777
end
@@ -123,7 +123,7 @@
123123
end
124124
end
125125

126-
shared_examples 'grants access to admins only' do
126+
shared_examples 'grants access to admins and other authors only' do
127127
it 'grants access to admins' do
128128
expect(policy).to permit(create(:admin, consumer: viewer_consumer, study_groups: viewer_study_groups), rfc)
129129
end
@@ -189,7 +189,7 @@
189189
permissions(:report?) do
190190
let(:reports_enabled) { true }
191191

192-
it_behaves_like 'grants access to admins only'
192+
it_behaves_like 'grants access to admins and other authors only'
193193
end
194194
end
195195

@@ -206,7 +206,7 @@
206206
permissions(:report?) do
207207
let(:reports_enabled) { true }
208208

209-
it_behaves_like 'grants access to admins only'
209+
it_behaves_like 'grants access to admins and other authors only'
210210
end
211211
end
212212
end
@@ -273,7 +273,7 @@
273273
permissions(:report?) do
274274
let(:reports_enabled) { true }
275275

276-
it_behaves_like 'grants access to admins only'
276+
it_behaves_like 'grants access to admins and other authors only'
277277
end
278278
end
279279

@@ -290,7 +290,7 @@
290290
permissions(:report?) do
291291
let(:reports_enabled) { true }
292292

293-
it_behaves_like 'grants access to admins only'
293+
it_behaves_like 'grants access to admins and other authors only'
294294
end
295295
end
296296

@@ -307,7 +307,7 @@
307307
permissions(:report?) do
308308
let(:reports_enabled) { true }
309309

310-
it_behaves_like 'grants access to admins only'
310+
it_behaves_like 'grants access to admins and other authors only'
311311
end
312312
end
313313
end
@@ -374,7 +374,7 @@
374374
permissions(:report?) do
375375
let(:reports_enabled) { true }
376376

377-
it_behaves_like 'grants access to admins only'
377+
it_behaves_like 'grants access to admins and other authors only'
378378
end
379379
end
380380

@@ -391,7 +391,7 @@
391391
permissions(:report?) do
392392
let(:reports_enabled) { true }
393393

394-
it_behaves_like 'grants access to admins only'
394+
it_behaves_like 'grants access to admins and other authors only'
395395
end
396396
end
397397

@@ -408,7 +408,7 @@
408408
permissions(:report?) do
409409
let(:reports_enabled) { true }
410410

411-
it_behaves_like 'grants access to admins only'
411+
it_behaves_like 'grants access to admins and other authors only'
412412
end
413413
end
414414
end
@@ -428,7 +428,7 @@
428428
permissions(:report?) do
429429
let(:reports_enabled) { true }
430430

431-
it_behaves_like 'grants access to admins only'
431+
it_behaves_like 'grants access to admins and other authors only'
432432
end
433433
end
434434

0 commit comments

Comments
 (0)