【发布时间】:2015-08-04 23:27:58
【问题描述】:
我正在使用 RSpec 3.2。
require 'spec_helper'
describe SimulationsController, :type => :controller do
context "GET #index" do
it "populates an array of simulations" do
simulation = FactoryGirl.build(:simulation)
get :index
response.should render_template :index
end
end
end
我指定了控制器类型,但仍然收到此错误,是不是我做错了什么?
【问题讨论】:
-
你能发布你的
spec_helper.rb吗? -
实际上只是修复了它,需要'require'rspec/rails''
-
太棒了!将其添加为答案:)
标签: ruby-on-rails ruby rspec controller specifications