최근에 프로젝트를 Rails 5.1로 업그레이드했습니다.컨트롤러 테스트에서 Rails 5.1 업그레이드 후 디버그 (실패) 메시지가 발생합니다.
- 모든 사용 중단 경고가 수정되었습니다.
- 모든 테스트는 (내가
rspec-rails
사용) ActiveJob를 사용 통화 우편물은 이제 긴 경고 메시지를 렌더링하는 것을 - 컨트롤러 테스트를 통과.
[ActiveJob] [ActionMailer::DeliveryJob] [6d2ec032-eff2-40d3-bad4-3b23de65d9bd] Could not log "render_template.action_view" event. NoMethodError: undefined method 'example_group' for nil:NilClass [
"rails/view_rendering.rb:67:in 'current_example_group'", "rspec/rails/view_rendering.rb:71:in 'render_template'", "active_support/subscriber.rb:99:in 'finish'",
... LIST SHORTENED FOR CLARITY ...
"active_job/execution.rb:20:in 'execute'",
... LIST SHORTENED ...
"concurrent/executor/ruby_thread_pool_executor.rb:319:in 'block in create_worker'" ]
은 이메일을 보내 (API) 컨트롤러를 테스트하기 위해 레일 5.1에서 무엇이 바뀌 었습니까? 내가 뭔가 잘못하고 있는거야?
describe Api::UsersController do
it 'creates a new user' do
# THIS ENDPOINT CALLS
# UserMailer.welcome_email(user).deliver_later
post :create, params: params
end
end
이것은 알려진 문제입니다 https://github.com/rspec/rspec-rails/issues/1800 – HarlemSquirrel