Skip to content

Instantly share code, notes, and snippets.

@donrestarone
Created March 14, 2020 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donrestarone/f1da6491a97fdfcaeaee7ffd2928fa0d to your computer and use it in GitHub Desktop.
Save donrestarone/f1da6491a97fdfcaeaee7ffd2928fa0d to your computer and use it in GitHub Desktop.
a simple job spec with rspec
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