-
Notifications
You must be signed in to change notification settings - Fork 3
/
katas.feature
96 lines (84 loc) · 3.61 KB
/
katas.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Feature: Prepared katas
In order to people to know someone has prepared a kata
As a registered user
I want to be able to add/remove a prepared kata with title, language and description
Scenario: Add a kata when there are no katas yet
Given I am on the root page
And I am logged in
When I follow "Katas"
And I follow "New"
And I fill in "title" with "Rubik's Cube"
And I fill in "description" with "The famous problem"
And I fill in "language" with "Haskell"
And I press "Add"
Then I should see the kata "Rubik's Cube" by "me" in "Haskell"
Scenario: Add a kata when there is already a kata
Given I am on the root page
And I am logged in
And there is a kata created by "me@myself.com" with title "Large Prime Factorization" in the language "LISP"
When I follow "Katas"
And I follow "New"
And I fill in "title" with "Rubik's Cube"
And I fill in "description" with "The famous problem"
And I fill in "language" with "Haskell"
And I press "Add"
Then I should see the kata "Rubik's Cube" by "me" in "Haskell"
And I should see the kata "Large Prime Factorization" by "me@myself.com" in "LISP"
Scenario: Remove a kata when there is only one kata
Given I am logged in
And there is a kata created by "me" with title "Rubik's Cube" in the language "Haskell"
And I am on the katas page
When I follow "delete_1st"
Then I should see "No prepared katas"
Scenario: Remove a kata when there are more katas
Given I am logged in
And there is a kata created by "me" with title "Rubik's Cube" in the language "Haskell"
And there is a kata created by "me@myself.com" with title "Large Prime Factorization" in the language "LISP"
And I am on the katas page
When I follow "delete_2nd"
Then I should see "Rubik's Cube"
And I should not see "Large Prime Factorization"
Scenario: Edit a kata created by me
Given I am logged in
And there is a kata created by "me" with title "Rubik's Cube" in the language "Haskell"
And I am on the katas page
When I follow "edit_1st"
And I fill in "language" with "Prolog"
And I press "Save"
Then I should see the kata "Rubik's Cube" by "me" in "Prolog"
And I should not see "Haskell"
Scenario: Create a kata without title
Given I am logged in
And I am on the katas page
When I follow "New"
And I fill in "description" with "The famous problem"
And I fill in "language" with "Haskell"
And I press "Add"
Then I should see "Title can't be blank"
Scenario: Create a kata without language
Given I am logged in
And I am on the katas page
When I follow "New"
And I fill in "title" with "Rubik's Cube"
And I fill in "description" with "The famous problem"
And I press "Add"
Then I should see "Language can't be blank"
Scenario: Remove the title of an existing kata
Given I am logged in
And there is a kata created by "me" with title "Rubik's Cube" in the language "Haskell"
And I am on the katas page
When I follow "edit_1st"
And I fill in "title" with ""
And I press "Save"
Then I should see "Title can't be blank"
Scenario: Remove the language of an existing kata
Given I am logged in
And there is a kata created by "me" with title "Rubik's Cube" in the language "Haskell"
And I am on the katas page
When I follow "edit_1st"
And I fill in "language" with ""
And I press "Save"
Then I should see "Language can't be blank"
Scenario: Try to add a prepared kata not being logged in
Scenario: Try to delete a kata not being logged in
Scenario: Try to edit a kata not being logged in