replace ammo added on with purchased on

This commit is contained in:
2022-11-19 14:52:01 -05:00
parent bf0ea4168b
commit dfebad713f
37 changed files with 402 additions and 304 deletions

View File

@ -224,9 +224,22 @@ defmodule Cannery.AmmoTest do
end
describe "ammo_groups" do
@valid_attrs %{"count" => 42, "notes" => "some notes", "price_paid" => 120.5}
@update_attrs %{"count" => 43, "notes" => "some updated notes", "price_paid" => 456.7}
@invalid_attrs %{"count" => nil, "notes" => nil, "price_paid" => nil}
@valid_attrs %{
"count" => 42,
"notes" => "some notes",
"price_paid" => 120.5,
"purchased_on" => ~D[2022-11-19]
}
@update_attrs %{
"count" => 43,
"notes" => "some updated notes",
"price_paid" => 456.7
}
@invalid_attrs %{
"count" => nil,
"notes" => nil,
"price_paid" => nil
}
setup do
current_user = user_fixture()

View File

@ -133,7 +133,8 @@ defmodule Cannery.Fixtures do
|> Enum.into(%{
"ammo_type_id" => ammo_type_id,
"container_id" => container_id,
"count" => 20
"count" => 20,
"purchased_on" => Date.utc_today()
})
|> Ammo.create_ammo_groups(multiplier, user)
|> unwrap_ok_tuple()