The problem at hand involves a testing a redirect with Cucumber. After having read a post on this Google Group, I decided not to test the implementation of a redirect (i.e., response.should redirect_to(root_url). Rather, I wrote a test that a user would be able to understand that checked if I made it to the redirected page. When the test ran, I got a message saying I am being redirected. I thought that by the time Webrat simulates the clicking of the submit button of the form, the next Cucumber step (i.e. the Then) would response would contain the redirected page.
Any idea why I'm getting this error message?(::) failed steps (::)expected the following element's content to include "Sign in":You are being redirected. (RSpec::Expectations::ExpectationNotMetError)./features/step_definitions/signing_up/user_signs_up_steps.rb:10:in `/^I am taken to the sign in page$/'features/signing_up/user_signs_up.feature:10:in `Then I am taken to the sign in page'Failing Scenarios:cucumber features/signing_up/user_signs_up.feature:7 # Scenario: User signs up1 scenario (1 failed)3 steps (1 failed, 2 passed)0m4.147s>_ cat -n features/step_definitions/signing_up/user_signs_up_steps.rb1 When /^I fill in the sign up form$/ do2 fill_in "Username", :with => "user"3 fill_in "Email", :with => "us...@test.com"4 fill_in "Password", :with => "password"5 fill_in "Password Confirmation", :with => "password"6 click_button "Sign up!"7 end89 Then /^I am taken to the sign in page$/ do10 response.should contain("Sign in")11 end
--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cukes/-/vBi-zJiH_G0J.
To post to this group, send email to cu...@googlegroups.com.
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
The problem at hand involves a testing a redirect with Cucumber. After having read a post on this Google Group, I decided not to test the implementation of a redirect (i.e., response.should redirect_to(root_url). Rather, I wrote a test that a user would be able to understand that checked if I made it to the redirected page. When the test ran, I got a message saying I am being redirected. I thought that by the time Webrat simulates the clicking of the submit button of the form, the next Cucumber step (i.e. the Then) would response would contain the redirected page.Any idea why I'm getting this error message?(::) failed steps (::)expected the following element's content to include "Sign in":You are being redirected. (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/signing_up/user_signs_up_steps.rb:10:in `/^I am taken to the sign in page$/'features/signing_up/user_signs_up.feature:10:in `Then I am taken to the sign in page'Failing Scenarios:cucumber features/signing_up/user_signs_up.feature:7 # Scenario: User signs up1 scenario (1 failed)3 steps (1 failed, 2 passed)0m4.147s>_ cat -n features/step_definitions/signing_up/user_signs_up_steps.rb1 When /^I fill in the sign up form$/ do2 fill_in "Username", :with => "user"3 fill_in "Email", :with => "us...@test.com"4 fill_in "Password", :with => "password"5 fill_in "Password Confirmation", :with => "password"6 click_button "Sign up!"7 end89 Then /^I am taken to the sign in page$/ do10 response.should contain("Sign in")11 end
--
You received this message because you are subscribed to the Google Groups "Cukes" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cukes/-/vBi-zJiH_G0J.
To post to this group, send email to cu...@googlegroups.com.
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cukes?hl=en.