|
71 | 71 | context 'when no report email is configured' do |
72 | 72 | it 'does not allow reports from anyone' do |
73 | 73 | %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) |
75 | 75 | end |
76 | 76 | end |
77 | 77 | end |
|
123 | 123 | end |
124 | 124 | end |
125 | 125 |
|
126 | | - shared_examples 'grants access to admins only' do |
| 126 | + shared_examples 'grants access to admins and other authors only' do |
127 | 127 | it 'grants access to admins' do |
128 | 128 | expect(policy).to permit(create(:admin, consumer: viewer_consumer, study_groups: viewer_study_groups), rfc) |
129 | 129 | end |
|
189 | 189 | permissions(:report?) do |
190 | 190 | let(:reports_enabled) { true } |
191 | 191 |
|
192 | | - it_behaves_like 'grants access to admins only' |
| 192 | + it_behaves_like 'grants access to admins and other authors only' |
193 | 193 | end |
194 | 194 | end |
195 | 195 |
|
|
206 | 206 | permissions(:report?) do |
207 | 207 | let(:reports_enabled) { true } |
208 | 208 |
|
209 | | - it_behaves_like 'grants access to admins only' |
| 209 | + it_behaves_like 'grants access to admins and other authors only' |
210 | 210 | end |
211 | 211 | end |
212 | 212 | end |
|
273 | 273 | permissions(:report?) do |
274 | 274 | let(:reports_enabled) { true } |
275 | 275 |
|
276 | | - it_behaves_like 'grants access to admins only' |
| 276 | + it_behaves_like 'grants access to admins and other authors only' |
277 | 277 | end |
278 | 278 | end |
279 | 279 |
|
|
290 | 290 | permissions(:report?) do |
291 | 291 | let(:reports_enabled) { true } |
292 | 292 |
|
293 | | - it_behaves_like 'grants access to admins only' |
| 293 | + it_behaves_like 'grants access to admins and other authors only' |
294 | 294 | end |
295 | 295 | end |
296 | 296 |
|
|
307 | 307 | permissions(:report?) do |
308 | 308 | let(:reports_enabled) { true } |
309 | 309 |
|
310 | | - it_behaves_like 'grants access to admins only' |
| 310 | + it_behaves_like 'grants access to admins and other authors only' |
311 | 311 | end |
312 | 312 | end |
313 | 313 | end |
|
374 | 374 | permissions(:report?) do |
375 | 375 | let(:reports_enabled) { true } |
376 | 376 |
|
377 | | - it_behaves_like 'grants access to admins only' |
| 377 | + it_behaves_like 'grants access to admins and other authors only' |
378 | 378 | end |
379 | 379 | end |
380 | 380 |
|
|
391 | 391 | permissions(:report?) do |
392 | 392 | let(:reports_enabled) { true } |
393 | 393 |
|
394 | | - it_behaves_like 'grants access to admins only' |
| 394 | + it_behaves_like 'grants access to admins and other authors only' |
395 | 395 | end |
396 | 396 | end |
397 | 397 |
|
|
408 | 408 | permissions(:report?) do |
409 | 409 | let(:reports_enabled) { true } |
410 | 410 |
|
411 | | - it_behaves_like 'grants access to admins only' |
| 411 | + it_behaves_like 'grants access to admins and other authors only' |
412 | 412 | end |
413 | 413 | end |
414 | 414 | end |
|
428 | 428 | permissions(:report?) do |
429 | 429 | let(:reports_enabled) { true } |
430 | 430 |
|
431 | | - it_behaves_like 'grants access to admins only' |
| 431 | + it_behaves_like 'grants access to admins and other authors only' |
432 | 432 | end |
433 | 433 | end |
434 | 434 |
|
|
0 commit comments