The personal finance app for everyone
Added Decimal Support in min transaction (#1681)
Harshit Chaudharyeabfb7aae151
diff --git a/app/views/credit_cards/_form.html.erb b/app/views/credit_cards/_form.html.erbindex ff9e7582..2405b77b 100644--- a/app/views/credit_cards/_form.html.erb+++ b/app/views/credit_cards/_form.html.erb@@ -13,10 +13,11 @@</div><div class="flex items-center gap-2">- <%= credit_card_form.number_field :minimum_payment,+ <%= credit_card_form.money_field :minimum_payment,label: t("credit_cards.form.minimum_payment"),placeholder: t("credit_cards.form.minimum_payment_placeholder"),- min: 0 %>+ default_currency: Current.family.currency %>+<%= credit_card_form.number_field :apr,label: t("credit_cards.form.apr"),placeholder: t("credit_cards.form.apr_placeholder"),diff --git a/test/controllers/credit_cards_controller_test.rb b/test/controllers/credit_cards_controller_test.rbindex 8c119e8b..6d475a73 100644--- a/test/controllers/credit_cards_controller_test.rb+++ b/test/controllers/credit_cards_controller_test.rb@@ -21,7 +21,7 @@ class CreditCardsControllerTest < ActionDispatch::IntegrationTestaccountable_type: "CreditCard",accountable_attributes: {available_credit: 5000,- minimum_payment: 25,+ minimum_payment: 25.51,apr: 15.99,expiration_date: 2.years.from_now.to_date,annual_fee: 99@@ -36,7 +36,7 @@ class CreditCardsControllerTest < ActionDispatch::IntegrationTestassert_equal 1000, created_account.balanceassert_equal "USD", created_account.currencyassert_equal 5000, created_account.accountable.available_credit- assert_equal 25, created_account.accountable.minimum_payment+ assert_equal 25.51, created_account.accountable.minimum_paymentassert_equal 15.99, created_account.accountable.aprassert_equal 2.years.from_now.to_date, created_account.accountable.expiration_dateassert_equal 99, created_account.accountable.annual_feediff --git a/test/system/accounts_test.rb b/test/system/accounts_test.rbindex 9ce77814..334d185d 100644--- a/test/system/accounts_test.rb+++ b/test/system/accounts_test.rb@@ -50,7 +50,7 @@ class AccountsTest < ApplicationSystemTestCasetest "can create credit card account" doassert_account_created "CreditCard" dofill_in "Available credit", with: 1000- fill_in "Minimum payment", with: 25+ fill_in "account[accountable_attributes][minimum_payment]", with: 25.51fill_in "APR", with: 15.25fill_in "Expiration date", with: 1.year.from_now.to_datefill_in "Annual fee", with: 100