Skip to content

Instantly share code, notes, and snippets.

@andriy-baran
Last active May 9, 2018 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andriy-baran/19149471ebadd3a16d56c54f6e196c56 to your computer and use it in GitHub Desktop.
Save andriy-baran/19149471ebadd3a16d56c54f6e196c56 to your computer and use it in GitHub Desktop.
include_context 'api session'
let(:path) { "/api/v1/#{order_id}/contact_info" }
let(:order_id) { 456 }
it_behaves_like 'protected endpoint', :get
context 'when order found' do
let(:order) { FactoryBot.create(:order, creator: user) }
let(:order_id) { order.id }
it 'renders correct response' do
get path, valid_params, valid_headers
# expectations
end
end
context 'when order not found' do
it 'renders correct response' do
get path, valid_params, valid_headers
# expectations
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment