Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vishnuatrai/d9747a9dc7dae4ca71644c9c58e04a85 to your computer and use it in GitHub Desktop.
Save vishnuatrai/d9747a9dc7dae4ca71644c9c58e04a85 to your computer and use it in GitHub Desktop.
execute Controller#action via rails runner with user authentication (devise)
rails runner "ApplicationController.allow_forgery_protection = false; s = ActionDispatch::Integration::Session.new(Rails.application); s.post('/login', user: {login: 'admin', password: 'password'}); s.get('/my'); puts s.response.body"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment