Height in feet doesn't need decimal precision. Migrates the DB column, updates schema type, and strips trailing .0 from form input so the integer cast succeeds.
23 lines
503 B
Elixir
23 lines
503 B
Elixir
defmodule Microwaveprop.BeaconsFixtures do
|
|
@moduledoc """
|
|
Test helpers for creating beacon records.
|
|
"""
|
|
|
|
alias Microwaveprop.Beacons
|
|
|
|
def valid_beacon_attrs(attrs \\ %{}) do
|
|
Enum.into(attrs, %{
|
|
frequency_mhz: 10_368.1,
|
|
callsign: "W5HN",
|
|
lat: 32.897,
|
|
lon: -97.038,
|
|
power_mw: 10_000.0,
|
|
height_ft: 100
|
|
})
|
|
end
|
|
|
|
def beacon_fixture(user, attrs \\ %{}) do
|
|
{:ok, beacon} = Beacons.create_beacon(user, valid_beacon_attrs(attrs))
|
|
beacon
|
|
end
|
|
end
|