-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert_enqueued/2 fails to match a job by state=available and scheduled_at #872
Comments
So I've found out that using both
with an invalid condition |
You're correct; the tests are generating an invalid query. There's not much of a reason to assert the scheduled time for something currently |
The use of `Job.new` to normalaize query fields would change assertions with a "scheduled_at" date to _only_ check scheduled, never "available". As a bonus, this also cleans up applying where clauses for assertions. Closes oban-bg#872
Environment
elixir --version
): Elixir 1.14.3 (compiled with Erlang/OTP 25)Current Behavior
Consider these tests:
Click to see the whole script
When I run them, test
#1
fails with a confusing message:The job is clearly there but
assert_enqueued/2
fails to match it.Tests
#2

successfully match this job bystate
and byscheduled_at
, separately. Interestingly enough, test#4
also succeeds by matching a scheduled/delayed job by bothstate
andscheduled_at
, so I suppose the issue has something to do with stateavailable
.Expected Behavior
All tests should pass.
The text was updated successfully, but these errors were encountered: