Skip to content

Commit

Permalink
Add feature spec for all abo wizards
Browse files Browse the repository at this point in the history
  • Loading branch information
njaeggi committed Dec 17, 2024
1 parent ac06d64 commit 81b206b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/features/signup/abo_basic_login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,17 @@ def expect_validation_error(message)
expect(page).to have_link("Anmelden")
end
end

it "has prefilled form when logged in" do
people(:admin).update!(country: "CH")
sign_in(people(:admin))
visit group_self_registration_path(group_id: group)
expect(page).to have_text "SAC-KONTO ERSTELLEN"
expect(page).not_to have_text "Weiter"
check "Ich habe die Datenschutzerklärung gelesen und stimme dieser zu"
expect do
click_button "SAC-KONTO ERSTELLEN"
expect(page).to have_css "#error_explanation, #flash > .alert"
end.to change { Role.count }.by(1)
end
end
15 changes: 15 additions & 0 deletions spec/features/signup/abo_magazin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,19 @@ def complete_last_page(date: Date.tomorrow, submit: true)
expect(page).to have_field("Geburtsdatum", with: "03.01.1924")
end
end

it "has prefilled form when logged in" do
people(:admin).update!(country: "CH")
sign_in(people(:admin))
visit group_self_registration_path(group_id: group)
expect_active_step "Personendaten"
click_button "Weiter"
expect(page).to have_text "[email protected]"
check "Ich habe die AGB gelesen und stimme diesen zu"
check "Ich habe die Datenschutzerklärung gelesen und stimme dieser zu"
expect do
click_button "ABO KOSTENPFLICHTIG BESTELLEN"
expect(page).to have_css "#error_explanation, #flash > .alert"
end.to change { Role.count }.by(1)
end
end
14 changes: 14 additions & 0 deletions spec/features/signup/abo_touren_portal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,18 @@ def expect_validation_error(message)
expect(page).to have_text "Person muss 18 Jahre oder älter sein"
end.not_to change { Person.count }
end

it "has prefilled form when logged in" do
people(:admin).update!(country: "CH")
sign_in(people(:admin))
visit group_self_registration_path(group_id: group)
expect(page).to have_text "Registrieren"
expect(page).not_to have_text "Weiter"
check "Ich habe die Statuten gelesen und stimme diesen zu"
check "Ich habe die Datenschutzerklärung gelesen und stimme dieser zu"
expect do
click_button "Registrieren"
expect(page).to have_css "#error_explanation, #flash > .alert"
end.to change { Role.count }.by(1)
end
end

0 comments on commit 81b206b

Please sign in to comment.