Methods
S
T
Instance Public methods
setup()
# File actionpack/test/controller/base_test.rb, line 153
def setup
  super
  @request.host = 'www.example.com'
end
test_url_for_query_params_included()
# File actionpack/test/controller/base_test.rb, line 158
def test_url_for_query_params_included
  rs = ActionDispatch::Routing::RouteSet.new
  rs.draw do
    get 'home' => 'pages#home'
  end

  options = {
    :action     => "home",
    :controller => "pages",
    :only_path  => true,
    :params     => { "token" => "secret" }
  }

  assert_equal '/home?token=secret', rs.url_for(options)
end
test_url_helpers_does_not_become_actions()
# File actionpack/test/controller/base_test.rb, line 192
def test_url_helpers_does_not_become_actions
  with_routing do |set|
    set.draw do
      get "account/overview"
    end

    assert !@controller.class.action_methods.include?("account_overview_path")
  end
end
test_url_options_override()
# File actionpack/test/controller/base_test.rb, line 174
def test_url_options_override
  with_routing do |set|
    set.draw do
      get 'from_view', :to => 'url_options#from_view', :as => :from_view

      ActiveSupport::Deprecation.silence do
        get ':controller/:action'
      end
    end

    get :from_view, params: { route: "from_view_url" }

    assert_equal 'http://www.override.com/from_view', @response.body
    assert_equal 'http://www.override.com/from_view', @controller.send(:from_view_url)
    assert_equal 'http://www.override.com/default_url_options/index', @controller.url_for(:controller => 'default_url_options')
  end
end