123456789_123456789_123456789_123456789_123456789_

Class: ActionView::TestCase::TestController

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
self, ::ActionDispatch::TestProcess, ::ActionController::Base, ::ActionController::ParamsWrapper, ::ActionController::Instrumentation, ::ActionController::Rescue, ::ActionController::HttpAuthentication::Token::ControllerMethods, ::ActionController::HttpAuthentication::Digest::ControllerMethods, ::ActionController::HttpAuthentication::Basic::ControllerMethods, ::ActionController::DataStreaming, ::ActionController::Streaming, ::ActionController::ForceSSL, ::ActionController::RequestForgeryProtection, ::ActionController::Flash, ::ActionController::Cookies, ::ActionController::StrongParameters, ::ActiveSupport::Rescuable, ::ActionController::ImplicitRender, ::ActionController::MimeResponds, ::ActionController::Caching, ::ActionController::Caching::Fragments, ::ActionController::Caching::ConfigMethods, ::AbstractController::Callbacks, ::ActiveSupport::Callbacks, ::ActionController::EtagWithTemplateDigest, ::ActionController::ConditionalGet, ::ActionController::Head, ::ActionController::Renderers::All, ::ActionController::Renderers, ::ActionController::Rendering, ::ActionView::Layouts, ::ActionView::Rendering, ::ActionController::Redirecting, ::ActionController::RackDelegation, ::ActiveSupport::Benchmarkable, ::ActionController::UrlFor, ::AbstractController::UrlFor, ::ActionDispatch::Routing::UrlFor, ::ActionDispatch::Routing::PolymorphicRoutes, ::ActionController::ModelNaming, ::ActionController::HideActions, ::ActionController::Helpers, ::AbstractController::Helpers, ::AbstractController::Translation, ::AbstractController::Rendering, ::ActionView::ViewPaths, ::ActionController::Metal, ::AbstractController::Base, ::ActiveSupport::Configurable
Inherits: ActionController::Base
Defined in: actionview/lib/action_view/test_case.rb

Constant Summary

::AbstractController::Rendering - Included

DEFAULT_PROTECTED_INSTANCE_VARIABLES

::ActionController::Rendering - Included

RENDER_FORMATS_IN_PRIORITY

::ActionController::Renderers - Included

RENDERERS

::ActiveSupport::Callbacks - Included

CALLBACK_FILTER_TYPES

::ActionController::RequestForgeryProtection - Included

AUTHENTICITY_TOKEN_LENGTH

::ActionController::ForceSSL - Included

ACTION_OPTIONS, REDIRECT_OPTIONS, URL_OPTIONS

::ActionController::ParamsWrapper - Included

EXCLUDE_PARAMETERS

::ActionController::Base - Inherited

MODULES, PROTECTED_IVARS

Class Attribute Summary

::ActionController::Metal - Inherited

::AbstractController::Base - Inherited

.abstract?
.supports_path?

Returns true if the given controller is capable of rendering a path.

Class Method Summary

::ActionController::Base - Inherited

.protected_instance_variables,
.without_modules

Shortcut helper that returns all the modules included in ::ActionController::Base except the ones passed as arguments:

::ActionController::Metal - Inherited

.action

Returns a ::Rack endpoint for the given action name.

.call

Makes the controller a ::Rack endpoint that runs the action in the given env's action_dispatch.request.path_parameters key.

.controller_name

Returns the last part of the controller's name, underscored, without the ending Controller.

.middleware

Alias for middleware_stack.

.new,
.use

Pushes the given ::Rack middleware and its arguments to the bottom of the middleware stack.

::AbstractController::Base - Inherited

.abstract,
.abstract!

Define a controller as abstract.

.action_methods

A list of method names that should be considered actions.

.clear_action_methods!

action_methods are cached and there is sometimes need to refresh them.

.controller_path

Returns the full controller name, underscored, without the ending Controller.

.hidden_actions

The list of hidden actions.

.internal_methods

A list of all internal methods for a controller.

.method_added

Refresh the cached action_methods when a new action_method is added.

::ActiveSupport::DescendantsTracker - Extended

Instance Attribute Summary

::ActionController::Instrumentation - Included

::ActionController::Rescue - Included

#rescue_handlers, #rescue_handlers?,
#show_detailed_exceptions?

Override this method if you want to customize when detailed exceptions must be shown.

::ActionController::RequestForgeryProtection - Included

::ActionController::StrongParameters - Included

#params

Returns a new ::ActionController::Parameters object that has been instantiated with the request.parameters.

#params=

Assigns the given value to the #params hash.

#rescue_handlers, #rescue_handlers?

::ActionController::Caching::ConfigMethods - Included

::ActionController::EtagWithTemplateDigest - Included

::ActionController::Renderers::All - Included

::ActionView::Layouts - Included

#_layout_conditions, #action_has_layout=,
#action_has_layout?

Controls whether an action should be rendered using a layout.

::ActionView::Rendering - Included

::ActionController::Redirecting - Included

::ActionController::RackDelegation - Included

::AbstractController::UrlFor - Included

::ActionController::Helpers - Included

::AbstractController::Rendering - Included

::ActionView::ViewPaths - Included

::ActionController::Metal - Inherited

#content_type,
#content_type=

Basic implementations for content_type=, location=, and headers are provided to reduce the dependency on the RackDelegation module in ::ActionView::Renderer and Redirector.

#env, #env=,
#headers

The details below can be overridden to support a specific Request and Response object.

#location, #location=, #middleware_stack, #middleware_stack?, #params, #params=,
#performed?

Tests if render or redirect has already happened.

#request

The details below can be overridden to support a specific Request and Response object.

#response

The details below can be overridden to support a specific Request and Response object.

#response_body=, #session, #status, #status=

::AbstractController::Base - Inherited

Instance Method Summary

::ActionDispatch::TestProcess - Included

#assigns, #cookies,
#fixture_file_upload

Shortcut for Rack::Test::UploadedFile.new(File.join(ActionController::TestCase.fixture_path, path), type):

#flash, #redirect_to_url, #session

::ActionController::Base - Inherited

#request

Returns an ::ActionDispatch::Request instance that represents the current request.

#response

Returns an ::ActionDispatch::Response that represents the current response.

::ActionController::ParamsWrapper - Included

#process_action

Performs parameters wrapping upon the request.

::ActionController::Instrumentation - Included

::ActionController::Rescue - Included

::ActionController::HttpAuthentication::Token::ControllerMethods - Included

::ActionController::HttpAuthentication::Digest::ControllerMethods - Included

#authenticate_or_request_with_http_digest,
#authenticate_with_http_digest

Authenticate with HTTP Digest, returns true or false.

#request_http_digest_authentication

Render output including the HTTP Digest authentication header.

::ActionController::HttpAuthentication::Basic::ControllerMethods - Included

::ActionController::DataStreaming - Included

#send_data

Sends the given binary data to the browser.

#send_file

Sends the file.

::ActionController::ForceSSL - Included

#force_ssl_redirect

Redirect the existing request to use the HTTPS protocol.

::ActionController::Flash - Included

::ActiveSupport::Rescuable - Included

#handler_for_rescue,
#rescue_with_handler

Tries to rescue the exception by looking up and calling a registered handler.

::ActionController::ImplicitRender - Included

::ActionController::MimeResponds - Included

#respond_to

Without web-service support, an action which collects the data for displaying a list of people might look something like this:

#respond_with

::ActionController::Caching - Included

::ActionController::Caching::Fragments - Included

#expire_fragment

Removes fragments from the cache.

#fragment_cache_key

Given a key (as described in expire_fragment), returns a key suitable for use in reading, writing, or expiring a cached fragment.

#fragment_exist?

Check if a cached fragment from the location signified by key exists (see expire_fragment for acceptable formats).

#read_fragment

Reads a cached fragment from the location signified by key (see expire_fragment for acceptable formats).

#write_fragment

Writes content to the location signified by key (see expire_fragment for acceptable formats).

::AbstractController::Callbacks - Included

#process_action

Override AbstractController::Base's process_action to run the process_action callbacks around the normal behavior.

::ActiveSupport::Callbacks - Included

#run_callbacks

Runs the callbacks for the given event.

::ActionController::ConditionalGet - Included

#expires_in

Sets a HTTP 1.1 Cache-Control header.

#expires_now

Sets a HTTP 1.1 Cache-Control header of no-cache so no caching should occur by the browser or intermediate caches (like caching proxy servers).

#fresh_when

Sets the etag, last_modified, or both on the response and renders a 304 Not Modified response if the request is already fresh.

#stale?

Sets the etag and/or last_modified on the response and checks it against the client request.

::ActionController::Head - Included

#head

Returns a response that has no content (merely headers).

::ActionController::Renderers - Included

::ActionController::Rendering - Included

#render_to_body,
#render_to_string

Overwrite render_to_string because body can now be set to a rack body.

::ActionView::Rendering - Included

#render_to_body, #rendered_format,
#view_context

An instance of a view class.

#view_renderer

Returns an object that is able to render templates.

::ActionController::Redirecting - Included

#redirect_to

Redirects the browser to the target specified in options.

::ActionController::RackDelegation - Included

::ActiveSupport::Benchmarkable - Included

#benchmark

Allows you to measure the execution time of a block in a template and records the result to the log.

::ActionController::UrlFor - Included

::AbstractController::UrlFor - Included

::ActionDispatch::Routing::UrlFor - Included

#initialize,
#url_for

Generate a url based on the options provided, default_url_options and the routes defined in routes.rb.

#url_options

Hook overridden in controller to add request information with default_url_options.

::ActionDispatch::Routing::PolymorphicRoutes - Included

#polymorphic_path

Returns the path component of a URL for the given record.

#polymorphic_url

Constructs a call to a named RESTful route for the given record and returns the resulting URL string.

::ActionController::ModelNaming - Included

#convert_to_model

Converts the given object to an ::ActiveModel compliant one.

#model_name_from_record_or_class

::AbstractController::Translation - Included

#l
#localize

Delegates to I18n.localize.

#t
#translate

Delegates to I18n.translate.

::AbstractController::Rendering - Included

#_normalize_args

Normalize args by converting render “foo” to render :action => “foo” and render “foo/bar” to render :file => “foo/bar”.

#_normalize_options

Normalize options.

#_normalize_render

Normalize args and options.

#_process_format

Process the rendered format.

#_process_options

Process extra options.

#render

Normalize arguments, options and then delegates render_to_body and sticks the result in self.response_body.

#render_to_body

Performs the actual template rendering.

#render_to_string

Raw rendering of a template to a string.

#rendered_format

Returns Content-Type of rendered content :api: public.

#view_assigns

This method should return a hash with assigns.

::ActionView::ViewPaths - Included

#append_view_path, #details_for_lookup,
#lookup_context

::ActionView::LookupContext is the object responsible to hold all information required to lookup templates, i.e. view paths and details.

#prepend_view_path, #template_exists?

::ActionController::Metal - Inherited

#controller_name

Delegates to the class' controller_name.

#url_for

Basic url_for that can be overridden for more robust functionality.

::AbstractController::Base - Inherited

#action_methods

Delegates to the class' #action_methods

#available_action?

Returns true if a method for the action is available and can be dispatched, false otherwise.

#controller_path

Delegates to the class' #controller_path

#process

Calls the action going through the entire action dispatch stack.

::ActiveSupport::Configurable - Included

#config

Reads and writes attributes from a configuration OrderedHash.

Constructor Details

.newTestController

[ GitHub ]

  
# File 'actionview/lib/action_view/test_case.rb', line 24

def initialize
  super
  self.class.controller_path = ""
  @request = ActionController::TestRequest.new
  @response = ActionController::TestResponse.new

  @request.env.delete('PATH_INFO')
  @params = {}
end

Class Attribute Details

.controller_path=(value) (writeonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/test_case.rb', line 17

attr_writer :controller_path

Instance Attribute Details

#controller_path=(path) (writeonly)

[ GitHub ]

  
# File 'actionview/lib/action_view/test_case.rb', line 20

def controller_path=(path)
  self.class.controller_path=(path)
end

#params (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/test_case.rb', line 14

attr_accessor :request, :response, :params

#request (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/test_case.rb', line 14

attr_accessor :request, :response, :params

#response (rw)

[ GitHub ]

  
# File 'actionview/lib/action_view/test_case.rb', line 14

attr_accessor :request, :response, :params