--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: controller_class
- !ruby/object:RI::MethodSummary 
  name: controller_class=
- !ruby/object:RI::MethodSummary 
  name: determine_default_controller_class
- !ruby/object:RI::MethodSummary 
  name: prepare_controller_class
- !ruby/object:RI::MethodSummary 
  name: tests
comment: 
- !ruby/struct:SM::Flow::P 
  body: Superclass for ActionController functional tests. Functional tests allow you to test a single controller action per test method. This should not be confused with integration tests (see ActionController::IntegrationTest), which are more like &quot;stories&quot; that can involve multiple controllers and mutliple actions (i.e. multiple different HTTP requests).
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Basic example
- !ruby/struct:SM::Flow::P 
  body: "Functional tests are written as follows:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "1."
    body: First, one uses the <tt>get</tt>, <tt>post</tt>, <tt>put</tt>, <tt>delete</tt> or <tt>head</tt> method to simulate an HTTP request.
  - !ruby/struct:SM::Flow::LI 
    label: "2."
    body: "Then, one asserts whether the current state is as expected. &quot;State&quot; can be anything: the controller's HTTP response, the database contents, etc."
  type: :NUMBER
- !ruby/struct:SM::Flow::P 
  body: "For example:"
- !ruby/struct:SM::Flow::VERB 
  body: "  class BooksControllerTest &lt; ActionController::TestCase\n    def test_create\n      # Simulate a POST response with the given HTTP parameters.\n      post(:create, :book =&gt; { :title =&gt; &quot;Love Hina&quot; })\n\n      # Assert that the controller tried to redirect us to\n      # the created book's URI.\n      assert_response :found\n\n      # Assert that the controller really put the book in the database.\n      assert_not_nil Book.find_by_title(&quot;Love Hina&quot;)\n    end\n  end\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Special instance variables
- !ruby/struct:SM::Flow::P 
  body: "ActionController::TestCase will also automatically provide the following instance variables for use in the tests:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "<b>@controller</b>:"
    body: The controller instance that will be tested.
  - !ruby/struct:SM::Flow::LI 
    label: "<b>@request</b>:"
    body: An ActionController::TestRequest, representing the current HTTP request. You can modify this object before sending the HTTP request. For example, you might want to set some session properties before sending a GET request.
  - !ruby/struct:SM::Flow::LI 
    label: "<b>@response</b>:"
    body: An ActionController::TestResponse object, representing the response of the last HTTP response. In the above example, <tt>@response</tt> becomes valid after calling <tt>post</tt>. If the various assert methods are not sufficient, then you may use this object to inspect the HTTP response in detail.
  type: :NOTE
- !ruby/struct:SM::Flow::P 
  body: (Earlier versions of Rails required each functional test to subclass Test::Unit::TestCase and define @controller, @request, @response in <tt>setup</tt>.)
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Controller is automatically inferred
- !ruby/struct:SM::Flow::P 
  body: ActionController::TestCase will automatically infer the controller under test from the test class name. If the controller cannot be inferred from the test class name, you can explicity set it with <tt>tests</tt>.
- !ruby/struct:SM::Flow::VERB 
  body: "  class SpecialEdgeCaseWidgetsControllerTest &lt; ActionController::TestCase\n    tests WidgetController\n  end\n"
constants: []

full_name: ActionController::TestCase
includes: []

instance_methods: 
- !ruby/object:RI::MethodSummary 
  name: rescue_action_in_public!
- !ruby/object:RI::MethodSummary 
  name: setup_controller_request_and_response
name: TestCase
superclass: ActiveSupport::TestCase
