1 |
efrain |
1 |
@core @core_my
|
|
|
2 |
Feature: Restrict which blocks can be added to Dashboard
|
|
|
3 |
In order to restrict which blocks can be added
|
|
|
4 |
As a student I need to ensure I can add the blocks
|
|
|
5 |
As an admin I need to remove the capability to add a blocks
|
|
|
6 |
As a student I need to ensure I can't add the blocks any more
|
|
|
7 |
|
|
|
8 |
Background:
|
|
|
9 |
Given the following "users" exist:
|
|
|
10 |
| username | firstname | lastname | email |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | format |
|
|
|
14 |
| Course 1 | C1 | topics |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| student1 | C1 | student |
|
|
|
18 |
|
|
|
19 |
Scenario: The comments block can be added to Dashboard by default
|
|
|
20 |
And I log in as "student1"
|
|
|
21 |
And I turn editing mode on
|
|
|
22 |
Then the add block selector should contain "Comments" block
|
|
|
23 |
And the add block selector should contain "Text" block
|
|
|
24 |
And the add block selector should contain "Tags" block
|
|
|
25 |
|
|
|
26 |
Scenario: Remove the ability to add the comments block to Dashboard
|
|
|
27 |
Given the following "role capability" exists:
|
|
|
28 |
| role | user |
|
|
|
29 |
| block/comments:myaddinstance | prohibit |
|
|
|
30 |
| block/course_list:myaddinstance | prohibit |
|
|
|
31 |
| block/html:myaddinstance | prohibit |
|
|
|
32 |
When I log in as "student1"
|
|
|
33 |
And I turn editing mode on
|
|
|
34 |
Then the add block selector should not contain "Comments" block
|
|
|
35 |
And the add block selector should not contain "Courses" block
|
|
|
36 |
And the add block selector should not contain "Text" block
|
|
|
37 |
And the add block selector should contain "Tags" block
|