Skip to content

Commit f6a8b9a

Browse files
committed
Ruby: add cookies call to frameworks test
1 parent b49ca6a commit f6a8b9a

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

ruby/ql/test/library-tests/frameworks/ActionController.expected

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ actionControllerControllerClasses
22
| ActiveRecordInjection.rb:27:1:58:3 | FooController |
33
| ActiveRecordInjection.rb:60:1:90:3 | BarController |
44
| ActiveRecordInjection.rb:92:1:96:3 | BazController |
5-
| app/controllers/foo/bars_controller.rb:1:1:20:3 | BarsController |
5+
| app/controllers/foo/bars_controller.rb:3:1:25:3 | BarsController |
66
actionControllerActionMethods
77
| ActiveRecordInjection.rb:32:3:57:5 | some_request_handler |
88
| ActiveRecordInjection.rb:61:3:69:5 | some_other_request_handler |
99
| ActiveRecordInjection.rb:71:3:89:5 | safe_paths |
1010
| ActiveRecordInjection.rb:93:3:95:5 | yet_another_handler |
11-
| app/controllers/foo/bars_controller.rb:3:3:5:5 | index |
12-
| app/controllers/foo/bars_controller.rb:7:3:13:5 | show_debug |
13-
| app/controllers/foo/bars_controller.rb:15:3:19:5 | show |
11+
| app/controllers/foo/bars_controller.rb:5:3:7:5 | index |
12+
| app/controllers/foo/bars_controller.rb:9:3:18:5 | show_debug |
13+
| app/controllers/foo/bars_controller.rb:20:3:24:5 | show |
1414
paramsCalls
1515
| ActiveRecordInjection.rb:35:30:35:35 | call to params |
1616
| ActiveRecordInjection.rb:39:29:39:34 | call to params |
@@ -25,10 +25,10 @@ paramsCalls
2525
| ActiveRecordInjection.rb:83:12:83:17 | call to params |
2626
| ActiveRecordInjection.rb:88:15:88:20 | call to params |
2727
| ActiveRecordInjection.rb:94:21:94:26 | call to params |
28-
| app/controllers/foo/bars_controller.rb:8:21:8:26 | call to params |
29-
| app/controllers/foo/bars_controller.rb:9:10:9:15 | call to params |
30-
| app/controllers/foo/bars_controller.rb:16:21:16:26 | call to params |
31-
| app/controllers/foo/bars_controller.rb:17:10:17:15 | call to params |
28+
| app/controllers/foo/bars_controller.rb:13:21:13:26 | call to params |
29+
| app/controllers/foo/bars_controller.rb:14:10:14:15 | call to params |
30+
| app/controllers/foo/bars_controller.rb:21:21:21:26 | call to params |
31+
| app/controllers/foo/bars_controller.rb:22:10:22:15 | call to params |
3232
| app/views/foo/bars/show.html.erb:5:9:5:14 | call to params |
3333
paramsSources
3434
| ActiveRecordInjection.rb:35:30:35:35 | call to params |
@@ -44,17 +44,17 @@ paramsSources
4444
| ActiveRecordInjection.rb:83:12:83:17 | call to params |
4545
| ActiveRecordInjection.rb:88:15:88:20 | call to params |
4646
| ActiveRecordInjection.rb:94:21:94:26 | call to params |
47-
| app/controllers/foo/bars_controller.rb:8:21:8:26 | call to params |
48-
| app/controllers/foo/bars_controller.rb:9:10:9:15 | call to params |
49-
| app/controllers/foo/bars_controller.rb:16:21:16:26 | call to params |
50-
| app/controllers/foo/bars_controller.rb:17:10:17:15 | call to params |
47+
| app/controllers/foo/bars_controller.rb:13:21:13:26 | call to params |
48+
| app/controllers/foo/bars_controller.rb:14:10:14:15 | call to params |
49+
| app/controllers/foo/bars_controller.rb:21:21:21:26 | call to params |
50+
| app/controllers/foo/bars_controller.rb:22:10:22:15 | call to params |
5151
| app/views/foo/bars/show.html.erb:5:9:5:14 | call to params |
5252
redirectToCalls
53-
| app/controllers/foo/bars_controller.rb:12:5:12:30 | call to redirect_to |
53+
| app/controllers/foo/bars_controller.rb:17:5:17:30 | call to redirect_to |
5454
actionControllerHelperMethods
5555
getAssociatedControllerClasses
56-
| app/controllers/foo/bars_controller.rb:1:1:20:3 | BarsController | app/views/foo/bars/_widget.html.erb:0:0:0:0 | app/views/foo/bars/_widget.html.erb |
57-
| app/controllers/foo/bars_controller.rb:1:1:20:3 | BarsController | app/views/foo/bars/show.html.erb:0:0:0:0 | app/views/foo/bars/show.html.erb |
56+
| app/controllers/foo/bars_controller.rb:3:1:25:3 | BarsController | app/views/foo/bars/_widget.html.erb:0:0:0:0 | app/views/foo/bars/_widget.html.erb |
57+
| app/controllers/foo/bars_controller.rb:3:1:25:3 | BarsController | app/views/foo/bars/show.html.erb:0:0:0:0 | app/views/foo/bars/show.html.erb |
5858
controllerTemplateFiles
59-
| app/controllers/foo/bars_controller.rb:1:1:20:3 | BarsController | app/views/foo/bars/_widget.html.erb:0:0:0:0 | app/views/foo/bars/_widget.html.erb |
60-
| app/controllers/foo/bars_controller.rb:1:1:20:3 | BarsController | app/views/foo/bars/show.html.erb:0:0:0:0 | app/views/foo/bars/show.html.erb |
59+
| app/controllers/foo/bars_controller.rb:3:1:25:3 | BarsController | app/views/foo/bars/_widget.html.erb:0:0:0:0 | app/views/foo/bars/_widget.html.erb |
60+
| app/controllers/foo/bars_controller.rb:3:1:25:3 | BarsController | app/views/foo/bars/show.html.erb:0:0:0:0 | app/views/foo/bars/show.html.erb |

ruby/ql/test/library-tests/frameworks/ActionView.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ rawCalls
1212
| app/views/foo/bars/show.html.erb:5:5:5:21 | call to raw |
1313
| app/views/foo/bars/show.html.erb:7:5:7:19 | call to raw |
1414
renderCalls
15-
| app/controllers/foo/bars_controller.rb:4:5:4:37 | call to render |
16-
| app/controllers/foo/bars_controller.rb:18:5:18:76 | call to render |
15+
| app/controllers/foo/bars_controller.rb:6:5:6:37 | call to render |
16+
| app/controllers/foo/bars_controller.rb:23:5:23:76 | call to render |
1717
| app/views/foo/bars/show.html.erb:31:5:31:89 | call to render |
1818
renderToCalls
19-
| app/controllers/foo/bars_controller.rb:10:16:10:97 | call to render_to_string |
19+
| app/controllers/foo/bars_controller.rb:15:16:15:97 | call to render_to_string |
2020
linkToCalls
2121
| app/views/foo/bars/show.html.erb:33:5:33:41 | call to link_to |

ruby/ql/test/library-tests/frameworks/app/controllers/foo/bars_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
require 'json'
2+
13
class BarsController < ApplicationController
24

35
def index
46
render template: "foo/bars/index"
57
end
68

79
def show_debug
10+
user_info = JSON.load cookies[:user_info]
11+
puts "User: #{user_info['name']}"
12+
813
@user_website = params[:website]
914
dt = params[:text]
1015
rendered = render_to_string "foo/bars/show", locals: { display_text: dt, safe_text: "hello" }

0 commit comments

Comments
 (0)