2013-07-26 61 views
0

我一直在努力做捆綁EXEC rspec的投機/請求/ static_pages_spec.rb,但每次我嘗試做我得到這些錯誤9:Rspec的錯誤1.8.7

no DRb server is running. Running in local process instead ... 
FFFFFFFFF 

Failures: 

    1) Static pages Home page should have the h1 'Sample App' 
    Failure/Error: visit root_path 
    NameError: 
     undefined local variable or method `root_path' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x1047a1cc8> 
    # ./spec/requests/static_pages_spec.rb:8 

    2) Static pages Home page should have the base title 
    Failure/Error: visit root_path 
    NameError: 
     undefined local variable or method `root_path' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x1047858e8> 
    # ./spec/requests/static_pages_spec.rb:13 

    3) Static pages Home page should not have a custom page title 
    Failure/Error: visit root_path 
    NameError: 
     undefined local variable or method `root_path' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1:0x10477f448> 
    # ./spec/requests/static_pages_spec.rb:18 

    4) Static pages Help page should have the h1 'Help' 
    Failure/Error: visit help_path 
    ActionView::Template::Error: 
     undefined method `full_title' for #<#<Class:0x1069a3e98>:0x1069a0bf8> 
    # ./app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___963741010_2202798760' 
    # ./spec/requests/static_pages_spec.rb:26 

    5) Static pages Help page should have the title 'Help' 
    Failure/Error: visit help_path 
    ActionView::Template::Error: 
     undefined method `full_title' for #<#<Class:0x1069a3e98>:0x10692e508> 
    # ./app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___963741010_2202798760' 
    # ./spec/requests/static_pages_spec.rb:31 

    6) Static pages About page should have the h1 'About Us' 
    Failure/Error: visit about_path 
    ActionView::Template::Error: 
     undefined method `full_title' for #<#<Class:0x1069a3e98>:0x1068fb928> 
    # ./app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___963741010_2202798760' 
    # ./spec/requests/static_pages_spec.rb:39 

    7) Static pages About page should have the title 'About Us' 
    Failure/Error: visit about_path 
    ActionView::Template::Error: 
     undefined method `full_title' for #<#<Class:0x1069a3e98>:0x1068bc3e0> 
    # ./app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___963741010_2202798760' 
    # ./spec/requests/static_pages_spec.rb:44 

    8) Static pages Contact page should have the content 'Contact' 
    Failure/Error: visit contact_path 
    ActionView::Template::Error: 
     undefined method `full_title' for #<#<Class:0x1069a3e98>:0x106b095a8> 
    # ./app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___963741010_2202798760' 
    # ./spec/requests/static_pages_spec.rb:52 

    9) Static pages Contact page should have the title 'Contact' 
    Failure/Error: visit contact_path 
    ActionView::Template::Error: 
     undefined method `full_title' for #<#<Class:0x1069a3e98>:0x106abb740> 
    # ./app/views/layouts/application.html.erb:4:in `_app_views_layouts_application_html_erb___963741010_2202798760' 
    # ./spec/requests/static_pages_spec.rb:57 

我已經重新啓動spork服務器,並刪除public/index.html文件,我仍然得到錯誤。這裏是我的耙路線的結果:

static_pages_home  /static_pages/home(.:format) static_pages#home 
       help GET /help(.:format)     static_pages#help 
       about GET /about(.:format)    static_pages#about 
      contact GET /contact(.:format)    static_pages#contact 
        GET /static_pages/home(.:format) static_pages#home 
    static_pages_help GET /static_pages/help(.:format) static_pages#help 
    static_pages_about GET /static_pages/about(.:format) static_pages#about 
static_pages_contact GET /static_pages/contact(.:format) static_pages#contact 

回答

0

root_path錯誤是因爲你沒有定義的「根」的路線。您需要分享您的代碼以分析full_title未被定義的原因。如果你正在關注Hartl的教程,你可能想爲它添加一個標籤。