We wrote this tutorial to be easiest way to learn Phoenix, Ecto and "Channels" with a practical example anyone can follow.
Open the file and change line 6 to: assert html_response(conn, 200) "msg-list" We know that "msg-list" is on the page because that's the id of the ul where our message history is bing displayed.The handle_in function clause which handles the "ping" topic: def handle_in ping payload, socket) do :reply, :ok, payload, socket end Simply replies with the payload you send it, therefore in our test we can use the assert_reply Macro to assert that the ref is equal.Ill paste in our code for sending events.Json form 100 to 50 for this command to work because it's expecting 100 coverage.Then were getting the username from the form And the message from the form.15.2 Create a New File Called coveralls.
Mix w chat, and well install the dependencies.The asterisk is a wildcard, catching any events coming into the water_cooler topic - regardless of the subtopic - and sending them to our WaterCoolerChannel defmodule erSocket do use cket #channels channel "water_cooler ChatWeb.Mix rver, lets give creative live cam chat hd mac it englisch chat online englisch lernen kostenlos a shot." Since we changed the code in /lib/chat_web/templates/page/x ( in section 3, above the page no longer contains the string " Welcome to Phoenix!In this episode lets see how can build a simple chat application with Phoenix using websockets.Open the Chat web app in two separate browser windows : http localhost:4000 ( if your machine only has one browser try using one "incognito" tab ) You should be able to send messages between the two browser windows: Congratulations!
At this point our Chat App already "works"!
Well then append that message to our chatBox.