     pid = self
     new JSEX
     expect(:gproc, :lookup_pids, 1, [pid])
-    expect(JSEX, :encode!, 1, :msg)
-    assert send_message_to_channel(:channel, [], []) == :ok
+    expected = [{"channel", "channel123"}]
+    expect(JSEX, :encode!, [{[expected], :msg}])
+    assert send_message_to_channel("channel123", [], []) == :ok
     assert_receive { ^pid, :msg }
     assert validate :gproc
     assert validate JSEX

    pid = self
    new JSEX
    expect(:gproc, :lookup_pids, 1, [pid])
    expect(JSEX, :encode!, 1, :msg)
    assert send_message_to_channels([:channel], [], nil) == :ok
    assert_receive { ^pid, :msg }
    assert validate :gproc
    assert validate JSEX

  test "sending message to channels excluding a socket id" do
    new JSEX
    expect(:gproc, :lookup_pids, 1, [self])
    expected = [{"channel", "channel123"}]
    expect(JSEX, :encode!, [{[expected], :msg}])
    assert send_message_to_channels(["channel123"], [], "SocketId") == :ok
    assert validate :gproc
    assert validate JSEX
    unload JSEX
