Reputation: 13
Trying to get my title test to pass and see this error when running:
bundle exec rspec spec/requests/static_pages_spec.rb
Failures:
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 do
get "static_pages/home"
get "static_pages/help"
get "static_pages/about"
I've tried various answers already posted in other threads and haven't been successful. Any help would be much appreciated.
Upvotes: 1
Views: 204
Reputation: 1240
Your URLs should be '/static_pages/help' instead of '/static_pages/Help'.
Upvotes: 1