Guest User

Untitled

a guest
Dec 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. defmodule MockExampleWeb.ExampleControllerTest do
  2. use MockExampleWeb.ConnCase
  3.  
  4. import Mock
  5.  
  6. test "MockExamplet.ExampleClient must be ever called", %{conn: conn} do
  7. with_mock MockExample.ExampleClient, [get_example_data: fn -> {:ok, %{data: "sou um novo retorno"}} end] do
  8. response =
  9. conn
  10. |> get(example_path(conn, :index))
  11.  
  12. assert called MockExample.ExampleClient.get_example_data() # <-----
  13. end
  14. end
  15. end
Add Comment
Please, Sign In to add comment