1 |
efrain |
1 |
@core @core_group
|
|
|
2 |
Feature: Uniqueness of Group ID number
|
|
|
3 |
In order to create unique groups and groupings
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to create groups with unique identificators
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category |
|
|
|
10 |
| Course 1 | C1 | 0 |
|
|
|
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 |
|
|
|
18 |
Scenario: Group ID number uniqueness
|
|
|
19 |
Given I am on the "Course 1" "groups" page logged in as "teacher1"
|
|
|
20 |
And I press "Create group"
|
|
|
21 |
And I set the following fields to these values:
|
|
|
22 |
| Group name | Group 1 |
|
|
|
23 |
| Group ID number | G1 |
|
|
|
24 |
And I press "Save changes"
|
|
|
25 |
When I press "Create group"
|
|
|
26 |
And I set the following fields to these values:
|
|
|
27 |
| Group name | Group 2 |
|
|
|
28 |
| Group ID number | G1 |
|
|
|
29 |
And I press "Save changes"
|
|
|
30 |
Then I should see "This ID number is already taken"
|
|
|
31 |
And I set the following fields to these values:
|
|
|
32 |
| Group ID number | G2 |
|
|
|
33 |
And I press "Save changes"
|
|
|
34 |
And I set the field "groups" to "Group 1 (0)"
|
|
|
35 |
And I press "Edit group settings"
|
|
|
36 |
And I set the following fields to these values:
|
|
|
37 |
| Group ID number | G2 |
|
|
|
38 |
And I press "Save changes"
|
|
|
39 |
And I should see "This ID number is already taken"
|
|
|
40 |
And I press "Cancel"
|
|
|
41 |
|
|
|
42 |
Scenario: Grouping ID number uniqueness
|
|
|
43 |
Given I am on the "Course 1" "groupings" page logged in as "teacher1"
|
|
|
44 |
And I press "Create grouping"
|
|
|
45 |
And I set the following fields to these values:
|
|
|
46 |
| Grouping name | Grouping 1 |
|
|
|
47 |
| Grouping ID number | GG1 |
|
|
|
48 |
And I press "Save changes"
|
|
|
49 |
When I press "Create grouping"
|
|
|
50 |
And I set the following fields to these values:
|
|
|
51 |
| Grouping name | Grouping 2 |
|
|
|
52 |
| Grouping ID number | GG1 |
|
|
|
53 |
And I press "Save changes"
|
|
|
54 |
Then I should see "This ID number is already taken"
|
|
|
55 |
And I set the following fields to these values:
|
|
|
56 |
| Grouping ID number | GG2 |
|
|
|
57 |
And I press "Save changes"
|
|
|
58 |
And I click on "Edit" "link" in the "Grouping 1" "table_row"
|
|
|
59 |
And I set the following fields to these values:
|
|
|
60 |
| Grouping ID number | GG2 |
|
|
|
61 |
And I press "Save changes"
|
|
|
62 |
And I should see "This ID number is already taken"
|
|
|
63 |
And I press "Cancel"
|