我收到以下错误在我的RSpec代码未定义的局部变量或方法'渲染”
undefined local variable or method `render'
这里是我的代码:
require 'spec_helper'
describe "messages/show.html.erb" do
it "displays the text attribute of the message" do
render
rendered.should contain("Hello world!")
end
end
这是一本书:RSpec的书 以下是我添加到Gemfile中的内容。
group :development , :test do
gem "rspec-rails", ">= 2.0.0"
gem "webrat", ">= 0.7.2"
end
我还没有添加文件show.html.erb的意见/邮件,但我应该得到另一个错误,不是这个
奇怪的是,这个工作我的机器一段时间之前。我删除的项目,创造了一个又一个,现在,它只是不会编辑的Gemfile
bundle install
script/rails generate rspec:install
rake db:migrate
Nopes ....我可能错过了,而复制粘贴它在这里...它不缺少源代码。我将编辑该问题。感谢您指出 – user773327 2013-04-26 04:25:43