Skip to content

Commit

Permalink
some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
homakov committed Aug 9, 2012
1 parent 2a290f7 commit 98c18d0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions actionpack/test/dispatch/response_test.rb
Expand Up @@ -176,6 +176,33 @@ def test_response_body_encoding
ActionDispatch::Response.default_charset = original
end
end

test "read x_frame_options and x_xss_protection" do
ActionDispatch::Response.default_headers = {
'X-Frame-Options' => 'DENY',
'X-XSS-Protection' => '1;'
}
resp = ActionDispatch::Response.new.tap { |response|
response.body = 'Hello'
}
resp.to_a

assert_equal('DENY', resp.headers['X-Frame-Options'])
assert_equal('1;', resp.headers['X-XSS-Protection'])
end

test "read custom default_header" do
ActionDispatch::Response.default_headers = {
'X-XX-XXXX' => 'Here is my phone number'
}
resp = ActionDispatch::Response.new.tap { |response|
response.body = 'Hello'
}
resp.to_a

assert_equal('Here is my phone number', resp.headers['X-XX-XXXX'])
end

end

class ResponseIntegrationTest < ActionDispatch::IntegrationTest
Expand Down

1 comment on commit 98c18d0

@drogus
Copy link
Member

@drogus drogus commented on 98c18d0 Aug 9, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have better commit messages next time? As showed here: http://guides.rubyonrails.org/contributing_to_ruby_on_rails.html#commit-your-changes

Please sign in to comment.