Skip to content

Commit

Permalink
Added failing spec to show a problem with recording request headers b…
Browse files Browse the repository at this point in the history
…efore the real request is made.
  • Loading branch information
bblimke committed Aug 16, 2010
1 parent 3def0be commit 8cce783
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/extensions/net_http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ def perform_get_with_returning_block
end
end

it "gets request headers to record, before the real request is made to not record headers 'host' and 'content-type' added during request by Net::HTTP" do
VCR::HTTPInteraction.should_receive(:from_net_http_objects) do |_, request, _|
request.to_hash.should_not have_key('content-type')
request.to_hash.should_not have_key('host')
end
Net::HTTP.new('example.com', 80).post('/', "")
end

it 'calls VCR.record_http_interaction' do
interaction = VCR::HTTPInteraction.new
VCR::HTTPInteraction.should_receive(:from_net_http_objects).and_return(interaction)
Expand Down

0 comments on commit 8cce783

Please sign in to comment.