Closed Gigitsu closed 4 years ago
This adds support for parameters in expectation url.
You can define expectation like this:
Bypass.expect_once(bypass, "GET", "/1.1/users/:user_id", fn conn -> user_id = Map.get(conn.params, "user_id) Plug.Conn.resp(conn, 200, ~s<{....}>) end)
and the request client->get("http://localhost:8080/1.1/users/1234") will successfully match the expectation defined above.
client->get("http://localhost:8080/1.1/users/1234")
I like this, @MSch what do you think?
This adds support for parameters in expectation url.
You can define expectation like this:
and the request
client->get("http://localhost:8080/1.1/users/1234")
will successfully match the expectation defined above.