ruby on rails 4 - Login user without Capybara in request spec -


I am developing a Rail application and I am following Michael Hart's famous tutorial. I am using new versions of RSPC and CapBear and so I am running into a problem. Since Captain 2, you need to have RSPEC capachers working in the request space, giving the hartl, its solution is no longer working (it is giving all its tests in spec / requests).

I need to enter the CapBar without any users in an examination exam (because the test "", which is only available in the request glasses). Other people have solved this with the same problem:

  posted login_path (session: {password: user.password, email: user.email}) cookies [: remember_token] = user.remember_token  

But I get an error:

  Failure / Error: {valid_login_request (user)} before any method method: Undefined method `[] 'zero To: NilClass # ./app/controllers/sessions_controller.rb:7:in 'create' # ./spec/support/utilities.rb:13:in` valid_login_request '# ./spec/requests/authentication_pages_spec.rb:22 : In 'block (level 4) & lt; Top (required) & gt;  

and the following code in sessions_controller.rb: 7:

  user = user.find_b_mail (parameter [: session] [: email])  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -