Created
May 16, 2014 01:12
-
-
Save uglyog/a122c8403ae5f351448b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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