Skip to content

Add support for asserting job is enqueued with no wait. #1977

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

Merged
merged 1 commit into from
Mar 29, 2018

Conversation

bcharna
Copy link
Contributor

@bcharna bcharna commented Mar 27, 2018

No description provided.

Copy link
Member

@JonRowe JonRowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, a few quibbles :)

@@ -149,12 +149,17 @@ def other_attributes_match?(job)

def serialized_attributes
{}.tap do |attributes|
attributes[:at] = @at.to_f if @at
attributes[:at] = serialized_at
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not quite the same, can we do serialized_at if @at and eliminate the nil check in the method, we don't want to se this at all if it hasn't been set.

expect {
hello_job.set(:wait_until => date).perform_later
}.to_not have_enqueued_job.at(:no_wait)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another scenario here, not setting at at all and there being a wait

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good callouts 👍

@JonRowe JonRowe merged commit a9ba8d0 into rspec:master Mar 29, 2018
JonRowe added a commit that referenced this pull request Mar 29, 2018
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants