Skip to content

Commit 275dfdd

Browse files
committed
Update tests for rails deprecations
1 parent 1e591dc commit 275dfdd

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

test/controllers/documents_benchmark_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DocumentsControllerTest < ActionController::TestCase
88
end
99

1010
test "create" do
11-
post :create, document: { title: "New things", content: "Doing them" }
11+
post :create, params: { document: { title: "New things", content: "Doing them" } }
1212

1313
document = Document.last
1414
assert_equal 'New things', document.title
@@ -23,7 +23,7 @@ class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
2323
end
2424

2525
test "create" do
26-
post '/documents', document: { title: "New things", content: "Doing them" }
26+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
2727

2828
document = Document.last
2929
assert_equal 'New things', document.title

test/controllers/documents_controller_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DocumentsControllerTest < ActionController::TestCase
5353

5454
# standard test
5555
test "create" do
56-
post :create, document: { title: "New things", content: "Doing them" }
56+
post :create, params: { document: { title: "New things", content: "Doing them" } }
5757

5858
document = Document.last
5959
assert_equal 'New things', document.title
@@ -63,7 +63,7 @@ class DocumentsControllerTest < ActionController::TestCase
6363
# ruby -I lib:test test/controllers/documents_controller_test.rb -n test_create_rp
6464
test "create rp" do
6565
result = RubyProf.profile do
66-
post :create, document: { title: "New things", content: "Doing them" }
66+
post :create, params: { document: { title: "New things", content: "Doing them" } }
6767

6868
document = Document.last
6969
assert_equal 'New things', document.title
@@ -82,7 +82,7 @@ class DocumentsControllerTest < ActionController::TestCase
8282
test "create sp cpu" do
8383
StackProf.run(mode: :cpu, out: 'graphs/rails_only/create_controller_stackprof_cpu.dump') do
8484
3000.times do
85-
post :create, document: { title: "New things", content: "Doing them" }
85+
post :create, params: { document: { title: "New things", content: "Doing them" } }
8686

8787
document = Document.last
8888
assert_equal 'New things', document.title
@@ -95,7 +95,7 @@ class DocumentsControllerTest < ActionController::TestCase
9595
test "create sp wall" do
9696
StackProf.run(mode: :wall, out: 'graphs/rails_only/create_controller_stackprof_wall.dump') do
9797
3000.times do
98-
post :create, document: { title: "New things", content: "Doing them" }
98+
post :create, params: { document: { title: "New things", content: "Doing them" } }
9999

100100
document = Document.last
101101
assert_equal 'New things', document.title
@@ -106,7 +106,7 @@ class DocumentsControllerTest < ActionController::TestCase
106106
# ruby -I lib:test test/controllers/documents_controller_test.rb -n test_create_flame
107107
test "create flame" do
108108
Flamegraph.generate("graphs/rails_only/create_controller_flamegraph.html") do
109-
post :create, document: { title: "New things", content: "Doing them" }
109+
post :create, params: { document: { title: "New things", content: "Doing them" } }
110110

111111
document = Document.last
112112
assert_equal 'New things', document.title

test/integration/documents_integration_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
5252

5353
# standard test
5454
test "create" do
55-
post '/documents', document: { title: "New things", content: "Doing them" }
55+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
5656

5757
document = Document.last
5858
assert_equal 'New things', document.title
@@ -62,7 +62,7 @@ class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
6262
# ruby -I lib:test test/integration/documents_integration_test.rb -n test_create_rp
6363
test "create rp" do
6464
result = RubyProf.profile do
65-
post '/documents', document: { title: "New things", content: "Doing them" }
65+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
6666

6767
document = Document.last
6868
assert_equal 'New things', document.title
@@ -81,7 +81,7 @@ class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
8181
test "create sp" do
8282
StackProf.run(mode: :cpu, out: 'graphs/rails_only/create_integration_stackprof_cpu.dump') do
8383
3000.times do
84-
post '/documents', document: { title: "New things", content: "Doing them" }
84+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
8585

8686
document = Document.last
8787
assert_equal 'New things', document.title
@@ -94,7 +94,7 @@ class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
9494
test "create sp wall" do
9595
StackProf.run(mode: :wall, out: 'graphs/rails_only/create_integration_stackprof_wall.dump') do
9696
3000.times do
97-
post '/documents', document: { title: "New things", content: "Doing them" }
97+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
9898

9999
document = Document.last
100100
assert_equal 'New things', document.title
@@ -106,7 +106,7 @@ class DocumentsIntegrationTest < ActionDispatch::IntegrationTest
106106
# ruby -I lib:test test/integration/documents_integration_test.rb -n test_create_flame
107107
test "create flame" do
108108
Flamegraph.generate("graphs/rails_only/create_integration_flamegraph.html") do
109-
post '/documents', document: { title: "New things", content: "Doing them" }
109+
post '/documents', params: { document: { title: "New things", content: "Doing them" } }
110110

111111
document = Document.last
112112
assert_equal 'New things', document.title

0 commit comments

Comments
 (0)