ganshou-no-MacBook-Air:sample_app takako$ bundle exec rspec spec/requests/static_pages_spec.rb
↓
FF
Failures:
1) Static pages Home page should have the content 'Sample App'
Failure/Error: visit '/static_pages/home'
ActionController::RoutingError:
No route matches [GET] "/static_pages/home"
# ./spec/requests/static_pages_spec.rb:8:in `block (3 levels) in '
2) Static pages Help page should have the content 'Help'
Failure/Error: visit '/static_pages/help'
ActionController::RoutingError:
No route matches [GET] "/static_pages/help"
# ./spec/requests/static_pages_spec.rb:16:in `block (3 levels) in '
Finished in 0.00746 seconds
2 examples, 2 failures
Failed examples:
rspec ./spec/requests/static_pages_spec.rb:7 # Static pages Home page should have the content 'Sample App'
rspec ./spec/requests/static_pages_spec.rb:15 # Static pages Help page should have the content 'Help'
Randomized with seed 54906
ない・・
$ subl config/routes.rb
SampleApp::Application.routes.draw do
end
何も入っていない
以下の2行を追加SampleApp::Application.routes.draw do
get "static_pages/home"
get "static_pages/help"
end
$ bundle exec rspec spec/requests/static_pages_spec.rb
..
Finished in 0.04232 seconds
2 examples, 0 failures
Randomized with seed 1420
成功!