Last active
December 15, 2017 01:10
-
-
Save goughjt/00f1290fe39101226ea4b7195829a8cd to your computer and use it in GitHub Desktop.
A default auto-generated room_channel_test.exs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule MyAppServerWeb.RoomChannelTest do | |
use MyAppServerWeb.ChannelCase | |
alias MyAppServerWeb.RoomChannel | |
# if I uncomment this then alchemist-help-search-at-point does work on "socket" | |
# use Phoenix.ChannelTest | |
setup do | |
{:ok, _, socket} = | |
# alchemist-help-search-at-point does not work on "socket" | |
socket("user_id", %{some: :assign}) | |
|> subscribe_and_join(RoomChannel, "room:lobby") | |
{:ok, socket: socket} | |
end | |
test "ping replies with status ok", %{socket: socket} do | |
ref = push socket, "ping", %{"hello" => "there"} | |
assert_reply ref, :ok, %{"hello" => "there"} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment