budget/test/system/credit_card_bills_test.rb

44 lines
1.2 KiB
Ruby
Raw Permalink Normal View History

2023-02-24 19:08:12 -05:00
require "application_system_test_case"
2023-03-03 18:12:59 -05:00
class CreditCardBillsTest < ApplicationSystemTestCase
2023-02-24 19:08:12 -05:00
setup do
2023-03-03 18:12:59 -05:00
@credit_card_bill = credit_card_bills(:one)
2023-02-24 19:08:12 -05:00
end
test "visiting the index" do
2023-03-03 18:12:59 -05:00
visit credit_card_bills_url
assert_selector "h1", text: "Credit card bills"
2023-02-24 19:08:12 -05:00
end
2023-03-03 18:12:59 -05:00
test "should create credit card bill" do
visit credit_card_bills_url
click_on "New credit card bill"
2023-02-24 19:08:12 -05:00
2023-03-03 18:12:59 -05:00
fill_in "Amount", with: @credit_card_bill.amount
fill_in "Description", with: @credit_card_bill.description
click_on "Create Credit card bill"
2023-02-24 19:08:12 -05:00
2023-03-03 18:12:59 -05:00
assert_text "Credit card bill was successfully created"
2023-02-24 19:08:12 -05:00
click_on "Back"
end
2023-03-03 18:12:59 -05:00
test "should update Credit card bill" do
visit credit_card_bill_url(@credit_card_bill)
click_on "Edit this credit card bill", match: :first
2023-02-24 19:08:12 -05:00
2023-03-03 18:12:59 -05:00
fill_in "Amount", with: @credit_card_bill.amount
fill_in "Description", with: @credit_card_bill.description
click_on "Update Credit card bill"
2023-02-24 19:08:12 -05:00
2023-03-03 18:12:59 -05:00
assert_text "Credit card bill was successfully updated"
2023-02-24 19:08:12 -05:00
click_on "Back"
end
2023-03-03 18:12:59 -05:00
test "should destroy Credit card bill" do
visit credit_card_bill_url(@credit_card_bill)
click_on "Destroy this credit card bill", match: :first
2023-02-24 19:08:12 -05:00
2023-03-03 18:12:59 -05:00
assert_text "Credit card bill was successfully destroyed"
2023-02-24 19:08:12 -05:00
end
end