forked from Overbryd/Pericles
/
add_user.feature
57 lines (54 loc) · 1.97 KB
/
add_user.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
@authenticated
Feature: add user
Scenario: add a new user
When I visit "/users"
And I follow "Add User"
And I fill in "name" with "chuck"
And I fill in "password" with "norris"
And I fill in "password_confirmation" with "norris"
And I press "Create"
When I visit "/users"
Then I should see "chuck"
Scenario: faulty input
When I visit "/users"
And I follow "Add User"
And I fill in "name" with " "
And I fill in "password" with "norris"
And I fill in "password_confirmation" with "norris"
And I press "Create"
Then I should see "Incorrect input, please revise."
When I follow "Add User"
And I fill in "name" with ""
And I fill in "password" with "norris"
And I fill in "password_confirmation" with "norris"
And I press "Create"
Then I should see "Incorrect input, please revise."
When I follow "Add User"
And I fill in "name" with "chuck"
And I fill in "password" with ""
And I fill in "password_confirmation" with ""
And I press "Create"
Then I should see "Incorrect input, please revise."
When I follow "Add User"
And I fill in "name" with "chuck"
And I fill in "password" with "nor"
And I fill in "password_confirmation" with "ris"
And I press "Create"
Then I should see "Incorrect input, please revise."
When I follow "Add User"
And I fill in "name" with "chuck"
And I fill in "password" with "12345"
And I fill in "password_confirmation" with "12345"
And I press "Create"
Then I should see "Incorrect input, please revise."
When I visit "/users"
Then I should not see "chuck"
Scenario: trying to add an existing user
Given a user "chuck/norris"
When I visit "/users"
And I follow "Add User"
And I fill in "name" with "chuck"
And I fill in "password" with "norris"
And I press "Create"
Then I should see "Incorrect input, please revise."
And I should see "Names must be unique"