Skip to content

Commit 403bca3

Browse files
committed
Shared examples for report are described explicitly
1 parent 892bbed commit 403bca3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

spec/policies/request_for_comment_policy_spec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@
9797
permissions(:report?) do
9898
let(:reports_enabled) { true }
9999

100-
it 'grants access to everyone but the author' do
100+
it 'grants report permissions to everyone but the author' do
101101
%i[external_user teacher admin].each do |factory_name|
102102
expect(policy).to permit(create(factory_name, consumer: viewer_consumer, study_groups: viewer_study_groups), rfc)
103103
end
104104
expect(policy).not_to permit(rfc.author, rfc)
105105
end
106106

107-
it 'grant access to other authors of the programming group' do
107+
it 'grant report permissions to other authors of the programming group' do
108108
rfc.submission.update(contributor: programming_group)
109109
expect(policy).to permit(viewer_other_group_member, rfc)
110110
end
@@ -135,20 +135,21 @@
135135
shared_examples 'grants report permissions to admins and other authors only' do
136136
permissions(:report?) do
137137
let(:reports_enabled) { true }
138-
it 'grants access to admins' do
138+
139+
it 'grants report permissions to admins' do
139140
expect(policy).to permit(create(:admin, consumer: viewer_consumer, study_groups: viewer_study_groups), rfc)
140141
end
141142

142-
it 'does not grant access to authors' do
143+
it 'does not grant report permissions to authors' do
143144
expect(policy).not_to permit(rfc.author, rfc)
144145
end
145146

146-
it 'grant access to other authors of the programming group' do
147+
it 'grant report permissions to other authors of the programming group' do
147148
rfc.submission.update(contributor: programming_group)
148149
expect(policy).to permit(viewer_other_group_member, rfc)
149150
end
150151

151-
it 'does not grant access to all other users' do
152+
it 'does not grant report permissions to all other users' do
152153
%i[external_user teacher].each do |factory_name|
153154
expect(policy).not_to permit(create(factory_name, consumer: viewer_consumer, study_groups: viewer_study_groups), rfc)
154155
end

0 commit comments

Comments
 (0)