Permalink
Browse files

Added incasesensitive matching of headers and values

  • Loading branch information...
1 parent f0d0b62 commit 52e424f623ec5315b9525170a45dae99d5834e24 @ershad ershad committed Jun 9, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/rspec/http/header_matchers.rb
  2. +4 −0 spec/rspec/http/header_matchers_spec.rb
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")

0 comments on commit 52e424f

Please sign in to comment.