2024-02-05 11:00:40 +11:00
|
|
|
require "test_helper"
|
|
|
|
|
|
|
|
class AccountsControllerTest < ActionDispatch::IntegrationTest
|
|
|
|
setup do
|
2024-02-27 12:43:49 -05:00
|
|
|
sign_in @user = users(:family_admin)
|
2024-03-04 08:31:22 -05:00
|
|
|
@account = accounts(:checking)
|
2024-02-05 11:00:40 +11:00
|
|
|
end
|
|
|
|
|
|
|
|
test "new" do
|
|
|
|
get new_account_path
|
|
|
|
assert_response :ok
|
|
|
|
end
|
|
|
|
|
|
|
|
test "show" do
|
|
|
|
get account_path(@account)
|
|
|
|
assert_response :ok
|
|
|
|
end
|
|
|
|
|
|
|
|
test "create" do
|
|
|
|
assert_difference -> { Account.count }, +1 do
|
|
|
|
post accounts_path, params: { account: { accountable_type: "Account::Credit" } }
|
|
|
|
assert_redirected_to accounts_url
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|