Skip to content

Instantly share code, notes, and snippets.

@charger
Created October 2, 2018 12:17
Show Gist options
  • Save charger/a8cb5afe542522afbd7f537bd8b12f67 to your computer and use it in GitHub Desktop.
Save charger/a8cb5afe542522afbd7f537bd8b12f67 to your computer and use it in GitHub Desktop.
#spec/support/shared_contexts/the_service_black_box.rb
shared_context 'the_service_black_box' do
let(:params) do
{
type: 'save',
data: 1
}
end
let(:headers) { { 'HTTPS' => 'on', 'Content-Type' => 'application/json; charset=utf-8' } }
subject(:response) { TheServiceControl.post(params, headers)}
before(:all) { TheServiceControl.start }
around(:each) do |example|
VCR.configure { |c| c.allow_http_connections_when_no_cassette = true }
example.run
VCR.configure { |c| c.allow_http_connections_when_no_cassette = false }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment