Skip to content

Commit

Permalink
Add page home controller test
Browse files Browse the repository at this point in the history
  • Loading branch information
nmenag committed Mar 29, 2024
1 parent 9b37aa2 commit 2ed9bc9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/web/lib/web/controllers/home/page_json.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Web.Home.PageJSON do
@doc """
Renders a single user.
"""
def show(params) do
params
def show(%{status: status}) do
%{status: status}
end
end
12 changes: 12 additions & 0 deletions apps/web/test/web/controllers/page_controller_test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defmodule Web.PageControllerTest do
use ExUnit.Case
use Core.DataCase
use Web.ConnCase

describe "show/2" do
test "return ok", %{conn: conn} do
conn = conn |> put_req_header("accept", "application/json") |> get(~p"/api")
assert json_response(conn, 200)
end
end
end

0 comments on commit 2ed9bc9

Please sign in to comment.