issues with checking headers #193

Closed
sunilkr opened this Issue Jul 11, 2012 · 1 comment

Comments

Projects
None yet
1 participant

sunilkr commented Jul 11, 2012

http= Net::HTTP.start('www.example.com','80')

stub_request(:get, "http://www.example.com/get2").
with(:header=>{'X-Header'=>'Invalid'}).
to_return(:body=>'SUCCESS')

req = Net::HTTP::Get.new("/get2")
req['X-Header'] = 'TestHeader'
resp = http.request(req)
raise 'Invalid body content' unless resp.read_body == 'SUCCESS'

did not raise any exceptions while the actual headers were

accept:/
user-agent:Ruby
x-header:TestHeader

sunilkr commented Jul 12, 2012

i missed an 's' here. my bad.

@sunilkr sunilkr closed this Jul 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment