mirror of
https://github.com/benbusby/farside.git
synced 2025-04-20 02:48:42 +00: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 changed files with 14 additions and 4 deletions
2
mix.exs
2
mix.exs
|
@ -1,4 +1,4 @@
|
||||||
defmodule RouterExample.MixProject do
|
defmodule PrivacyRevolver.MixProject do
|
||||||
use Mix.Project
|
use Mix.Project
|
||||||
|
|
||||||
def project do
|
def project do
|
||||||
|
|
|
@ -1,8 +1,18 @@
|
||||||
defmodule PrivacyRevolverTest do
|
defmodule PrivacyRevolverTest do
|
||||||
use ExUnit.Case
|
use ExUnit.Case
|
||||||
doctest PrivacyRevolver
|
use Plug.Test
|
||||||
|
|
||||||
test "greets the world" do
|
alias PrivacyRevolver.Router
|
||||||
assert PrivacyRevolver.hello() == :world
|
|
||||||
|
@opts Router.init([])
|
||||||
|
|
||||||
|
test "/" do
|
||||||
|
conn =
|
||||||
|
:get
|
||||||
|
|> conn("/", "")
|
||||||
|
|> Router.call(@opts)
|
||||||
|
|
||||||
|
assert conn.state == :sent
|
||||||
|
assert conn.status == 200
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue