budget/test/controllers/credit_card_bills_controller_test.rb

49 lines
1.4 KiB
Ruby
Raw Normal View History

2023-03-03 18:12:59 -05:00
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