A controller test has three things you might want to validate after the controller action:
Did it return the expected HTTP status code? RSpec provides the response.status object and the have_http_status matcher for this purpose.
Did it pass control to the expected template or redirected controller action? Here we have the render_template and redirect_to matchers.
Did it set the values that the view will expect? For this we have the special hash objects assigns, cookies, flash, and session.
Often you’ll combine more than one of these in the same test:
it "is a successful index request with no filters" do
expect(response).to render_template(:index) ...