Skip to content

Commit 9b33aba

Browse files
committed
chore: don't be so stupid, call Plug.Test.conn
1 parent b98704f commit 9b33aba

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

lib/ash_json_api/test/test.ex

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,18 @@ defmodule AshJsonApi.Test do
3737
require ExUnit.Assertions
3838
import ExUnit.Assertions
3939

40-
defp conn(method, path, body \\ nil, opts) do
40+
defp conn(method, path, opts) do
41+
conn(method, path, nil, opts)
42+
end
43+
44+
defp conn(method, path, body, opts) do
4145
case opts[:conn] do
4246
fun when is_function(fun) ->
43-
if is_nil(body) do
44-
conn(method, path)
45-
else
46-
conn(method, path, body)
47-
end
47+
Plug.Test.conn(method, path, body)
4848
|> fun.()
4949

5050
nil ->
51-
if is_nil(body) do
52-
conn(method, path)
53-
else
54-
conn(method, path, body)
55-
end
51+
Plug.Test.conn(method, path, body)
5652

5753
conn ->
5854
conn

0 commit comments

Comments
 (0)