Permalink
Browse files

Added failing spec to show a problem with recording request headers b…

…efore the real request is made.
  • Loading branch information...
1 parent 3def0be commit 8cce783f01bd2c4d898c735212c976e0e27d7bcd @bblimke committed Aug 16, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/extensions/net_http_spec.rb
@@ -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)

0 comments on commit 8cce783

Please sign in to comment.