class AnonymousControllerTest

Public Instance Methods

index() click to toggle source
# File actionpack/test/controller/test_case_test.rb, line 1071
def index
  render plain: params[:controller]
end
setup() click to toggle source
# File actionpack/test/controller/test_case_test.rb, line 1069
def setup
  @controller = Class.new(ActionController::Base) do
    def index
      render plain: params[:controller]
    end
  end.new

  @routes = ActionDispatch::Routing::RouteSet.new.tap do |r|
    r.draw do
      ActiveSupport::Deprecation.silence do
        get ":controller(/:action(/:id))"
      end
    end
  end
end
test_controller_name() click to toggle source
# File actionpack/test/controller/test_case_test.rb, line 1085
def test_controller_name
  get :index
  assert_equal "anonymous", @response.body
end