Skip to content

Instantly share code, notes, and snippets.

@jherdman
Created December 6, 2013 16:23
Show Gist options
  • Save jherdman/7827578 to your computer and use it in GitHub Desktop.
Save jherdman/7827578 to your computer and use it in GitHub Desktop.
shared_example 'accessing as an unauthorized user' do |request_proc|
it 'rejects their request' do
instance_exec(&request_proc)
expect(response.status).to eq(401)
end
end
describe 'GET #index' do
include_example 'access as an unauthorized user', -> { get :index }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment