我收到以下錯誤在我的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