Paul C

Joined

760 Experience
0 Lessons Completed
1 Question Solved

Activity

Posted in Testing Controllers that call an activejob

Thanks. I made no changes to my codebase, but updated my mac which forced a restart of everything and now the tests pass without issue. I can only think that it was related to this Sidekiq issue:

https://github.com/mperham/sidekiq/issues/2207

Posted in Testing Controllers that call an activejob

Thanks - I'm just calling

JobName.perform_later @content_for_job

Which raises the NameError. If I run it from the application UI it works fine, it's only when running from the test suite that it throws the NameError

Posted in Testing Controllers that call an activejob

Hi,

My integration tests hit a create method in my API that calls an activejob. This works fine in the actual app, but when I run any tests I get:

NameError: uninitialized constant Api::V1::ControllerName::JobName

Do I need to mock out the ActiveJob API or do load ActiveJob inside my ActionDispatch::IntegrationTest?
Thanks!

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.