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 d506f01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 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
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%{
"absinthe": {:git, "https://github.com/circles-learning-labs/absinthe.git", "d7bddaa17f01b475932ea1e69866a09f478d4726", [branch: "subscription-prime"]},
"absinthe": {:git, "https://github.com/circles-learning-labs/absinthe.git", "96e803ce0c6e1e4b8cbf61468939fc0ba69cf8a4", [branch: "subscription-prime"]},
"absinthe_plug": {:hex, :absinthe_plug, "1.5.0", "018ef544cf577339018d1f482404b4bed762e1b530c78be9de4bbb88a6f3a805", [:mix], [{:absinthe, "~> 1.5.0", [hex: :absinthe, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.2 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "4c160f4ce9a1233a4219a42de946e4e05d0e8733537cd5d8d20e7d4ef8d4b7c7"},
"decimal": {:hex, :decimal, "2.0.0", "a78296e617b0f5dd4c6caf57c714431347912ffb1d0842e998e9792b5642d697", [:mix], [], "hexpm", "34666e9c55dea81013e77d9d87370fe6cb6291d1ef32f46a1600230b1d44f577"},
"earmark": {:hex, :earmark, "1.4.4", "4821b8d05cda507189d51f2caeef370cf1e18ca5d7dfb7d31e9cafe6688106a4", [:mix], [], "hexpm", "1f93aba7340574847c0f609da787f0d79efcab51b044bb6e242cae5aca9d264d"},
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 d506f01

Please sign in to comment.