Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule MockExampleWeb.ExampleControllerTest do
- use MockExampleWeb.ConnCase
- import Mock
- test "MockExamplet.ExampleClient must be ever called", %{conn: conn} do
- with_mock MockExample.ExampleClient, [get_example_data: fn -> {:ok, %{data: "sou um novo retorno"}} end] do
- response =
- conn
- |> get(example_path(conn, :index))
- assert called MockExample.ExampleClient.get_example_data() # <-----
- end
- end
- end
Add Comment
Please, Sign In to add comment