|
186 | 186 | it { is_expected.not_to be_able_to(:destroy, project) } |
187 | 187 | end |
188 | 188 |
|
189 | | - context 'when user is a school teacher' do |
| 189 | + context 'when user is another teacher in the same school' do |
190 | 190 | before do |
191 | 191 | create(:teacher_role, user_id: user.id, school:) |
192 | 192 | end |
193 | 193 |
|
194 | | - it { is_expected.to be_able_to(:read, project) } |
195 | | - it { is_expected.to be_able_to(:show_context, project) } |
| 194 | + it { is_expected.not_to be_able_to(:read, project) } |
| 195 | + it { is_expected.not_to be_able_to(:show_context, project) } |
196 | 196 | it { is_expected.not_to be_able_to(:create, project) } |
197 | | - it { is_expected.to be_able_to(:update, project) } |
| 197 | + it { is_expected.not_to be_able_to(:update, project) } |
198 | 198 | it { is_expected.not_to be_able_to(:set_finished, project.school_project) } |
199 | 199 | it { is_expected.not_to be_able_to(:destroy, project) } |
200 | 200 | end |
|
248 | 248 | it { is_expected.not_to be_able_to(:destroy, project) } |
249 | 249 | end |
250 | 250 |
|
251 | | - context 'when user is a school teacher' do |
| 251 | + context 'when user is another teacher in the same school' do |
252 | 252 | before do |
253 | 253 | create(:teacher_role, user_id: user.id, school:) |
254 | 254 | end |
255 | 255 |
|
256 | | - it { is_expected.to be_able_to(:read, project) } |
257 | | - it { is_expected.to be_able_to(:show_context, project) } |
| 256 | + it { is_expected.not_to be_able_to(:read, project) } |
| 257 | + it { is_expected.not_to be_able_to(:show_context, project) } |
258 | 258 | it { is_expected.not_to be_able_to(:create, project) } |
259 | | - it { is_expected.to be_able_to(:update, project) } |
| 259 | + it { is_expected.not_to be_able_to(:update, project) } |
260 | 260 | it { is_expected.not_to be_able_to(:set_finished, project.school_project) } |
261 | 261 | it { is_expected.not_to be_able_to(:destroy, project) } |
262 | 262 | end |
|
0 commit comments