on-demand release 4.0dev+
[moodle.git] / mod / data / tests / behat / data_no_calendar_capabilities.feature
CommitLineData
196aa504
NM
1@mod @mod_data
2Feature: Database with no calendar capabilites
3 In order to allow work effectively
4 As a teacher
5 I need to be able to create databases even when I cannot edit calendar events
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname | category | groupmode |
10 | Course 1 | C1 | 0 | 1 |
11 And the following "users" exist:
12 | username | firstname | lastname | email |
13 | teacher1 | Teacher | 1 | teacher1@example.com |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 And I log in as "admin"
18 And I am on "Course 1" course homepage
19 And I navigate to "Users > Permissions" in current page administration
20 And I override the system permissions of "Teacher" role with:
21 | capability | permission |
22 | moodle/calendar:manageentries | Prohibit |
23 And I log out
24
25 Scenario: Editing a database
26 Given I log in as "admin"
cf1cf222
IT
27 And the following "activities" exist:
28 | activity | name | intro | course | section | idnumber |
29 | data | Test database name | Test database description | C1 | 1 | data1 |
30 And I am on "Course 1" course homepage
31 And I follow "Test database name"
7d821080 32 And I navigate to "Settings" in current page administration
cf1cf222 33 And I set the following fields to these values:
196aa504
NM
34 | id_timeavailablefrom_enabled | 1 |
35 | id_timeavailablefrom_day | 1 |
36 | id_timeavailablefrom_month | 1 |
37 | id_timeavailablefrom_year | 2017 |
38 | id_timeavailableto_enabled | 1 |
39 | id_timeavailableto_day | 1 |
40 | id_timeavailableto_month | 4 |
41 | id_timeavailableto_year | 2017 |
42 | id_timeviewfrom_enabled | 1 |
43 | id_timeviewfrom_day | 1 |
44 | id_timeviewfrom_month | 3 |
45 | id_timeviewfrom_year | 2017 |
46 | id_timeviewto_enabled | 1 |
47 | id_timeviewto_day | 1 |
48 | id_timeviewto_month | 4 |
49 | id_timeviewto_year | 2017 |
cf1cf222 50 And I press "Save and return to course"
196aa504
NM
51 And I log out
52 When I log in as "teacher1"
53 And I am on "Course 1" course homepage with editing mode on
54 And I follow "Test database name"
7d821080 55 And I navigate to "Settings" in current page administration
196aa504
NM
56 And I set the following fields to these values:
57 | id_timeavailablefrom_year | 2018 |
58 | id_timeavailableto_year | 2018 |
59 | id_timeviewfrom_year | 2018 |
60 | id_timeviewto_year | 2018 |
61 And I press "Save and return to course"
62 Then I should see "Test database name"