An integration test spans multiple controllers and actions, tying them all
together to ensure they work together as expected. It tests more completely
than either unit or functional tests do, exercising the entire stack, from
the dispatcher to the database.

At its simplest, you simply extend IntegrationTest and write your tests
using the get/post methods:

require"test_helper"class ExampleTest<ActionDispatch::IntegrationTestfixtures:peopledef test_login# get the login pageget"/login"assert_equal200,status# post the login and follow through to the home pagepost"/login",:username=>people(:jamis).username,:password=>people(:jamis).passwordfollow_redirect!assert_equal200,statusassert_equal"/home",pathendend

However, you can also have multiple session instances open per test, and
even extend those instances with assertions and methods to create a very
powerful testing DSL that is specific for your application. You can even
reference any named routes you happen to have defined.