Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. defmodule MyPlugTest do
  2. use ExUnit.Case, async: true
  3. use Plug.Test
  4.  
  5. @opts AppRouter.init([])
  6.  
  7. test "returns hello world" do
  8. # Create a test connection
  9. conn = conn(:get, "/hello")
  10.  
  11. # Invoke the plug
  12. conn = AppRouter.call(conn, @opts)
  13.  
  14. # Assert the response and status
  15. assert conn.state == :sent
  16. assert conn.status == 200
  17. assert conn.resp_body == "world"
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement