Skip to content
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

fix readme testing section #333

Merged
merged 1 commit into from
Nov 8, 2018

Conversation

edmartins
Copy link

In the Testing section of the README.md has a test example as bellow:

it 'prevents duplicate jobs from being scheduled' do
  SidekiqUniqueJobs.use_config(enabled: true) do
    expect(described_class.perform_async(1)).not_to eq(nil)
    expect(described_class.perform_async(1)).to eq(nil)
  end
end

The problem is if the first perform_async runs quickly before the second, the test will not pass.
In another application I had problems performing the tests this way, being that only sometimes the test passed.
Changing the first expect with perform_in the result is as expected.

@mhenrixon mhenrixon merged commit 9d1ee6c into mhenrixon:master Nov 8, 2018
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