Here’s one way I was able to do it:
>> ApplicationController.allow_forgery_protection = false
>> app.post('/sign_in', {"user"=>{"login"=>"login", "password"=>"password"}})
Then you can do:
>> app.get '/some_other_path_that_only_works_if_logged_in'
>> pp app.response.body
More Related Contents:
- Share session (cookies) between subdomains in Rails?
- How can I call controller/view helper methods from the console in Ruby on Rails?
- No route matches “/users/sign_out” devise rails 3
- rails – Devise – Handling – devise_error_messages
- Devise redirect after login fail
- devise and multiple “user” models
- Devise form within a different controller
- Devise Secret Key was not set
- Multiple user models with Ruby On Rails and devise to have separate registration routes but one common login route
- Custom authentication strategy for devise
- Profile model for Devise users?
- Heroku/devise – Missing host to link to! Please provide :host parameter or set default_url_options[:host]
- Devise limit one session per user at a time
- Rails, Devise authentication, CSRF issue
- Devise update user without password
- Rails: How to list database tables/objects using the Rails console?
- Adding extra registration fields with Devise
- where is devise implementation of “authenticate_user!” method?
- Setting session length with Devise
- Rails 3 – Speed up Console Loading Time
- Rails Devise: after_confirmation
- How can I redirect a user’s home (root) path based on their role using Devise?
- rails 3 + devise: how to modify the mailer method for confirmation emails to add user’s second email address
- Rails devise: user_signed_in? not working
- Always getting 401 Unauthorized with new install of Rails + Devise
- Customizing Devise error messages in Rails 3?
- Rails 4.0 with Devise. Nested attributes Unpermited parameters
- ActionController::InvalidAuthenticityToken in RegistrationsController#create
- Ruby/Rails: How do you customize the mailer templates of Devise?
- How to skip a before_filter for Devise’s SessionsController?