Skip to content

Commit

Permalink
Fix deprecation warning in rails_info_controller tests
Browse files Browse the repository at this point in the history
Use keyword arguments in request methods
  • Loading branch information
artofhuman committed Mar 17, 2015
1 parent f244a12 commit 82a1680
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions railties/test/rails_info_controller_test.rb
Expand Up @@ -56,26 +56,26 @@ def setup
test "info controller returns exact matches" do
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'

get :routes, path: 'rails/info/routes'
get :routes, params: { path: 'rails/info/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'
end

test "info controller returns fuzzy matches" do
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'

get :routes, path: 'rails/info/routes'
get :routes, params: { path: 'rails/info/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'
end
end

0 comments on commit 82a1680

Please sign in to comment.