Created
March 14, 2020 18:29
-
-
Save donrestarone/f1da6491a97fdfcaeaee7ffd2928fa0d to your computer and use it in GitHub Desktop.
a simple job spec with rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
require 'sidekiq/testing' | |
RSpec.describe EmailConfirmationJob, type: :job do | |
before(:each) do | |
@user = create_new_user | |
Sidekiq::Testing.inline! | |
end | |
it 'enqueues and changes the email_sent status to true' do | |
EmailConfirmationJob.perform_later(@user.id) | |
expect(@user.reload.email_verification_sent).to eql true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment