Skip to content

Commit

Permalink
Add TriggerEvent integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edgurgel committed May 31, 2015
1 parent 5462605 commit db8e5e8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/integration/trigger_event_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
defmodule Poxa.Integration.TriggerEvent do
use ExUnit.Case, async: true

@moduletag :integration

setup_all do
Application.ensure_all_started(:pusher)
Pusher.configure!("localhost", 8080, "app_id", "app_key", "secret")
:ok
end

test "trigger event returns 200" do
[channel, socket_id] = ["channel", "123.456"]

assert Pusher.trigger("test_event", %{}, channel, socket_id) == 200
end

test "trigger event returns 400 on invalid channel" do
[channel, socket_id] = ["channel:invalid", "123.456"]

assert Pusher.trigger("test_event", %{}, channel, socket_id) == 400
end

test "trigger event returns 400 on invalid socket_id" do
[channel, socket_id] = ["channel", "123456"]

assert Pusher.trigger("test_event", %{}, channel, socket_id) == 400
end
end

0 comments on commit db8e5e8

Please sign in to comment.