Permalink
Browse files

helper methods are public, so we can just call them

also if you want a path from a named helper, you should call
helper_path, not helper_url(:only_path => true).
  • Loading branch information...
1 parent 246f07c commit a9765c54ea17153a69932730e1f5291c1f0055b0 @tenderlove tenderlove committed Jul 17, 2014
Showing with 4 additions and 4 deletions.
  1. +4 −4 actionpack/test/controller/url_for_test.rb
@@ -287,12 +287,12 @@ def test_only_path
# We need to create a new class in order to install the new named route.
kls = Class.new { include set.url_helpers }
controller = kls.new
- assert controller.respond_to?(:home_url)
+ assert_respond_to controller, :home_url
assert_equal '/brave/new/world',
- controller.send(:url_for, :controller => 'brave', :action => 'new', :id => 'world', :only_path => true)
+ controller.url_for(:controller => 'brave', :action => 'new', :id => 'world', :only_path => true)
- assert_equal("/home/sweet/home/alabama", controller.send(:home_url, :user => 'alabama', :host => 'unused', :only_path => true))
- assert_equal("/home/sweet/home/alabama", controller.send(:home_path, 'alabama'))
+ assert_equal("/home/sweet/home/alabama", controller.home_path(:user => 'alabama', :host => 'unused', :only_path => true))
+ assert_equal("/home/sweet/home/alabama", controller.home_path('alabama'))
end
end

0 comments on commit a9765c5

Please sign in to comment.