Skip to content

Commit

Permalink
Add docs for #on
Browse files Browse the repository at this point in the history
  • Loading branch information
wspurgin committed Jul 31, 2023
1 parent 64f5d4d commit ed22bbc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ AwesomeJob.perform_in 5.minutes, 'Awesome', true
expect(AwesomeJob).to have_enqueued_sidekiq_job('Awesome', true).in(5.minutes)
```

#### Testing queue set for job

Use the chainable `#on` matcher

```ruby
class AwesomeJob
include Sidekiq::Job

sidekiq_options queue: :low
end

AwesomeJob.perform_async("a little awesome")

# test with..
expect(AwesomeJob).to have_enqueued_sidekiq_job("a little awesome").on("low")

# Setting the queue when enqueuing
AwesomeJob.set(queue: "high").perform_async("Very Awesome!")

expect(AwesomeJob).to have_enqueued_sidekiq_job("Very Awesome!").on("high")
```


#### Testing ActiveMailer jobs

Expand Down

0 comments on commit ed22bbc

Please sign in to comment.