mirror of
https://github.com/benbusby/farside.git
synced 2025-03-15 03:36:33 -04:00
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:
parent
d7a425509e
commit
e87973c5e5
2
mix.exs
2
mix.exs
@ -1,4 +1,4 @@
|
||||
defmodule RouterExample.MixProject do
|
||||
defmodule PrivacyRevolver.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
def project do
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user