-
Notifications
You must be signed in to change notification settings - Fork 1
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
Send reset instructions on external event registration #1412
Send reset instructions on external event registration #1412
Conversation
4579413
to
21a3ab2
Compare
expect(Devise::Mailer).to receive(:reset_password_instructions).and_call_original | ||
|
||
expect do | ||
put :register, params: {group_id: group.id, id: event.id, event_participation_contact_data: attrs} |
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 a put
and not a post
?
expect do | ||
put :register, params: {group_id: group.id, id: event.id, event_participation_contact_data: attrs} | ||
end.to change { Person.count }.by(1) | ||
.and change { Group::AboBasicLogin::BasicLogin.count }.by(1) |
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.
.and change { Group::AboBasicLogin::BasicLogin.count }.by(1) | |
.and change { Group::AboBasicLogin::BasicLogin.count }.by(1) | |
.and have_enqueued_mail(Devise::Mailer, :reset_password_instructions) |
There's also an event confirmation email that is sent, right?
context "PUT register" do | ||
context "with valid data" do | ||
it "creates person and sends password reset instructions" do | ||
event.update!(required_contact_attrs: []) |
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.
I'd move this in the let
binding above.
it "creates person and sends password reset instructions" do | ||
event.update!(required_contact_attrs: []) | ||
|
||
expect(Devise::Mailer).to receive(:reset_password_instructions).and_call_original |
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.
expect(Devise::Mailer).to receive(:reset_password_instructions).and_call_original |
See suggestion about have_enqueud_mail
.
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.
enqueued email klappt imho nicht, weil devise das direkt und nicht background job verschickt
expect(person.roles.first.type).to eq(Group::AboBasicLogin::BasicLogin.sti_name) | ||
is_expected.to redirect_to(new_group_event_participation_path(group, event)) | ||
expect(flash[:notice]).to include "Deine persönlichen Daten wurden aufgenommen. Bitte ergänze nun noch die Angaben" | ||
end |
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.
From the ticket "Newsletter (sollten schon passen)"
Can we add an expect for this?
f1369e5
to
a2ba120
Compare
a2ba120
to
317d45c
Compare
No description provided.