File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
lib/shoulda/matchers/integrations/libraries Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,17 @@ class ActionController
1212 def integrate_with ( test_framework )
1313 test_framework . include ( matchers_module , type : :controller )
1414
15- include_into ( ::ActionController ::TestCase , matchers_module ) do
16- def subject # rubocop:disable Lint/NestedMethodDefinition
17- @controller
15+ tap do |instance |
16+ ActiveSupport . on_load ( :action_controller_test_case , run_once : true ) do
17+ instance . include_into ( ::ActionController ::TestCase , instance . matchers_module ) do
18+ def subject # rubocop:disable Lint/NestedMethodDefinition
19+ @controller
20+ end
21+ end
1822 end
1923 end
2024 end
2125
22- private
23-
2426 def matchers_module
2527 Shoulda ::Matchers ::ActionController
2628 end
Original file line number Diff line number Diff line change @@ -12,11 +12,13 @@ class Routing
1212 def integrate_with ( test_framework )
1313 test_framework . include ( matchers_module , type : :routing )
1414
15- include_into ( ::ActionController ::TestCase , matchers_module )
15+ tap do |instance |
16+ ActiveSupport . on_load ( :action_controller_test_case , run_once : true ) do
17+ instance . include_into ( ::ActionController ::TestCase , instance . matchers_module )
18+ end
19+ end
1620 end
1721
18- private
19-
2022 def matchers_module
2123 Shoulda ::Matchers ::Routing
2224 end
You can’t perform that action at this time.
0 commit comments