|
11 | 11 | end |
12 | 12 |
|
13 | 13 | Then /^I should be already signed in$/ do |
14 | | - And %{I should see "Logout"} |
| 14 | + step %{I should see "Logout"} |
15 | 15 | end |
16 | 16 |
|
17 | 17 | Given /^I am signed up as "(.*)\/(.*)"$/ do |username, password| |
18 | | - Given %{I am not logged in} |
19 | | - When %{I go to the sign up page} |
20 | | - And %{I fill in "Username" with "#{username}"} |
21 | | - And %{I fill in "Email" with "#{username}@example.com"} |
22 | | - And %{I fill in "Password" with "#{password}"} |
23 | | - And %{I fill in "Password confirmation" with "#{password}"} |
24 | | - And %{I press "Sign up"} |
25 | | - Then %{I should see "You have signed up successfully. If enabled, a confirmation was sent to your e-mail."} |
26 | | - And %{I am logout} |
| 18 | + step %{I am not logged in} |
| 19 | + step %{I go to the sign up page} |
| 20 | + step %{I fill in "Username" with "#{username}"} |
| 21 | + step %{I fill in "Email" with "#{username}@example.com"} |
| 22 | + step %{I fill in "Password" with "#{password}"} |
| 23 | + step %{I fill in "Password confirmation" with "#{password}"} |
| 24 | + step %{I press "Sign up"} |
| 25 | + step %{I should see "You have signed up successfully. If enabled, a confirmation was sent to your e-mail."} |
| 26 | + step %{I am logout} |
27 | 27 | end |
28 | 28 |
|
29 | 29 | Then /^I sign out$/ do |
30 | 30 | visit(logout_path) |
31 | 31 | end |
32 | 32 |
|
33 | 33 | Given /^I am logout$/ do |
34 | | - Given %{I sign out} |
| 34 | + step %{I sign out} |
35 | 35 | end |
36 | 36 |
|
37 | 37 | Given /^I am not logged in$/ do |
38 | | - Given %{I sign out} |
| 38 | + step %{I sign out} |
39 | 39 | end |
40 | 40 |
|
41 | 41 | When /^I sign in as "(.*)\/(.*)"$/ do |username, password| |
42 | | - Given %{I am not logged in} |
43 | | - When %{I go to the sign in page} |
44 | | - And %{I fill in "Username" with "#{username}"} |
45 | | - And %{I fill in "Password" with "#{password}"} |
46 | | - And %{I press "Sign in"} |
| 42 | + step %{I am not logged in} |
| 43 | + step %{I go to the sign in page} |
| 44 | + step %{I fill in "Username" with "#{username}"} |
| 45 | + step %{I fill in "Password" with "#{password}"} |
| 46 | + step %{I press "Sign in"} |
47 | 47 | end |
48 | 48 |
|
49 | 49 | Then /^I should be signed in$/ do |
50 | | - Then %{I should see "Signed in successfully."} |
| 50 | + step %{I should see "Signed in successfully."} |
51 | 51 | end |
52 | 52 |
|
53 | 53 | When /^I return next time$/ do |
54 | | - And %{I go to the home page} |
| 54 | + step %{I go to the home page} |
55 | 55 | end |
56 | 56 |
|
57 | 57 | Then /^I should be signed out$/ do |
58 | | - And %{I should see "Sign up"} |
59 | | - And %{I should see "Login"} |
60 | | - And %{I should not see "Logout"} |
| 58 | + step %{I should see "Sign up"} |
| 59 | + step %{I should see "Login"} |
| 60 | + step %{I should not see "Logout"} |
61 | 61 | end |
0 commit comments