Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardd committed Jun 21, 2022
1 parent fdd08ea commit 8c74f51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/absinthe/phoenix/channel.ex
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ defmodule Absinthe.Phoenix.Channel do
absinthe_config =
Map.put(absinthe_config, :pipeline, pipeline || {__MODULE__, :default_pipeline})

socket =
socket
|> assign(:absinthe, absinthe_config)
socket = socket |> assign(:absinthe, absinthe_config)

{:ok, socket}
end
Expand Down
6 changes: 3 additions & 3 deletions test/absinthe/phoenix_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,16 @@ defmodule Absinthe.PhoenixTest do

assert_reply(ref, :ok, %{subscriptionId: subscription_ref})

Absinthe.Subscription.publish(TestEndpoint, 1, ordinal: "ordinal_topic")
Absinthe.Subscription.publish(Absinthe.Phoenix.TestEndpoint, 1, ordinal: "ordinal_topic")

assert_push("subscription:data", push)
expected = %{result: %{data: %{"ordinal" => 1}, ordinal: 1}, subscriptionId: subscription_ref}
assert expected == push

Absinthe.Subscription.publish(TestEndpoint, 0, ordinal: "ordinal_topic")
Absinthe.Subscription.publish(Absinthe.Phoenix.TestEndpoint, 0, ordinal: "ordinal_topic")
# This message should not generate a notification because it has a lower ordinal

Absinthe.Subscription.publish(TestEndpoint, 2, ordinal: "ordinal_topic")
Absinthe.Subscription.publish(Absinthe.Phoenix.TestEndpoint, 2, ordinal: "ordinal_topic")

assert_push("subscription:data", push)
expected = %{result: %{data: %{"ordinal" => 2}, ordinal: 2}, subscriptionId: subscription_ref}
Expand Down

0 comments on commit 8c74f51

Please sign in to comment.