Repository: phoenixframework/phoenix
Pull request #3021 (2018-08-15 08:54:16)

Update doc link to distillery Phoenix guide.

Gazler: Good spot, thanks. Maybe we should use https://hexdocs.pm/distillery/2.0.0/guides/phoenix_walkthrough.html so that the version is locked, hopefully preventing 404 issues in the future?
Doerge: Good point. On the flipside that has the risk of getting outdated, and it's harder to spot. I.e. the link won't be dead, you will just end up on an outdated version only indicated by a version number somewhere on the page. Not sure which poison is the best?

Patch:
diff --git a/guides/deployment/deployment.md b/guides/deployment/deployment.md
index 2f5e08eea..668f6ac46 100644
--- a/guides/deployment/deployment.md
+++ b/guides/deployment/deployment.md
@@ -8,7 +8,7 @@ When preparing an application for deployment, there are three main steps:
   * Compiling your application assets
   * Starting your server in production
 
-How those are exactly handled depends on your deployment infrastructure. We have included a guide specific to [Heroku](heroku.html), and for anyone not using Heroku, we recommend using [Distillery](https://github.com/bitwalker/distillery) ([guide for using Distillery with Phoenix](https://hexdocs.pm/distillery/use-with-phoenix.html)).
+How those are exactly handled depends on your deployment infrastructure. We have included a guide specific to [Heroku](heroku.html), and for anyone not using Heroku, we recommend using [Distillery](https://github.com/bitwalker/distillery) ([guide for using Distillery with Phoenix](https://hexdocs.pm/distillery/guides/phoenix_walkthrough.html)).
 
 In any case, this chapter provides a general overview of the deployment steps, which will be useful regardless of your infrastructure or if you want to run in production locally.
 
diff --git a/installer/lib/mix/tasks/phx.new.ex b/installer/lib/mix/tasks/phx.new.ex
index b31eb948c..a69b202e2 100644
--- a/installer/lib/mix/tasks/phx.new.ex
+++ b/installer/lib/mix/tasks/phx.new.ex
@@ -12,7 +12,7 @@ defmodule Mix.Tasks.Phx.New do
 
   ## Options
 
-    * `--umbrella` - generate an umbrella application,
+    * `--umbrella` - generate an umbrella project,
       with one application for your domain, and
       a second application for the web interface.
 


Test patch:
diff --git a/test/phoenix/integration/websocket_channels_test.exs b/test/phoenix/integration/websocket_channels_test.exs
index d8beb881e..9e4f7ddd0 100644
--- a/test/phoenix/integration/websocket_channels_test.exs
+++ b/test/phoenix/integration/websocket_channels_test.exs
@@ -19,6 +19,10 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
     pubsub: [adapter: Phoenix.PubSub.PG2, name: __MODULE__]
   ])
 
+  defp lobby do
+    "room:lobby#{System.unique_integer()}"
+  end
+
   defmodule RoomChannel do
     use Phoenix.Channel
 
@@ -151,37 +155,38 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
 
       test "join, leave, and event messages" do
         {:ok, sock} = WebsocketClient.start_link(self(), @vsn_path, @serializer)
-        WebsocketClient.join(sock, "room:lobby1", %{})
+        lobby = lobby()
+        WebsocketClient.join(sock, lobby, %{})
 
         assert_receive %Message{event: "phx_reply",
                                 join_ref: @join_ref,
                                 payload: %{"response" => %{}, "status" => "ok"},
-                                ref: "1", topic: "room:lobby1"}
+                                ref: "1", topic: ^lobby}
 
         assert_receive %Message{event: "joined",
                                 payload: %{"status" => "connected", "user_id" => nil}}
         assert_receive %Message{event: "user_entered",
                                 payload: %{"user" => nil},
-                                ref: nil, topic: "room:lobby1"}
+                                ref: nil, topic: ^lobby}
 
-        channel_pid = Process.whereis(:"room:lobby1")
+        channel_pid = Process.whereis(String.to_atom(lobby))
         assert channel_pid
         assert Process.alive?(channel_pid)
 
-        WebsocketClient.send_event(sock, "room:lobby1", "new_msg", %{body: "hi!"})
+        WebsocketClient.send_event(sock, lobby, "new_msg", %{body: "hi!"})
         assert_receive %Message{event: "new_msg", payload: %{"transport" => ":websocket", "body" => "hi!"}}
 
