Methods
T
U
Instance Public methods
test_action_missing_should_work()
# File actionpack/test/controller/base_test.rb, line 206
def test_action_missing_should_work
  use_controller ActionMissingController
  get :arbitrary_action
  assert_equal "Response for arbitrary_action", @response.body
end
test_get_on_hidden_should_fail()
# File actionpack/test/controller/base_test.rb, line 200
def test_get_on_hidden_should_fail
  use_controller NonEmptyController
  assert_raise(AbstractController::ActionNotFound) { get :hidden_action }
  assert_raise(AbstractController::ActionNotFound) { get :another_hidden_action }
end
test_get_on_priv_should_show_selector()
# File actionpack/test/controller/base_test.rb, line 172
def test_get_on_priv_should_show_selector
  use_controller MethodMissingController
  assert_deprecated(/Using `method_missing` to handle .* use `action_missing` instead/) do
    get :shouldnt_be_called
  end
  assert_response :success
  assert_equal 'shouldnt_be_called', @response.body
end
test_method_missing_is_not_an_action_name()
# File actionpack/test/controller/base_test.rb, line 181
def test_method_missing_is_not_an_action_name
  use_controller MethodMissingController
  assert !@controller.__send__(:action_method?, 'method_missing')

  assert_deprecated(/Using `method_missing` to handle .* use `action_missing` instead/) do
    get :method_missing
  end
  assert_response :success
  assert_equal 'method_missing', @response.body
end
test_method_missing_should_recieve_symbol()
# File actionpack/test/controller/base_test.rb, line 192
def test_method_missing_should_recieve_symbol
  use_controller AnotherMethodMissingController
  assert_deprecated(/Using `method_missing` to handle .* use `action_missing` instead/) do
    get :some_action
  end
  assert_kind_of NameError, @controller._exception
end
test_process_should_be_precise()
# File actionpack/test/controller/base_test.rb, line 164
def test_process_should_be_precise
  use_controller EmptyController
  exception = assert_raise AbstractController::ActionNotFound do
    get :non_existent
  end
  assert_equal exception.message, "The action 'non_existent' could not be found for EmptyController"
end
use_controller(controller_class)
# File actionpack/test/controller/base_test.rb, line 152
def use_controller(controller_class)
  @controller = controller_class.new

  # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
  # a more accurate simulation of what happens in "real life".
  @controller.logger = Logger.new(nil)

  @request     = ActionController::TestRequest.new
  @response    = ActionController::TestResponse.new
  @request.host = "www.nextangle.com"
end