Skip to content
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

Merged

Conversation

TheWalkingLeek
Copy link
Member

No description provided.

@TheWalkingLeek TheWalkingLeek force-pushed the feature/sac_1409_external_event_register_pw_reset branch 2 times, most recently from 4579413 to 21a3ab2 Compare December 17, 2024 08:21
@TheWalkingLeek TheWalkingLeek linked an issue Dec 17, 2024 that may be closed by this pull request
spec/controllers/event/register_controller_spec.rb Outdated Show resolved Hide resolved
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}
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.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: [])
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(Devise::Mailer).to receive(:reset_password_instructions).and_call_original

See suggestion about have_enqueud_mail.

Copy link
Contributor

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
Copy link
Contributor

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?

@amaierhofer amaierhofer force-pushed the feature/sac_1409_external_event_register_pw_reset branch 2 times, most recently from f1369e5 to a2ba120 Compare December 18, 2024 16:04
@amaierhofer amaierhofer enabled auto-merge (rebase) December 18, 2024 16:07
@amaierhofer amaierhofer force-pushed the feature/sac_1409_external_event_register_pw_reset branch from a2ba120 to 317d45c Compare December 18, 2024 16:07
@amaierhofer amaierhofer merged commit 3ded7aa into master Dec 18, 2024
6 checks passed
@amaierhofer amaierhofer deleted the feature/sac_1409_external_event_register_pw_reset branch December 18, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kurse: Korrektes onboarding bei externer Kursanmeldung
3 participants