2022-11-20 16:02:41 -05:00
|
|
|
require "application_system_test_case"
|
|
|
|
|
|
|
|
class IncomesTest < ApplicationSystemTestCase
|
|
|
|
setup do
|
2023-11-22 21:41:03 -05:00
|
|
|
@income = incomes(:included_1)
|
2022-11-20 16:02:41 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
test "visiting the index" do
|
|
|
|
visit incomes_url
|
|
|
|
assert_selector "h1", text: "Incomes"
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should create income" do
|
|
|
|
visit incomes_url
|
|
|
|
click_on "New income"
|
|
|
|
|
|
|
|
fill_in "Amount", with: @income.amount
|
|
|
|
fill_in "Description", with: @income.description
|
|
|
|
check "Included" if @income.included
|
2023-07-10 23:09:57 -04:00
|
|
|
select @income.member.name, from: "Member"
|
2022-11-20 16:02:41 -05:00
|
|
|
click_on "Create Income"
|
|
|
|
|
|
|
|
assert_text "Income was successfully created"
|
|
|
|
click_on "Back"
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should update Income" do
|
|
|
|
visit income_url(@income)
|
|
|
|
click_on "Edit this income", match: :first
|
|
|
|
|
|
|
|
fill_in "Amount", with: @income.amount
|
|
|
|
fill_in "Description", with: @income.description
|
|
|
|
check "Included" if @income.included
|
2023-07-10 23:09:57 -04:00
|
|
|
select @income.member.name, from: "Member"
|
2022-11-20 16:02:41 -05:00
|
|
|
click_on "Update Income"
|
|
|
|
|
|
|
|
assert_text "Income was successfully updated"
|
|
|
|
click_on "Back"
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should destroy Income" do
|
|
|
|
visit income_url(@income)
|
|
|
|
click_on "Destroy this income", match: :first
|
|
|
|
|
|
|
|
assert_text "Income was successfully destroyed"
|
|
|
|
end
|
|
|
|
end
|