Skip to content

Commit 2db97cf

Browse files
author
Rhys Powell
committed
Removed web_steps.rb references from step definitions
1 parent f92752f commit 2db97cf

4 files changed

Lines changed: 18 additions & 227 deletions

File tree

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ group :production do
4949
end
5050

5151
group :test do
52+
gem "capybara"
5253
gem "mocha"
5354
gem "database_cleaner"
5455
end

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ PLATFORMS
234234
DEPENDENCIES
235235
bson_ext
236236
cancan
237+
capybara
237238
coffee-rails (~> 3.1.0)
238239
cucumber-rails
239240
database_cleaner

features/step_definitions/user_steps.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
Given /^I am signed up as "(.*)\/(.*)"$/ do |username, password|
1818
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')
2626
step %{I am logout}
2727
end
2828

@@ -40,22 +40,22 @@
4040

4141
When /^I sign in as "(.*)\/(.*)"$/ do |username, password|
4242
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")
4747
end
4848

4949
Then /^I should be signed in$/ do
50-
step %{I should see "Signed in successfully."}
50+
BROWSER.html.should include("Signed in")
5151
end
5252

5353
When /^I return next time$/ do
54-
step %{I go to the home page}
54+
visit(root)
5555
end
5656

5757
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")
6161
end

features/step_definitions/web_steps.rb

Lines changed: 0 additions & 211 deletions
This file was deleted.

0 commit comments

Comments
 (0)