Skip to content

Testing Subscriptions #11

@acrogenesis

Description

@acrogenesis

I'm having trouble updating the SubscriptionCase the absinthe book uses for testing the subscriptions. How are you testing your subscriptions?

06-chp.subscriptions/4-publish/test/support/subscription_case.ex

defmodule PlateSlateWeb.SubscriptionCase do
  @moduledoc """
  This module defines the test case to be used by
  subscription tests
  """

  use ExUnit.CaseTemplate

  using do
    quote do
      # Import conveniences for testing with channels
      use PlateSlateWeb.ChannelCase
      use Absinthe.Phoenix.SubscriptionTest, schema: PlateSlateWeb.Schema
      import Plug.Conn
      import Phoenix.ConnTest

      setup do
        {:ok, socket} =
          Phoenix.ChannelTest.connect(
            PlateSlateWeb.UserSocket,
            Application.get_env(:valiot_app, :token_helper).header
          )

        {:ok, socket} = Absinthe.Phoenix.SubscriptionTest.join_absinthe(socket)

        {:ok, socket: socket}
      end
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions