diff options
author | James Every <devstopfix@gmail.com> | 2020-03-26 15:04:54 +0000 |
---|---|---|
committer | James Every <devstopfix@gmail.com> | 2020-03-26 15:04:54 +0000 |
commit | 86802163b4886a024ecff4c9bc762f17e701b87d (patch) | |
tree | a7e6c1944658aed391e75efc205f97f31c1fba0c | |
parent | Fix race condition in test (diff) |
Docs for Phoenix controller [ci skip]
-rw-r--r-- | README.md | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -58,6 +58,17 @@ For a one shot test, use the helper method: ]} ``` +### Check uploaded files in a Phoenix controller + +You can inspect the file from your controller: + +```elixir +def upload(conn, %{"upload" => %{path: path}}) do + {:ok, [mime_type: _, encoding: _, content: content]} = GenMagic.ApprenticeServer.file(:gen_magic, path) + text(conn, "Received your file containing #{content}") +end +``` + ## Soak test Run an endless cycle to prove that the GenServer is resilient: |