Skip to content

Instantly share code, notes, and snippets.

@uglyog
Created May 16, 2014 01:12
Show Gist options
  • Save uglyog/a122c8403ae5f351448b to your computer and use it in GitHub Desktop.
Save uglyog/a122c8403ae5f351448b to your computer and use it in GitHub Desktop.
require 'pact_helper'
require_relative '../lib/client'
require_relative '../lib/event'
describe SourceSystemClient, :pact => true do
before do
subject.class.base_uri 'http://localhost:1234'
end
describe 'a request to store an event' do
let(:event) { Event.new }
let(:event_json) { event.to_hash }
before do
event_api.upon_receiving('A POST request with an event').
with(method: :post, path: '/events', headers: {'Content-Type' => 'application/json'}, body: event_json).
will_respond_with(status: 200, headers: {'Content-Type' => 'application/json'})
end
it 'is successful' do
expect(subject.save_event(event)).to be_true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment