title: How to test the broadcast made to a channel from different channel or controller?
body: <p>I have a driver channel which broadcasts their location to a vendor channel.</p>
  
  <pre><code>defmodule MyApp.DriverChannel do
      #...
  
      def handle_in("transmit", payload, socket) do
        MyApp.Endpoint.broadcast! "vendors:lobby", "track", payload
        {:noreply, socket}
      end
  end
  
  defmodule MyApp.DriverChannelTest do
  
    #....
  
    test "location broadcasts to vendors:lobby", %{socket: socket} do
      push socket, "transmit", %{"hello" =&gt; "all"}
      assert_broadcast "track", %{"hello" =&gt; "all"}
      # Want something like this
      # assert_broadcast "vendors:lobby", "track", %{"hello" =&gt; "all"}
    end
  
  end
  </code></pre>
  
  <p>This assertion would fail, as it only checks the broadcast from <code>DriverChannel</code>, how to assert the broadcast made to <code>VendorChannel</code>, I looked through the source code, it seems like there is no option to pass a <code>channel_name</code> to <code>assert_broadcast</code> macro. </p>
  
  <p>[ Another note] I also have broadcast made from controllers, if I know answer to this, I could also assert those broadcasts too! :)</p>