 
   defp join_the_retro_channel(context) do
     retro = context[:retro]
-    { :ok, _, socket } =
-      socket("", %{ user_token: Phoenix.Token.sign(socket(), "user", @mock_user) })
+    {:ok, _, socket} =
+      socket("", %{user_token: Phoenix.Token.sign(socket(), "user", @mock_user)})
       |> subscribe_and_join(RetroChannel, "retro:" <> retro.id)
 
     Map.put(context, :socket, socket)


  describe "pushing a new idea to the socket" do
    setup [:join_the_retro_channel]
    test "results in the broadcast of the new idea to all connected clients", %{ socket: socket } do
      push(socket, "new_idea", %{ category: "happy", body: "we're pacing well", author: "Travis" })

      assert_broadcast("new_idea_received", %{ category: "happy", body: "we're pacing well", id: _, author: "Travis" })
    end
  end


  describe "joining a retro that already has a persisted idea" do
    setup [:persist_idea_for_retro, :join_the_retro_channel]

    @tag idea: %Idea{category: "sad", body: "WIP commits on master", author: "Travis"}
    test "results in the assignment of all of those ideas to the socket", %{socket: socket} do
      assert length(socket.assigns.ideas) == 1

      sole_existing_idea = List.first(socket.assigns.ideas)

      assert %{body: "WIP commits on master", category: "sad", author: "Travis", retro_id: _, id: _} = sole_existing_idea
    end
  end

