更新:これは、ファイル名のスペルミスが原因でした
正しい:
~/sample_app/app/controllers/microposts_controller.rb
正しくない:
~/sample_app/app/controllers/microposts_contoller.rb
これは私の最初の投稿です。これまたは将来の投稿を改善するためのフィードバックをお待ちしております :)
Ruby on Rails チュートリアル: Rails 4 で Web 開発を学ぶ
10.3章を進めているときに行き詰まってしまいました。結局、ファイル名のつづりが間違っていたため、数日間幽霊を追いかけることになりました。
$ rspec spec/requests/authentication_pages_spec.rb
No DRb server is running. Running in local process instead ...
...FF................
Failures:
1) Authentication authorization for non-signed-in users in the Microposts controller submitting to the create action
Failure/Error: before { post microposts_path }
ActionController::RoutingError:
uninitialized constant MicropostsController
# ./spec/requests/authentication_pages_spec.rb:93:in `block (6 levels) in '
2) Authentication authorization for non-signed-in users in the Microposts controller submitting to the destroy action
Failure/Error: before { delete micropost_path(FactoryGirl.create(:micropost)) }
ActionController::RoutingError:
uninitialized constant MicropostsController
# ./spec/requests/authentication_pages_spec.rb:98:in `block (6 levels) in '
Finished in 0.92253 seconds
21 examples, 2 failures
Failed examples:
rspec ./spec/requests/authentication_pages_spec.rb:94 # Authentication authorization for non-signed-in users in the Microposts controller submitting to the create action
rspec ./spec/requests/authentication_pages_spec.rb:99 # Authentication authorization for non-signed-in users in the Microposts controller submitting to the destroy action