We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Plug.Test.conn
1 parent b98704f commit 9b33abaCopy full SHA for 9b33aba
lib/ash_json_api/test/test.ex
@@ -37,22 +37,18 @@ defmodule AshJsonApi.Test do
37
require ExUnit.Assertions
38
import ExUnit.Assertions
39
40
- defp conn(method, path, body \\ nil, opts) do
+ defp conn(method, path, opts) do
41
+ conn(method, path, nil, opts)
42
+ end
43
+
44
+ defp conn(method, path, body, opts) do
45
case opts[:conn] do
46
fun when is_function(fun) ->
- if is_nil(body) do
- conn(method, path)
- else
- conn(method, path, body)
47
- end
+ Plug.Test.conn(method, path, body)
48
|> fun.()
49
50
nil ->
51
52
53
54
55
56
57
conn ->
58
conn
0 commit comments