Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. require 'rails_helper'
  2.  
  3. RSpec.describe MyController do
  4. describe 'GET #any_action' do
  5. controller do
  6. def any_action
  7. head :ok
  8. end
  9. end
  10.  
  11. before do
  12. routes.draw { get 'testing' => 'my_controller#any_action' }
  13. end
  14.  
  15. it 'is protected by a before filter' do
  16. get :any_action
  17.  
  18. # expect side effect of before filter
  19. end
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement