File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,20 @@ class ActiveModelSerializers::RailsApplication < Rails::Application
16
16
end
17
17
ActiveModelSerializers ::RailsApplication . initialize!
18
18
19
+ Rails . application . routes . draw do
20
+ get ':controller(/:action(/:id))'
21
+ get ':controller(/:action)'
22
+ end
19
23
module TestHelper
20
- Routes = ActionDispatch ::Routing ::RouteSet . new
21
- Routes . draw do
22
- get ':controller(/:action(/:id))'
23
- get ':controller(/:action)'
24
+ Routes = Rails . application . routes
25
+ module ControllerTests
26
+ def setup
27
+ super
28
+ @routes = TestHelper ::Routes
29
+ end
24
30
end
25
-
26
- ActionController ::Base . send :include , Routes . url_helpers
31
+ end
32
+ ActiveSupport . on_load ( :action_controller ) do
33
+ include TestHelper ::Routes . url_helpers
34
+ ActionController ::TestCase . send :include , TestHelper ::ControllerTests
27
35
end
Original file line number Diff line number Diff line change 1
1
ActionController ::TestCase . class_eval do
2
- def setup
3
- @routes = TestHelper ::Routes
4
- end
5
-
6
2
# For Rails5
7
3
# https://github.com/rails/rails/commit/ca83436d1b3b6cedd1eca2259f65661e69b01909#diff-b9bbf56e85d3fe1999f16317f2751e76L17
8
4
def assigns ( key = nil )
You can’t perform that action at this time.
0 commit comments