Controller code:
class BooksController < ApplicationController
def index
@books = Book.all
respond_to do |format|
format.html do
r
You may find the "Testing Controllers with RSpec" RailsCast and the official rspec-rails documentation helpful.
Looking at the code for assert_template (which is just what render_template calls), it looks like you should be able to do
response.should render_template("index")
response.should render_template(:layout => "topgun")
though I'm not entirely sure that will work.
For RSpec 3:
expect(response).to render_template(:new) # wraps assert_template
https://relishapp.com/rspec/rspec-rails/v/3-7/docs/controller-specs