File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
lib/action_dispatch/routing Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change
1
+ * ` rake routes ` shows routes defined under assets prefix.
2
+
3
+ * Ryunosuke SATO*
4
+
1
5
* Extend cross-site request forgery (CSRF) protection to GET requests with
2
6
JavaScript responses, protecting apps from cross-origin ` <script> ` tags.
3
7
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def action
69
69
end
70
70
71
71
def internal?
72
- controller . to_s =~ %r{\A rails/(info|mailers|welcome)} || path =~ %r{\A #{ Rails . application . config . assets . prefix } }
72
+ controller . to_s =~ %r{\A rails/(info|mailers|welcome)} || path =~ %r{\A #{ Rails . application . config . assets . prefix } \z }
73
73
end
74
74
75
75
def engine?
Original file line number Diff line number Diff line change @@ -203,6 +203,18 @@ def test_rake_routes_dont_show_app_mounted_in_assets_prefix
203
203
assert_no_match ( /\/ sprockets/ , output . first )
204
204
end
205
205
206
+ def test_rake_routes_shows_route_defined_in_under_assets_prefix
207
+ output = draw do
208
+ scope '/sprockets' do
209
+ get '/foo' => 'foo#bar'
210
+ end
211
+ end
212
+ assert_equal [
213
+ "Prefix Verb URI Pattern Controller#Action" ,
214
+ " foo GET /sprockets/foo(.:format) foo#bar"
215
+ ] , output
216
+ end
217
+
206
218
def test_redirect
207
219
output = draw do
208
220
get "/foo" => redirect ( "/foo/bar" ) , :constraints => { :subdomain => "admin" }
You can’t perform that action at this time.
0 commit comments