Skip to content

Commit

Permalink
Add spec
Browse files Browse the repository at this point in the history
  • Loading branch information
njaeggi authored and amaierhofer committed Jan 2, 2025
1 parent 5e295e7 commit 2c5ac89
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/controllers/groups/self_registration_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,17 @@ def wizard_params(step: 0, **attrs)
expect(flash[:notice]).to eq "Du ist einer Familie zugeordnet. Kontaktiere bitte die SAC-Geschäftsstelle."
end
end

context "without primary group id" do
let(:person) { Fabricate(:person) }

it "redirects to memberships tab layered under root group with a flash message" do
allow_any_instance_of(Wizards::Signup::SektionWizard).to receive(:member_or_applied?).and_return(true)
get :show, params: wizard_params

expect(response).to redirect_to(history_group_person_path(group_id: Group.root.id, id: person.id))
expect(flash[:notice]).to eq "Du besitzt bereits eine SAC-Mitgliedschaft. Wenn du diese anpassen möchtest, kontaktiere bitte die SAC-Geschäftsstelle."
end
end
end
end

0 comments on commit 2c5ac89

Please sign in to comment.