Skip to content

Commit f92752f

Browse files
author
Rhys Powell
committed
Updated step definitions to use new #step method in place of Given/When/Then/And
1 parent 260dbbd commit f92752f

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

features/step_definitions/user_steps.rb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,51 @@
1111
end
1212

1313
Then /^I should be already signed in$/ do
14-
And %{I should see "Logout"}
14+
step %{I should see "Logout"}
1515
end
1616

1717
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}
2727
end
2828

2929
Then /^I sign out$/ do
3030
visit(logout_path)
3131
end
3232

3333
Given /^I am logout$/ do
34-
Given %{I sign out}
34+
step %{I sign out}
3535
end
3636

3737
Given /^I am not logged in$/ do
38-
Given %{I sign out}
38+
step %{I sign out}
3939
end
4040

4141
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"}
4747
end
4848

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

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

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

0 commit comments

Comments
 (0)