Rails Tutorial 9章でテストエラーとなった。解決策つき。
RailsTutorialの9章を進めていてエラーが起きた。
エラー内容
Failures:
1) Authentication authorization for non-signed-in users in the Users Controller submitting to the update action Failure/Error: specify { expect(response).to redirect_to(signin_path) } NoMethodError:undefined method
assertions' for #RSpec::Rails::TestUnitAssertionAdapter::AssertionDelegator:0x007fb298809560> # ./spec/requests/authentication_pages_spec.rb:53:in
block (6 levels) in'
回避策
Gemで指定していたRspecのversionが古かった。
修正前
修正後
原因
bug らしい
You can no longer `include Minitest::Assertions` · Issue #286 · seattlerb/minitest · GitHub
Stack Over Flowにもテストが通らない人がいた。
rspec2 - Rails 4 and RSpec, undefined method `assertions' in routing spec - Stack Overflow