channel_case.ex 962 B

12345678910111213141516171819202122232425262728293031323334
  1. defmodule FourlettersWeb.ChannelCase do
  2. @moduledoc """
  3. This module defines the test case to be used by
  4. channel tests.
  5. Such tests rely on `Phoenix.ChannelTest` and also
  6. import other functionality to make it easier
  7. to build common data structures and query the data layer.
  8. Finally, if the test case interacts with the database,
  9. we enable the SQL sandbox, so changes done to the database
  10. are reverted at the end of every test. If you are using
  11. PostgreSQL, you can even run database tests asynchronously
  12. by setting `use FourlettersWeb.ChannelCase, async: true`, although
  13. this option is not recommended for other databases.
  14. """
  15. use ExUnit.CaseTemplate
  16. using do
  17. quote do
  18. # Import conveniences for testing with channels
  19. import Phoenix.ChannelTest
  20. import FourlettersWeb.ChannelCase
  21. # The default endpoint for testing
  22. @endpoint FourlettersWeb.Endpoint
  23. end
  24. end
  25. setup _tags do
  26. :ok
  27. end
  28. end