-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRenameCourse.feature
45 lines (41 loc) · 2.09 KB
/
RenameCourse.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Feature: Renaming courses
Scenario: Renaming non-existing course
Given course "c1" exists
When course "non-existing" is renamed to "New course Title"
Then the command should be rejected with the following message:
"""
Failed to rename course with id "non-existing" because a course with that id does not exist
"""
And no events should be appended
Scenario: Renaming non-existing course without actually changing the name
Given course "c1" exists with the title "course 01"
When course "c1" is renamed to "course 01"
Then the command should be rejected with the following message:
"""
Failed to rename course with id "c1" to "course 01" because this is already the title of this course
"""
And no events should be appended
Scenario: Renaming course
Given course "c1" exists with the title "course 01"
When course "c1" is renamed to "course 01 renamed"
Then the following events should be read:
| Type | Tags |
| "CourseCreated" | ["course:c1"] |
And the command should pass without errors
And the following event should be appended:
| Type | Data | Tags |
| "CourseRenamed" | {"courseId": "c1", "newCourseTitle": "course 01 renamed"} | ["course:c1"] |
Scenario: Renaming course
Given course "c1" exists with the title "course 01"
When course "c1" is renamed to "course 01 renamed 1"
When course "c1" is renamed to "course 01 renamed 2"
When course "c1" is renamed to "course 01 renamed 3"
Then the following events should be read:
| Type | Tags |
| "CourseCreated" | ["course:c1"] |
| "CourseRenamed" | ["course:c1"] |
| "CourseRenamed" | ["course:c1"] |
And the command should pass without errors
And the following event should be appended:
| Type | Data | Tags |
| "CourseRenamed" | {"courseId": "c1", "newCourseTitle": "course 01 renamed 3"} | ["course:c1"] |