SHARE
TWEET

Untitled

a guest Jul 16th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top