2013-07-26 3 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 server и удалил файл 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, вам может понадобиться добавить к нему тег.

Смежные вопросы