-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
14c4c6e
commit 709dd9f
Showing
10 changed files
with
97 additions
and
24 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
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
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
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
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
52 changes: 52 additions & 0 deletions
52
spec/views/wizards/signup/_section_fee_summary.html.haml_spec.rb
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright (c) 2024, Schweizer Alpen-Club. This file is part of | ||
# hitobito_sac_cas and licensed under the Affero General Public License version 3 | ||
# or later. See the COPYING file at the top-level directory or at | ||
# https://github.com/hitobito/hitobito_sac_cas. | ||
|
||
require "spec_helper" | ||
|
||
describe "wizards/signup/_section_fee_summary.html.haml" do | ||
include FormatHelper | ||
let(:group) { groups(:bluemlisalp) } | ||
let(:adult) { fees_for(:adult) } | ||
let(:family) { fees_for(:family) } | ||
let(:youth) { fees_for(:youth) } | ||
|
||
let(:dom) { | ||
Capybara::Node::Simple.new(@rendered) | ||
} | ||
|
||
def fees_for(beitragskategorie) | ||
Invoices::SacMemberships::SectionSignupFeePresenter.new(group, beitragskategorie, date: Time.zone.now.beginning_of_year) | ||
end | ||
|
||
it "is hidden if not active" do | ||
render locals: {adult:, family:, youth:, active: false} | ||
expect(dom).to have_css "aside.card.d-none" | ||
end | ||
|
||
it "is hidden if not active" do | ||
render locals: {adult:, family:, youth:, active: true} | ||
expect(dom).to have_css "aside.card:not(.d-none)" | ||
end | ||
|
||
it "renders label and amount" do | ||
render locals: {adult:, family:, youth:, active: true} | ||
expect(dom).to have_css "tr:nth-of-type(1) td:nth-of-type(1)", text: "Einzelmitgliedschaft" | ||
expect(dom).to have_css "tr:nth-of-type(1) td:nth-of-type(2)", text: "CHF 127.00 + einmalige Eintrittsgebühr CHF 20.00" | ||
expect(dom).to have_css "tr:nth-of-type(2) td:nth-of-type(1)", text: "Familienmitgliedschaft" | ||
expect(dom).to have_css "tr:nth-of-type(2) td:nth-of-type(2)", text: "CHF 179.00 + einmalige Eintrittsgebühr CHF 35.00" | ||
expect(dom).to have_css "tr:nth-of-type(3) td:nth-of-type(1)", text: "Jugendmitgliedschaft" | ||
expect(dom).to have_css "tr:nth-of-type(3) td:nth-of-type(2)", text: "CHF 76.00 + einmalige Eintrittsgebühr CHF 15.00" | ||
end | ||
|
||
it "renders label and amount without entry fee" do | ||
render locals: {adult:, family:, youth:, active: true, skip_entry_fee: true} | ||
expect(dom).to have_css "tr:nth-of-type(1) td:nth-of-type(1)", text: "Einzelmitgliedschaft" | ||
expect(dom).to have_css "tr:nth-of-type(1) td:nth-of-type(2)", text: "CHF 127.00" | ||
expect(dom).to have_css "tr:nth-of-type(2) td:nth-of-type(1)", text: "Familienmitgliedschaft" | ||
expect(dom).to have_css "tr:nth-of-type(2) td:nth-of-type(2)", text: "CHF 179.00" | ||
expect(dom).to have_css "tr:nth-of-type(3) td:nth-of-type(1)", text: "Jugendmitgliedschaft" | ||
expect(dom).to have_css "tr:nth-of-type(3) td:nth-of-type(2)", text: "CHF 76.00" | ||
end | ||
end |