-        WebsocketClient.leave(sock, "room:lobby1", %{})
+        WebsocketClient.leave(sock, lobby, %{})
         assert_receive %Message{event: "you_left", payload: %{"message" => "bye!"}}
         assert_receive %Message{event: "phx_reply", payload: %{"status" => "ok"}}
         assert_receive %Message{event: "phx_close", payload: %{}}
         refute Process.alive?(channel_pid)
 
-        WebsocketClient.send_event(sock, "room:lobby1", "new_msg", %{body: "Should ignore"})
+        WebsocketClient.send_event(sock, lobby, "new_msg", %{body: "Should ignore"})
         refute_receive %Message{event: "new_msg"}
         assert_receive %Message{event: "phx_reply", payload: %{"response" => %{"reason" => "unmatched topic"}}}
 
-        WebsocketClient.send_event(sock, "room:lobby1", "new_msg", %{body: "Should ignore"})
+        WebsocketClient.send_event(sock, lobby, "new_msg", %{body: "Should ignore"})
         refute_receive %Message{event: "new_msg"}
       end
 
@@ -195,7 +200,7 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
             extra_headers
           )
 
-        WebsocketClient.join(sock, "room:lobby1", %{})
+        WebsocketClient.join(sock, lobby(), %{})
 
         assert_receive %Message{event: "joined",
                                 payload: %{"connect_info" =>
@@ -211,7 +216,7 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
             @serializer
           )
 
-        WebsocketClient.join(sock, "room:lobby1", %{})
+        WebsocketClient.join(sock, lobby(), %{})
 
         assert_receive %Message{event: "joined",
                                 payload: %{"connect_info" =>
@@ -228,7 +233,7 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
             "ws://127.0.0.1:#{@port}/ws/connect_info/websocket?vsn=#{@vsn}",
             @serializer
           )
-        WebsocketClient.join(sock, "room:lobby1", %{})
+        WebsocketClient.join(sock, lobby(), %{})
 
         assert_receive %Message{event: "joined",
                                 payload: %{"connect_info" =>
@@ -262,24 +267,27 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
       test "sends phx_error if a channel server abnormally exits" do
         {:ok, sock} = WebsocketClient.start_link(self(), @vsn_path, @serializer)
 
-        WebsocketClient.join(sock, "room:lobby", %{})
+        lobby = lobby()
+        WebsocketClient.join(sock, lobby, %{})
         assert_receive %Message{event: "phx_reply", ref: "1", payload: %{"response" => %{}, "status" => "ok"}}
         assert_receive %Message{event: "joined"}
         assert_receive %Message{event: "user_entered"}
 
         capture_log fn ->
-          WebsocketClient.send_event(sock, "room:lobby", "boom", %{})
-          assert_receive %Message{event: "phx_error", payload: %{}, topic: "room:lobby"}
+          WebsocketClient.send_event(sock, lobby, "boom", %{})
+          assert_receive %Message{event: "phx_error", payload: %{}, topic: ^lobby}
         end
       end
 
       test "channels are terminated if transport normally exits" do
         {:ok, sock} = WebsocketClient.start_link(self(), @vsn_path, @serializer)
 
-        WebsocketClient.join(sock, "room:lobby2", %{})
+        lobby = lobby()
+        WebsocketClient.join(sock, lobby, %{})
         assert_receive %Message{event: "phx_reply", ref: "1", payload: %{"response" => %{}, "status" => "ok"}}
         assert_receive %Message{event: "joined"}
-        channel = Process.whereis(:"room:lobby2")
+
+        channel = Process.whereis(String.to_atom(lobby))
         assert channel
         Process.monitor(channel)
         WebsocketClient.close(sock)
@@ -290,11 +298,11 @@ defmodule Phoenix.Integration.WebSocketChannelsTest do
       test "refuses websocket events that haven't joined" do
         {:ok, sock} = WebsocketClient.start_link(self(), @vsn_path, @serializer)
 
-        WebsocketClient.send_event(sock, "room:lobby", "new_msg", %{body: "hi!"})
+        WebsocketClient.send_event(sock, lobby(), "new_msg", %{body: "hi!"})
         refute_receive %Message{event: "new_msg"}
         assert_receive %Message{event: "phx_reply", payload: %{"response" => %{"reason" => "unmatched topic"}}}
 
-        WebsocketClient.send_event(sock, "room:lobby1", "new_msg", %{body: "Should ignore"})
+        WebsocketClient.send_event(sock, lobby(), "new_msg", %{body: "Should ignore"})
         refute_receive %Message{event: "new_msg"}
       end