Skip to content

Commit 9f5c73c

Browse files
committed
Ruby: add a test case for instantiating ActionDispatch::Request directly
1 parent 1c9e4c0 commit 9f5c73c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ruby/ql/test/library-tests/frameworks/action_dispatch/ActionDispatch.expected

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ actionDispatchRoutes
3636
actionDispatchControllerMethods
3737
| app/config/routes.rb:2:3:8:5 | call to resources | app/controllers/posts_controller.rb:2:3:3:5 | index |
3838
| app/config/routes.rb:2:3:8:5 | call to resources | app/controllers/posts_controller.rb:5:3:6:5 | show |
39-
| app/config/routes.rb:3:5:6:7 | call to resources | app/controllers/comments_controller.rb:2:3:36:5 | index |
40-
| app/config/routes.rb:3:5:6:7 | call to resources | app/controllers/comments_controller.rb:38:3:39:5 | show |
39+
| app/config/routes.rb:3:5:6:7 | call to resources | app/controllers/comments_controller.rb:2:3:39:5 | index |
40+
| app/config/routes.rb:3:5:6:7 | call to resources | app/controllers/comments_controller.rb:41:3:42:5 | show |
4141
| app/config/routes.rb:7:5:7:37 | call to post | app/controllers/posts_controller.rb:8:3:9:5 | upvote |
4242
| app/config/routes.rb:27:3:27:48 | call to match | app/controllers/photos_controller.rb:2:3:3:5 | show |
4343
| app/config/routes.rb:28:3:28:50 | call to match | app/controllers/photos_controller.rb:2:3:3:5 | show |
@@ -74,6 +74,7 @@ requestInputAccesses
7474
| app/controllers/comments_controller.rb:7:5:7:28 | call to query_parameters |
7575
| app/controllers/comments_controller.rb:8:5:8:30 | call to request_parameters |
7676
| app/controllers/comments_controller.rb:9:5:9:31 | call to filtered_parameters |
77+
| app/controllers/comments_controller.rb:38:5:38:14 | call to params |
7778
| app/controllers/foo/bars_controller.rb:10:27:10:33 | call to cookies |
7879
| app/controllers/foo/bars_controller.rb:13:21:13:26 | call to params |
7980
| app/controllers/foo/bars_controller.rb:14:10:14:15 | call to params |

ruby/ql/test/library-tests/frameworks/action_dispatch/app/controllers/comments_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ def index
3333
response.last_modified = Date.yesterday
3434
response.weak_etag = "value"
3535
response.strong_etag = "value"
36+
37+
req = ActionDispatch::Request.new(request.env)
38+
req.params
3639
end
3740

3841
def show

0 commit comments

Comments
 (0)