-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create basic abo login role on external event registration
- Loading branch information
1 parent
44b9e5d
commit 21a3ab2
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,12 @@ | |
end | ||
end | ||
let(:group) { event.groups.first } | ||
before do | ||
Group::AboBasicLogin.create!( | ||
parent: groups(:abos), | ||
self_registration_role_type: "Group::AboBasicLogin::BasicLogin" | ||
) | ||
end | ||
|
||
let(:attrs) { | ||
{ | ||
|
@@ -46,7 +52,12 @@ | |
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) | ||
|
||
person = Person.find_by(email: "[email protected]") | ||
|
||
expect(person.roles.size).to eq(1) | ||
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 | ||
|