-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
108 additions
and
157 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
test: | ||
service: TenantDisk | ||
service: Disk | ||
root: <%= Rails.root.join("tmp/storage") %> | ||
|
||
tenant_disk: | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
annual_fee_pdf: | ||
name: pdf_file | ||
record: annual_fee (Invoice) | ||
blob: invoice_pdf | ||
|
||
other_closed_pdf: | ||
name: pdf_file | ||
record: other_closed (Invoice) | ||
blob: invoice_pdf |
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 @@ | ||
invoice_pdf: <%= ActiveStorage::FixtureSet.blob filename: "invoice.pdf" %> |
Binary file not shown.
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ other_closed: | |
invoice: other_closed | ||
member: john | ||
amount: 10 | ||
date: <%= Date.today %> | ||
date: 2024-04-02 |
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,54 @@ | ||
# frozen_string_literal: true | ||
|
||
require "application_system_test_case" | ||
|
||
class Members::BasketsTest < ApplicationSystemTestCase | ||
test "update depot and basket complements" do | ||
travel_to "2024-01-01" | ||
org( | ||
membership_depot_update_allowed: true, | ||
membership_complements_update_allowed: true) | ||
membership = memberships(:jane) | ||
basket = membership.baskets.first | ||
|
||
login(members(:jane)) | ||
assert_includes menu_nav, "Deliveries\n" + "⤷ 4 April 2024" | ||
click_on "Deliveries" | ||
|
||
assert_equal "/deliveries", current_path | ||
assert_text "Bakery" | ||
assert_text "Bread" | ||
assert_no_text "Eggs" | ||
|
||
within "#basket_#{basket.id}" do | ||
click_on "Edit" | ||
end | ||
choose "Home" | ||
fill_in "Bread", with: "2" | ||
fill_in "Eggs", with: "1" | ||
assert_no_text "Cheese" | ||
|
||
assert_changes -> { basket.reload.depot_id }, to: home_id do | ||
assert_changes -> { basket.reload.complement_ids }, to: [ eggs_id, bread_id ] do | ||
click_on "Confirm" | ||
end | ||
end | ||
|
||
assert_equal "/deliveries", current_path | ||
assert_text "Home" | ||
assert_text "2x Bread and Eggs" | ||
end | ||
|
||
test "update not allowed" do | ||
travel_to "2024-01-01" | ||
basket = memberships(:john).baskets.first | ||
|
||
login(members(:john)) | ||
assert_includes menu_nav, "Deliveries\n" + "⤷ 1 April 2024" | ||
click_on "Deliveries" | ||
|
||
within "#basket_#{basket.id}" do | ||
assert_no_link "Edit" | ||
end | ||
end | ||
end |
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,36 @@ | ||
# frozen_string_literal: true | ||
|
||
require "application_system_test_case" | ||
|
||
class Members::BillingTest < ApplicationSystemTestCase | ||
test "list open invoices" do | ||
login(members(:martha)) | ||
invoice = invoices(:annual_fee) | ||
|
||
visit "/billing" | ||
|
||
assert_text "Billing\n⤷ 1 open invoice" | ||
assert_text "1 open invoice" | ||
assert_text "01.04.24Open invoice ##{invoice.id} (Annual fee) CHF 30.00" | ||
assert_text "Amount remaining to be paidCHF 30.00" | ||
assert_text "Payment intervalAnnual" | ||
end | ||
|
||
test "list invoices and payments history" do | ||
travel_to "2024-05-01" | ||
member = members(:john) | ||
memberships(:john).update!(billing_year_division: 4) | ||
login(member) | ||
invoice = invoices(:other_closed) | ||
create_payment(amount: 42) | ||
|
||
visit "/billing" | ||
|
||
assert_text "History" | ||
assert_text "CreditCHF 42.00" | ||
assert_text "Payment intervalQuarterly" | ||
assert_text "01.05.24Payment without reference-CHF 42.00" | ||
assert_text "02.04.24Payment of invoice #901871612-CHF 10.00" | ||
assert_text "01.04.24Invoice ##{invoice.id} (Other) CHF 10.00" | ||
end | ||
end |