2019-07-19 00:59:12 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 21:27:38 -05:00
|
|
|
RSpec.describe Jobs::ProcessBulkInviteEmails do
|
2023-01-09 05:18:21 -06:00
|
|
|
describe "#execute" do
|
|
|
|
it "processes pending invites" do
|
2019-07-19 00:59:12 -05:00
|
|
|
invite = Fabricate(:invite, emailed_status: Invite.emailed_status_types[:bulk_pending])
|
|
|
|
|
|
|
|
described_class.new.execute({})
|
|
|
|
|
|
|
|
invite.reload
|
|
|
|
expect(invite.emailed_status).to eq(Invite.emailed_status_types[:sending])
|
|
|
|
expect(Jobs::InviteEmail.jobs.size).to eq(1)
|
|
|
|
expect(Jobs::ProcessBulkInviteEmails.jobs.size).to eq(1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|