Skip to content

Commit

Permalink
Simplify integration test
Browse files Browse the repository at this point in the history
For now, it's not that easy to sync responses
  • Loading branch information
edgurgel committed Jan 18, 2014
1 parent c0222e1 commit dcf7fed
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/integration/public_channel_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@ defmodule Poxa.Integration.PublicChannelTest do
end
end

test "subscribe and receive events on a public channel", context do
test "subscribe on a public channel", context do
gen_event_pid = context[:gen_event_pid]
pid = context[:pid]

:gen_event.add_handler(gen_event_pid, EchoHandler, self)
PusherClient.subscribe!(pid, "channel")

assert Pusher.trigger("message1", [text: "Hello World!"], "channel") == 200
assert Pusher.trigger("message2", [text: "Hi There!"], "channel") == 200

assert_receive {"channel", "pusher:subscription_succeeded", []}, 1_000
assert_receive {"channel", "message1", [{"text", "Hello World!"}]}, 1_000
assert_receive {"channel", "message2", [{"text", "Hi There!"}]}, 1_000
assert_receive {"channel", "pusher:subscription_succeeded", []}
end
end

0 comments on commit dcf7fed

Please sign in to comment.