zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

commit 3786ca5367e5afe240516f3165a124aae43b4c47
parent ed9e4ba1e05ca818866ed418ccfbe748863eecc3
Author: srfsh <dev@srf.sh>
Date:   Thu, 17 Nov 2022 17:59:52 +0300

ZenflowsTest.VF.EconomicEvent.Domain: simplify Decimal.new/1 calls
Since integers are okay to be passed at is, we don't have to parse strings.

Diffstat:
Mtest/vf/economic_event/domain.test.exs | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/vf/economic_event/domain.test.exs b/test/vf/economic_event/domain.test.exs @@ -1181,10 +1181,10 @@ describe "`create/2` with transferAllRights:" do err = "the transfer-all-rights events need container resources to have positive accounting-quantity" res = EconomicResource.Domain.one!(params.resource_inventoried_as_id) - Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new("0.0")) |> Repo.update!() + Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new(0)) |> Repo.update!() assert {:error, ^err} = Domain.create(params) - Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new("-1.0")) |> Repo.update!() + Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new(-1)) |> Repo.update!() assert {:error, ^err} = Domain.create(params) end @@ -1467,11 +1467,11 @@ describe "`create/2` with transfer:" do err = "the transfer events need container resources to have positive accounting-quantity" res = EconomicResource.Domain.one!(params.resource_inventoried_as_id) - Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new("0.0")) + Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new(0)) |> Repo.update!() assert {:error, ^err} = Domain.create(params) - Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new("-1.0")) |> Repo.update!() + Changeset.change(res, accounting_quantity_has_numerical_value: Decimal.new(-1)) |> Repo.update!() assert {:error, ^err} = Domain.create(params) end @@ -1480,11 +1480,11 @@ describe "`create/2` with transfer:" do err = "the transfer events need container resources to have positive onhand-quantity" res = EconomicResource.Domain.one!(params.resource_inventoried_as_id) - Changeset.change(res, onhand_quantity_has_numerical_value: Decimal.new("0.0")) + Changeset.change(res, onhand_quantity_has_numerical_value: Decimal.new(0)) |> Repo.update!() assert {:error, ^err} = Domain.create(params) - Changeset.change(res, onhand_quantity_has_numerical_value: Decimal.new("-1.0")) + Changeset.change(res, onhand_quantity_has_numerical_value: Decimal.new(-1)) |> Repo.update!() assert {:error, ^err} = Domain.create(params) end