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
