mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-11 09:32:51 +00:00
figuring out testing - works pretty good so far
This commit is contained in:
14
test/myapp_web/controllers/user_controller_test.exs
Normal file
14
test/myapp_web/controllers/user_controller_test.exs
Normal file
@@ -0,0 +1,14 @@
|
||||
defmodule MyAppWeb.UserControllerTest do
|
||||
use MyAppWeb.ConnCase, async: true
|
||||
|
||||
test "get user index should return unauthorized" do
|
||||
conn =
|
||||
build_conn()
|
||||
|> get("/api/user")
|
||||
|
||||
body = conn |> response(401) |> Poison.decode!
|
||||
|
||||
assert body["error"]["message"] == "unauthorized"
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user