|
1 | | -Given /^no user exists with an email of "(.*)"$/ do |email| |
2 | | - User.find(:first, :conditions => { :email => email }).should be_nil |
3 | | -end |
4 | | - |
5 | 1 | Given /^I am a user named "([^"]*)" with an email "([^"]*)" and password "([^"]*)"$/ do |name, email, password| |
6 | 2 | User.new(:name => name, |
7 | 3 | :email => email, |
|
13 | 9 | visit '/users/sign_out' |
14 | 10 | end |
15 | 11 |
|
16 | | -When /^I sign in as "(.*)\/(.*)"$/ do |email, password| |
17 | | - visit '/users/sign_out' |
18 | | - visit '/users/sign_in' |
19 | | - fill_in "Email", :with => email |
20 | | - fill_in "Password", :with => password |
21 | | - click_button "Sign in" |
22 | | -end |
23 | | - |
24 | 12 | When /^I go to the homepage$/ do |
25 | 13 | visit '/' |
26 | 14 | end |
|
45 | 33 | page.should have_content(text) |
46 | 34 | end |
47 | 35 |
|
48 | | -When /^I press "([^"]*)"$/ do |label| |
49 | | - click_button label |
50 | | -end |
51 | | - |
52 | | -When /^I fill in "([^"]*)" with "([^"]*)"$/ do |field, value| |
53 | | - fill_in(field, :with => value) |
54 | | -end |
55 | | - |
56 | | -When /^I follow "([^"]*)"$/ do |text| |
57 | | - click_link text |
58 | | -end |
59 | | - |
60 | 36 | def valid_user |
61 | 37 | @user ||= { :name => "Testy McUserton", :email => "testy@userton.com", |
62 | 38 | :password => "please", :password_confirmation => "please"} |
@@ -169,3 +145,11 @@ def sign_up user |
169 | 145 | Then /^I should see an account edited message$/ do |
170 | 146 | page.should have_content "You updated your account successfully." |
171 | 147 | end |
| 148 | + |
| 149 | +When /^I look at the list of users$/ do |
| 150 | + visit '/' |
| 151 | +end |
| 152 | + |
| 153 | +Then /^I should see my name$/ do |
| 154 | + page.should have_content valid_user[:name] |
| 155 | +end |
0 commit comments