1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix deprecation warning in rails_info_controller tests

Use keyword arguments in request methods
This commit is contained in:
Semyon Pupkov 2015-03-17 11:45:14 +05:00
parent f244a12cc6
commit 82a1680fb1

View file

@ -56,26 +56,26 @@ class InfoControllerTest < ActionController::TestCase
test "info controller returns exact matches" do test "info controller returns exact matches" do
exact_count = -> { JSON(response.body)['exact'].size } exact_count = -> { JSON(response.body)['exact'].size }
get :routes, path: 'rails/info/route' get :routes, params: { path: 'rails/info/route' }
assert exact_count.call == 0, 'should not match incomplete routes' assert exact_count.call == 0, 'should not match incomplete routes'
get :routes, path: 'rails/info/routes' get :routes, params: { path: 'rails/info/routes' }
assert exact_count.call == 1, 'should match complete routes' assert exact_count.call == 1, 'should match complete routes'
get :routes, path: 'rails/info/routes.html' get :routes, params: { path: 'rails/info/routes.html' }
assert exact_count.call == 1, 'should match complete routes with optional parts' assert exact_count.call == 1, 'should match complete routes with optional parts'
end end
test "info controller returns fuzzy matches" do test "info controller returns fuzzy matches" do
fuzzy_count = -> { JSON(response.body)['fuzzy'].size } fuzzy_count = -> { JSON(response.body)['fuzzy'].size }
get :routes, path: 'rails/info' get :routes, params: { path: 'rails/info' }
assert fuzzy_count.call == 2, 'should match incomplete routes' assert fuzzy_count.call == 2, 'should match incomplete routes'
get :routes, path: 'rails/info/routes' get :routes, params: { path: 'rails/info/routes' }
assert fuzzy_count.call == 1, 'should match complete routes' assert fuzzy_count.call == 1, 'should match complete routes'
get :routes, path: 'rails/info/routes.html' get :routes, params: { path: 'rails/info/routes.html' }
assert fuzzy_count.call == 0, 'should match optional parts of route literally' assert fuzzy_count.call == 0, 'should match optional parts of route literally'
end end
end end