File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
lib/rails/commands/console Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class NewSession < RailsHelperBase
31
31
32
32
def execute ( *)
33
33
app = Rails . application
34
+ app . reload_routes_unless_loaded
34
35
session = ActionDispatch ::Integration ::Session . new ( app )
35
36
36
37
# This makes app.url_for and app.foo_path available in the console
Original file line number Diff line number Diff line change @@ -186,6 +186,18 @@ def test_app_helper_method
186
186
write_prompt "app.foo_path" , "/foo"
187
187
end
188
188
189
+ def test_app_routes_are_loaded
190
+ app_file "config/routes.rb" , <<-RUBY
191
+ Rails.application.routes.draw do
192
+ get 'foo', to: 'foo#index'
193
+ end
194
+ RUBY
195
+
196
+ spawn_console ( "-e development" )
197
+
198
+ write_prompt "app.methods.grep(/foo_path/)" , "[:foo_path]"
199
+ end
200
+
189
201
def test_reload_command_fires_preparation_and_cleanup_callbacks
190
202
options = "-e development"
191
203
spawn_console ( options )
You can’t perform that action at this time.
0 commit comments