【发布时间】:2013-11-07 09:51:45
【问题描述】:
在我看来,规格如下
require 'spec_helper'
describe "my_project/index.html.erb" do
it "displays the Country drop down" do
render
rendered.should contain("Country")
end
end
但是当我运行规范时,我得到以下错误
Failure/Error: render
ActionView::Template::Error:
undefined method `map' for nil:NilClass
我很困惑为什么我的页面确实包含文本时会出现此错误。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 rspec bdd