-
Notifications
You must be signed in to change notification settings - Fork 187
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
Bring registration emails in line with v2 statuses #10720
base: main
Are you sure you want to change the base?
Bring registration emails in line with v2 statuses #10720
Conversation
@@ -15,7 +15,6 @@ | |||
let(:registration) { FactoryBot.create(:registration, user: french_user, competition: competition_with_organizers) } | |||
let(:mail_new) { RegistrationsMailer.notify_registrant_of_new_registration(registration) } | |||
let(:mail_accepted) { RegistrationsMailer.notify_registrant_of_accepted_registration(registration) } | |||
let(:mail_pending) { RegistrationsMailer.notify_registrant_of_pending_registration(registration) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this disappearing without replacement? There is notify_registrant_of_waitlisted_registration
now, which you could well put here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header test seems to rely on a french translation key which we don't have - should I add it in in order for the test to pass? I can find some french people to consult with
@@ -164,6 +164,49 @@ | |||
registration = Registration.find_by(user_id: user.id, competition_id: favourites_reg.competition.id) | |||
expect(registration.event_ids.sort).to eq(new_event_ids.sort) | |||
end | |||
|
|||
it 'user gets registration email if they cancel and re-register' do | |||
perform_enqueued_jobs do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You only need to wrap perform_enqueued_jobs
around those parts of your test that actually enqueue the job. So in this case, it would probably be the patch
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option is to just write your test as usual, and call perform_enqueued_jobs
directly as a method to "flush" the job queue, without passing a do
block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
end | ||
|
||
it 'user gets registration email if they were rejected and get moved to pending' do | ||
perform_enqueued_jobs do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This addresses a few different issues:
TODO: