【发布时间】:2011-06-27 01:45:22
【问题描述】:
控制器代码:
class BooksController < ApplicationController
def index
@books = Book.all
respond_to do |format|
format.html do
render 'index', :layout => 'topgun'
end
end
end
end
我应该如何在规范中对此进行测试?
require 'spec_helper'
describe BooksController do
describe "GET index" do
it "renders the topgun layout" do
get :index
# ???
end
end
end
我检查了this related post,但我的response 对象似乎没有layout 属性/方法。
【问题讨论】:
标签: ruby-on-rails rspec