Move extra bills to credit cards

This commit is contained in:
Andrew Tomaka 2023-03-03 18:12:59 -05:00
parent c14a408f9a
commit 0887a5f6b9
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
38 changed files with 242 additions and 251 deletions

View file

@ -0,0 +1,48 @@
require "test_helper"
class CreditCardBillsControllerTest < ActionDispatch::IntegrationTest
setup do
@credit_card_bill = credit_card_bills(:one)
end
test "should get index" do
get credit_card_bills_url
assert_response :success
end
test "should get new" do
get new_credit_card_bill_url
assert_response :success
end
test "should create credit_card_bill" do
assert_difference("CreditCardBill.count") do
post credit_card_bills_url, params: { credit_card_bill: { amount: @credit_card_bill.amount, description: @credit_card_bill.description } }
end
assert_redirected_to credit_card_bill_url(CreditCardBill.last)
end
test "should show credit_card_bill" do
get credit_card_bill_url(@credit_card_bill)
assert_response :success
end
test "should get edit" do
get edit_credit_card_bill_url(@credit_card_bill)
assert_response :success
end
test "should update credit_card_bill" do
patch credit_card_bill_url(@credit_card_bill), params: { credit_card_bill: { amount: @credit_card_bill.amount, description: @credit_card_bill.description } }
assert_redirected_to credit_card_bill_url(@credit_card_bill)
end
test "should destroy credit_card_bill" do
assert_difference("CreditCardBill.count", -1) do
delete credit_card_bill_url(@credit_card_bill)
end
assert_redirected_to credit_card_bills_url
end
end

View file

@ -17,7 +17,7 @@ class ExpensesControllerTest < ActionDispatch::IntegrationTest
test "should create expense" do
assert_difference("Expense.count") do
post expenses_url, params: { expense: { autopaid: @expense.autopaid, description: @expense.description, estimated: @expense.estimated, payment: @expense.payment, period: @expense.period } }
post expenses_url, params: { expense: { credit_card: @expense.credit_card, description: @expense.description, estimated: @expense.estimated, payment: @expense.payment, period: @expense.period } }
end
assert_redirected_to expense_url(Expense.last)
@ -34,7 +34,7 @@ class ExpensesControllerTest < ActionDispatch::IntegrationTest
end
test "should update expense" do
patch expense_url(@expense), params: { expense: { autopaid: @expense.autopaid, description: @expense.description, estimated: @expense.estimated, payment: @expense.payment, period: @expense.period } }
patch expense_url(@expense), params: { expense: { credit_card: @expense.credit_card, description: @expense.description, estimated: @expense.estimated, payment: @expense.payment, period: @expense.period } }
assert_redirected_to expense_url(@expense)
end

View file

@ -1,48 +0,0 @@
require "test_helper"
class ExtraBillsControllerTest < ActionDispatch::IntegrationTest
setup do
@extra_bill = extra_bills(:one)
end
test "should get index" do
get extra_bills_url
assert_response :success
end
test "should get new" do
get new_extra_bill_url
assert_response :success
end
test "should create extra_bill" do
assert_difference("ExtraBill.count") do
post extra_bills_url, params: { extra_bill: { amount: @extra_bill.amount, deduct_autopaid: @extra_bill.deduct_autopaid, description: @extra_bill.description } }
end
assert_redirected_to extra_bill_url(ExtraBill.last)
end
test "should show extra_bill" do
get extra_bill_url(@extra_bill)
assert_response :success
end
test "should get edit" do
get edit_extra_bill_url(@extra_bill)
assert_response :success
end
test "should update extra_bill" do
patch extra_bill_url(@extra_bill), params: { extra_bill: { amount: @extra_bill.amount, deduct_autopaid: @extra_bill.deduct_autopaid, description: @extra_bill.description } }
assert_redirected_to extra_bill_url(@extra_bill)
end
test "should destroy extra_bill" do
assert_difference("ExtraBill.count", -1) do
delete extra_bill_url(@extra_bill)
end
assert_redirected_to extra_bills_url
end
end