Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[test]: Add spec for custom P3P header via option (key: :p3p).

  • Loading branch information...
commit 2bc30241c8bc90af5ca680e219c80a5633f4fb89 1 parent f021e1f
@grimen grimen authored
Showing with 12 additions and 2 deletions.
  1. +12 −2 spec/rack-iframe_spec.rb
View
14 spec/rack-iframe_spec.rb
@@ -21,8 +21,7 @@
describe "Middleware" do
before do
- # @app = app({})
- @app = CachedApp.new # rack_cache(@app)
+ @app = CachedApp.new
end
describe "without Rack::Iframe" do
@@ -98,6 +97,17 @@
end
end
end
+
+ describe "custom middleware-arguments" do
+ it 'should use custom P3P header if specified via options as :p3p' do
+ request = mock_request(:ie)
+
+ response = Rack::Iframe.new(@app, :p3p => %(CP="NOI DSP LAW NID")).call(request)
+ status, headers, body = response
+
+ headers['P3P'].must_equal %(CP="NOI DSP LAW NID")
+ end
+ end
end
describe "browsers that don't require the P3P header: Chrome, Firefox, Opera" do
Please sign in to comment.
Something went wrong with that request. Please try again.