|
16 | 16 |
|
17 | 17 | Given /^I am signed up as "(.*)\/(.*)"$/ do |username, password| |
18 | 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."} |
| 19 | + visit(signup_path) |
| 20 | + fill_in("Username", :with => username) |
| 21 | + fill_in("Email", :with => "#{username}@example.com") |
| 22 | + fill_in("Password", :with => password) |
| 23 | + fill_in("Password confirmation", :with => password) |
| 24 | + click_button("Sign up") |
| 25 | + BROWSER.html.should include('signed up succesfully') |
26 | 26 | step %{I am logout} |
27 | 27 | end |
28 | 28 |
|
|
40 | 40 |
|
41 | 41 | When /^I sign in as "(.*)\/(.*)"$/ do |username, password| |
42 | 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"} |
| 43 | + visit(login_path) |
| 44 | + fill_in("Username", :with => username) |
| 45 | + fill_in("Password", :with => password) |
| 46 | + click_button("Sign in") |
47 | 47 | end |
48 | 48 |
|
49 | 49 | Then /^I should be signed in$/ do |
50 | | - step %{I should see "Signed in successfully."} |
| 50 | + BROWSER.html.should include("Signed in") |
51 | 51 | end |
52 | 52 |
|
53 | 53 | When /^I return next time$/ do |
54 | | - step %{I go to the home page} |
| 54 | + visit(root) |
55 | 55 | end |
56 | 56 |
|
57 | 57 | Then /^I should be signed out$/ do |
58 | | - step %{I should see "Sign up"} |
59 | | - step %{I should see "Login"} |
60 | | - step %{I should not see "Logout"} |
| 58 | + BROWSER.html.should include("Sign up") |
| 59 | + BROWSER.html.should include("Login") |
| 60 | + BROWSER.html.should_not include("Logout") |
61 | 61 | end |
0 commit comments