Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rails_helper'
- RSpec.describe MyController do
- describe 'GET #any_action' do
- controller do
- def any_action
- head :ok
- end
- end
- before do
- routes.draw { get 'testing' => 'my_controller#any_action' }
- end
- it 'is protected by a before filter' do
- get :any_action
- # expect side effect of before filter
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement