Skip to content

Commit

Permalink
use correct API for default
Browse files Browse the repository at this point in the history
  • Loading branch information
oreoshake committed Apr 2, 2016
1 parent cff9a9e commit 6d2f92f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions spec/lib/secure_headers/view_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ module SecureHeaders
begin
allow(SecureRandom).to receive(:base64).and_return("abc123")

Configuration.default("my_custom_config") do |config|
Configuration.default do |config|
config.csp[:script_src] = %w('self')
config.csp[:style_src] = %w('self')
end
request = Rack::Request.new("HTTP_USER_AGENT" => USER_AGENTS[:chrome])
SecureHeaders.use_secure_headers_override(request, "my_custom_config")

expected_hash = "sha256-3/URElR9+3lvLIouavYD/vhoICSNKilh15CzI/nKqg8="
Configuration.instance_variable_set(:@script_hashes, "app/views/asdfs/index.html.erb" => ["'#{expected_hash}'"])
Expand Down

0 comments on commit 6d2f92f

Please sign in to comment.