mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-21 15:41:00 +00:00
don't start presence client on tests
This commit is contained in:
parent
028c619047
commit
0bde8f40d6
3 changed files with 8 additions and 6 deletions
|
@ -58,8 +58,6 @@ config :logger, :console,
|
|||
# Use Jason for JSON parsing in Phoenix
|
||||
config :phoenix, :json_library, Jason
|
||||
|
||||
config :live_beats, :presence_client, LiveBeats.PresenceClient
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{config_env()}.exs"
|
||||
|
|
|
@ -31,5 +31,3 @@ config :logger, level: :warn
|
|||
|
||||
# Initialize plugs at runtime for faster test compilation
|
||||
config :phoenix, :plug_init_mode, :runtime
|
||||
|
||||
config :live_beats, :presence_client, Phoenix.Presence.Client.Mock
|
||||
|
|
|
@ -23,8 +23,8 @@ defmodule LiveBeats.Application do
|
|||
LiveBeatsWeb.Endpoint,
|
||||
# Start a worker by calling: LiveBeats.Worker.start_link(arg)
|
||||
# {LiveBeats.Worker, arg}
|
||||
{Phoenix.Presence.Client, client: Application.get_env(:live_beats, :presence_client), pubsub: LiveBeats.PubSub, presence: LiveBeatsWeb.Presence}
|
||||
]
|
||||
|
||||
] ++ start_presence_client(Mix.env)
|
||||
|
||||
# See https://hexdocs.pm/elixir/Supervisor.html
|
||||
# for other strategies and supported options
|
||||
|
@ -39,4 +39,10 @@ defmodule LiveBeats.Application do
|
|||
LiveBeatsWeb.Endpoint.config_change(changed, removed)
|
||||
:ok
|
||||
end
|
||||
|
||||
defp start_presence_client(:test), do: []
|
||||
|
||||
defp start_presence_client(_) do
|
||||
[{Phoenix.Presence.Client, client: LiveBeats.PresenceClient, pubsub: LiveBeats.PubSub, presence: LiveBeatsWeb.Presence, name: PresenceClient}]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue