So, the controller triggers update/create for the model. But what if that model has no way to be checked through any of the controllers?
If you need to test the interaction of models, controllers, and background jobs, I believe you need an integration test.
As a rule of thumb, I try to not check model-level behavior in my controller specs. I try to keep it as high-level as possible.
Neither of Integration/Functional tests (Request/Controller specs in RSpec terminology) is recommended to check the side effects on the database.
This can be a slippery slope: You want to test that values are written/updated in the database, but you don’t want to test that ActiveRecord does what it’s supposed to do.
Despite the tendency to reduce the amount of logic in controllers to a bare minimum, the logic to e.g. schedule background jobs is triggered by a chain that starts in the controller by saving or updating a model.
If this is the case that I’m trying to test, I would add an expectation to my model spec: “After I create a notification record in the database, I expect a job to be enqueued for the NotificationJob.”