Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #4 from ershad/master

case insensitive matching of headers and values
  • Loading branch information...
commit 27ceaca4d1545d32d03d2a77b98dbc9f965b2734 2 parents f0d0b62 + 52e424f
@kaiwren kaiwren authored
View
2  lib/rspec/http/header_matchers.rb
@@ -70,7 +70,7 @@ def initialize(header, expected_value)
end
def validate
- expected_value == response[header]
+ expected_value.downcase == response[header].downcase
end
def description
View
4 spec/rspec/http/header_matchers_spec.rb
@@ -39,6 +39,10 @@ module RSpec::Http
response.should have_header("Content-Type" => "text/plain")
end
+ it "passes if matching is incasesensitve" do
+ response.should have_header("Content-Type" => "Text/Plain")
+ end
+
context "incorrect value" do
it "fails if the value is incorrect" do
response.should_not have_header("Content-Type" => "text/csv")
Please sign in to comment.
Something went wrong with that request. Please try again.