2011-11-07 86 views
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> 
+0

rspec文件的实际行是什么? – Nick

+0

更新了rspec内容的问题。 – Gautam

回答

1

Spork原来是罪魁祸首。重新启动它,规格现在通过。