Add basic router test

Obviously going to be expanded upon by quite a bit, but just wanted to
get started with basic testing sooner rather than later.
This commit is contained in:
Ben Busby 2021-10-26 00:23:31 -06:00
parent d7a425509e
commit e87973c5e5
No known key found for this signature in database
GPG key ID: 339B7B7EB5333D14
2 changed files with 14 additions and 4 deletions

View file

@ -1,4 +1,4 @@
defmodule RouterExample.MixProject do
defmodule PrivacyRevolver.MixProject do
use Mix.Project
def project do

View file

@ -1,8 +1,18 @@
defmodule PrivacyRevolverTest do
use ExUnit.Case
doctest PrivacyRevolver
use Plug.Test
test "greets the world" do
assert PrivacyRevolver.hello() == :world
alias PrivacyRevolver.Router
@opts Router.init([])
test "/" do
conn =
:get
|> conn("/", "")
|> Router.call(@opts)
assert conn.state == :sent
assert conn.status == 200
end
end