2
應用程序的routes.rb中有爲什麼rspec不能找到_path方法?
resources :users, :only => :show
用戶視圖具有
User: #{link_to user.name, user}
視圖規格有
describe 'home/index.html.haml' do
it 'should render the users' do
@users = User.all
render
end
end
它做了正確的事情,如果我打本地應用程序,但如果我在視圖上運行rspec,我得到
Failure/Error: render
ActionView::Template::Error:
undefined method `user_path' for #<#<Class:0x109f2a468>:0x109db5128>
rspec文件的實際行是什麼? – Nick
更新了rspec內容的問題。 – Gautam