I have a device to test a controller as below
Description of product controller 'spec_helper' is required Setup: activate_authlogic "User is not logged in" Describe "Index should not be received" Get it: index response. At the end of redirection_to (login_path), describe the "logged in user" (in each) UserSession.create: Username = & gt; "Rohit" ,: Password => "Test123" Finally it should get the "index": Index response. Redirect (products_path) and end and end
I have also used this line in spec_helper.rb
'the product controller user should get the index to log in' '' '/ Products'' likely to be unavailable,
This sounds normal, because you have a log Bring '/ products' URL with the manual. Then he sees this page. He does not redirect seeing that page.
Every exam is independent There is no state left in the last test.
Comments
Post a Comment