Skip to content

Commit 129720e

Browse files
authored
hook include of helper to loading of ActionView
When using rspec with rails-controller-testing, specs would break due to incorrect load order. More info here: rails/rails-controller-testing#24
1 parent 9bf22e7 commit 129720e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/secure_headers/view_helper.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ def nonced_tag(type, content_or_options, block)
108108
end
109109
end
110110

111-
module ActionView #:nodoc:
112-
class Base #:nodoc:
113-
include SecureHeaders::ViewHelpers
114-
end
111+
ActiveSupport.on_load :action_view do
112+
include SecureHeaders::ViewHelpers
115113
end

0 commit comments

Comments
 (0)