Phoenix/Elixir: How to set the action in a test connection with Plug.Test.conn()?
<p>I wrote a little plug that accepts a list of actions as options. When the action that is currently called is in this list, the plug will behave differently.</p>

<p>For testing this I need to set the action in my unit tests. Is this possible? I didn't find anything in the docs.</p>

<p>This is the short example given in the Docs of Plug.</p>

<pre><code>defmodule MyPlugTest do
  use ExUnit.Case, async: true
  use Plug.Test

  @opts AppRouter.init([])

  test "returns hello world" do
    # Create a test connection
    conn = conn(:get, "/hello")

    # Invoke the plug
    conn = AppRouter.call(conn, @opts)

    # Assert the response and status
    assert conn.state == :sent
    assert conn.status == 200
    assert conn.resp_body == "world"
  end
end
</code></pre>