spec/lib/pact/consumer/interaction_spec.rb in pact-0.1.35 vs spec/lib/pact/consumer/interaction_spec.rb in pact-0.1.37
- old
+ new
@@ -44,11 +44,11 @@
describe "as_json_for_mock_service" do
let(:as_json_with_options ) { {:opts => 'blah'} }
let(:request) { double(Pact::Request::Expected, :as_json_with_options => {:opts => 'blah'})}
let(:response) { double('response') }
let(:generated_response ) { double('generated_response', :to_json => 'generated_response') }
- subject { Interaction.new(:description => 'description', :request => request, :response => response, :producer_state => 'ignored')}
+ subject { Interaction.new(:description => 'description', :request => request, :response => response, :producer_state => 'some state')}
let(:expected_hash) { {:response => generated_response, :request => as_json_with_options, :description => '' } }
before do
Reification.stub(:from_term).with(response).and_return(generated_response)
end
@@ -60,19 +60,19 @@
it "includes the options in the request" do
expect(subject.as_json_for_mock_service[:request]).to eq as_json_with_options
end
- it "does not send the producer state" do
- expect(subject.as_json_for_mock_service.key?(:producer_state)).to be_false
+ it "includes the producer state" do
+ expect(subject.as_json_for_mock_service[:producer_state]).to eq 'some state'
end
it "includes the description" do
expect(subject.as_json_for_mock_service[:description]).to eq 'description'
end
it "doesn't have any other keys" do
- expect(subject.as_json_for_mock_service.keys).to eq [:response, :request, :description]
+ expect(subject.as_json_for_mock_service.keys).to eq [:response, :request, :description, :producer_state]
end
end
describe "to JSON" do