1 |
efrain |
1 |
@core @core_calendar
|
|
|
2 |
Feature: Course Category Events
|
|
|
3 |
In order to inform multiple courses of shared events
|
|
|
4 |
As a manager
|
|
|
5 |
I need to create catgory events
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| managera | Manager | A | managera@example.com |
|
|
|
11 |
| managera1 | Manager | A1 | managera1@example.com |
|
|
|
12 |
| managera2 | Manager | A2 | managera2@example.com |
|
|
|
13 |
| teachera1i | Teacher | A1i | teachera1i@example.com |
|
|
|
14 |
| managerb | Manager | B | managerb@example.com |
|
|
|
15 |
| managerb1 | Manager | B1 | managerb1@example.com |
|
|
|
16 |
| managerb2 | Manager | B2 | managerb2@example.com |
|
|
|
17 |
| teacherb1i | Teacher | B1i | teacherb1i@example.com |
|
|
|
18 |
| student1 | Student | 1 | student1@example.com |
|
|
|
19 |
| student2 | Student | 2 | student2@example.com |
|
|
|
20 |
And the following "categories" exist:
|
|
|
21 |
| name | idnumber | category |
|
|
|
22 |
| Year | year | |
|
|
|
23 |
| Faculty A | faculty-a | year |
|
|
|
24 |
| Faculty B | faculty-b | year |
|
|
|
25 |
| Department A1 | department-a1 | faculty-a |
|
|
|
26 |
| Department A2 | department-a2 | faculty-a |
|
|
|
27 |
| Department B1 | department-b1 | faculty-b |
|
|
|
28 |
| Department B2 | department-b2 | faculty-b |
|
|
|
29 |
And the following "courses" exist:
|
|
|
30 |
| fullname | shortname | idnumber | format | category |
|
|
|
31 |
| Course A1i | A1i | A1i | topics | department-a1 |
|
|
|
32 |
| Course A2i | A2i | A2i | topics | department-a2 |
|
|
|
33 |
| Course B1i | B1i | B1i | topics | department-b1 |
|
|
|
34 |
| Course B2i | B2i | B2i | topics | department-b2 |
|
|
|
35 |
And the following "role assigns" exist:
|
|
|
36 |
| user | role | contextlevel | reference |
|
|
|
37 |
| managera | manager | Category | faculty-a |
|
|
|
38 |
| managera1 | manager | Category | department-a1 |
|
|
|
39 |
| managerb | manager | Category | faculty-b |
|
|
|
40 |
| managerb1 | manager | Category | department-b1 |
|
|
|
41 |
And the following "course enrolments" exist:
|
|
|
42 |
| user | course | role |
|
|
|
43 |
| teachera1i | A1i | editingteacher |
|
|
|
44 |
| teacherb1i | B1i | editingteacher |
|
|
|
45 |
| student1 | A1i | student |
|
|
|
46 |
| student1 | A2i | student |
|
|
|
47 |
| student2 | B1i | student |
|
|
|
48 |
| student2 | B2i | student |
|
|
|
49 |
And the following "events" exist:
|
|
|
50 |
| name | eventtype |
|
|
|
51 |
| Site event | site |
|
|
|
52 |
And the following "events" exist:
|
|
|
53 |
| name | eventtype | course |
|
|
|
54 |
| CA1i event | course | A1i |
|
|
|
55 |
| CA2i event | course | A2i |
|
|
|
56 |
| CB1i event | course | B1i |
|
|
|
57 |
| CB2i event | course | B2i |
|
|
|
58 |
And the following "events" exist:
|
|
|
59 |
| name | eventtype | category |
|
|
|
60 |
| FA event | category | faculty-a |
|
|
|
61 |
| DA1 event | category | department-a1 |
|
|
|
62 |
| DA2 event | category | department-a1 |
|
|
|
63 |
| FB event | category | faculty-b |
|
|
|
64 |
| DB1 event | category | department-b1 |
|
|
|
65 |
| DB2 event | category | department-b1 |
|
|
|
66 |
|
|
|
67 |
@javascript
|
|
|
68 |
Scenario: Manager of a Category can see all child and parent events in their category
|
|
|
69 |
Given I log in as "managera"
|
|
|
70 |
When I follow "Calendar" in the user menu
|
|
|
71 |
Then I should see "FA event"
|
|
|
72 |
And I should see "DA1 event"
|
|
|
73 |
And I should see "DA2 event"
|
|
|
74 |
And I should not see "FB event"
|
|
|
75 |
And I should not see "DB1 event"
|
|
|
76 |
And I should not see "DB2 event"
|
|
|
77 |
And I log out
|
|
|
78 |
Given I log in as "managerb"
|
|
|
79 |
And I follow "Calendar" in the user menu
|
|
|
80 |
Then I should see "FB event"
|
|
|
81 |
And I should see "DB1 event"
|
|
|
82 |
And I should see "DB2 event"
|
|
|
83 |
And I should not see "FA event"
|
|
|
84 |
And I should not see "DA1 event"
|
|
|
85 |
And I should not see "DA2 event"
|
|
|
86 |
|
|
|
87 |
@javascript
|
|
|
88 |
Scenario: Users enrolled in a course can see all child and parent events in their category
|
|
|
89 |
Given I log in as "student1"
|
|
|
90 |
When I follow "Calendar" in the user menu
|
|
|
91 |
Then I should see "FA event"
|
|
|
92 |
And I should see "DA1 event"
|
|
|
93 |
And I should see "DA2 event"
|
|
|
94 |
And I should see "CA1i event"
|
|
|
95 |
And I should see "CA2i event"
|
|
|
96 |
And I should not see "FB event"
|
|
|
97 |
And I should not see "DB1 event"
|
|
|
98 |
And I should not see "DB2 event"
|
|
|
99 |
And I should not see "CB1i event"
|
|
|
100 |
And I should not see "CB2i event"
|