Add extra bills tracking

This commit is contained in:
Andrew Tomaka 2023-02-24 19:08:12 -05:00
parent a21639ff6f
commit 63487a9cba
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
22 changed files with 353 additions and 3 deletions

View file

@ -0,0 +1,45 @@
require "application_system_test_case"
class ExtraBillsTest < ApplicationSystemTestCase
setup do
@extra_bill = extra_bills(:one)
end
test "visiting the index" do
visit extra_bills_url
assert_selector "h1", text: "Extra bills"
end
test "should create extra bill" do
visit extra_bills_url
click_on "New extra bill"
fill_in "Amount", with: @extra_bill.amount
check "Deduct autopaid" if @extra_bill.deduct_autopaid
fill_in "Description", with: @extra_bill.description
click_on "Create Extra bill"
assert_text "Extra bill was successfully created"
click_on "Back"
end
test "should update Extra bill" do
visit extra_bill_url(@extra_bill)
click_on "Edit this extra bill", match: :first
fill_in "Amount", with: @extra_bill.amount
check "Deduct autopaid" if @extra_bill.deduct_autopaid
fill_in "Description", with: @extra_bill.description
click_on "Update Extra bill"
assert_text "Extra bill was successfully updated"
click_on "Back"
end
test "should destroy Extra bill" do
visit extra_bill_url(@extra_bill)
click_on "Destroy this extra bill", match: :first
assert_text "Extra bill was successfully destroyed"
end
end