48 lines
1.3 KiB
Ruby
48 lines
1.3 KiB
Ruby
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
|