2013-04-15 23 views
1

试图让我的职称考试并看到这个错误时运行:哈特尔回报率3.3.2传职称考试

bundle exec rspec spec/requests/static_pages_spec.rb 

失败:

1) Static pages Help page should have the h1 'Help' 
Failure/Error: visit '/static_pages/Help' 
ActionController::RoutingError: 
    No route matches [GET] "/static_pages/Help" 
# ./spec/requests/static_pages_spec.rb:19:in `block (3 levels) in <top (required)>' 

2) Static pages Help page should have the title 'Help' 
Failure/Error: visit '/static_pages/Help' 
ActionController::RoutingError: 
    No route matches [GET] "/static_pages/Help" 
# ./spec/requests/static_pages_spec.rb:24:in `block (3 levels) in <top (required)>' 

3) Static pages About page should have the h1 'About Us' 
Failure/Error: visit '/static_pages/About' 
ActionController::RoutingError: 
    No route matches [GET] "/static_pages/About" 
# ./spec/requests/static_pages_spec.rb:31:in `block (3 levels) in <top (required)>' 

4) Static pages About page should have the title 'About Us' 
Failure/Error: visit '/static_pages/About' 
ActionController::RoutingError: 
    No route matches [GET] "/static_pages/About" 
# ./spec/requests/static_pages_spec.rb:36:in `block (3 levels) in <top (required)>' 

Finished in 0.16042 seconds 
6 examples, 4 failures 

Failed examples: 

rspec ./spec/requests/static_pages_spec.rb:18 # Static pages Help page should have the h1  'Help' 
rspec ./spec/requests/static_pages_spec.rb:23 # Static pages Help page should have the title 'Help' 
rspec ./spec/requests/static_pages_spec.rb:30 # Static pages About page should have the h1 'About Us' 
rspec ./spec/requests/static_pages_spec.rb:35 # Static pages About page should have the title 'About Us' 

SampleApp :: Application.routes.draw做

get "static_pages/home" 

get "static_pages/help" 

get "static_pages/about" 

我试过各种答案已经发布在其他线程,并没有成功。任何帮助将非常感激。

+0

你用小写字母“help”来尝试吗? – jipiboily

+0

访问'/ static_pages/help'而不是访问'/ static_pages/Help'...也许... – jipiboily

+0

非常感谢!成功了! – entrebeerneur

回答

1

您的网址应该是'/ static_pages/help'而不是'/ static_pages/Help'。