2
这真的让我无法防备。在安装haml-rails gem后,stocks/index.html.haml在浏览器中呈现无问题。然而,当我试图测试使用RSpec的/水豚haml rspec失踪模板
describe "StockPages" do
describe "stocks/index.html.haml" do
before {visit stocks_path}
subject {page}
it { should have_selector('table#Result') }
end
end
我得到这个错误:
Failure/Error: before {visit stocks_path}
ActionView::MissingTemplate:
Missing template stocks/index, application/index with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}.
如何解决这个问题? 谢谢
你是怎么把'haml-rails' gem加到你的'Gemfile'中的,是不是只在开发组中? – matt 2012-07-27 20:53:53
我是多么愚蠢!你是对的。那么我也应该把它包含在测试组中呢?生产如何? – zsljulius 2012-07-27 21:10:06