MDL-66431 core: Remove activity chooser user preference.
[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"
27 And I am on "Course 1" course homepage with editing mode on
28 When I add a "Database" to section "1" and I fill the form with:
29 | Name | Test database name |
30 | Description | Test database description |
31 | id_timeavailablefrom_enabled | 1 |
32 | id_timeavailablefrom_day | 1 |
33 | id_timeavailablefrom_month | 1 |
34 | id_timeavailablefrom_year | 2017 |
35 | id_timeavailableto_enabled | 1 |
36 | id_timeavailableto_day | 1 |
37 | id_timeavailableto_month | 4 |
38 | id_timeavailableto_year | 2017 |
39 | id_timeviewfrom_enabled | 1 |
40 | id_timeviewfrom_day | 1 |
41 | id_timeviewfrom_month | 3 |
42 | id_timeviewfrom_year | 2017 |
43 | id_timeviewto_enabled | 1 |
44 | id_timeviewto_day | 1 |
45 | id_timeviewto_month | 4 |
46 | id_timeviewto_year | 2017 |
47 And I log out
48 When I log in as "teacher1"
49 And I am on "Course 1" course homepage with editing mode on
50 And I follow "Test database name"
51 And I navigate to "Edit settings" in current page administration
52 And I set the following fields to these values:
53 | id_timeavailablefrom_year | 2018 |
54 | id_timeavailableto_year | 2018 |
55 | id_timeviewfrom_year | 2018 |
56 | id_timeviewto_year | 2018 |
57 And I press "Save and return to course"
58 Then I should see "Test database name"