Skip to content

Conversation

@Gigitsu
Copy link
Contributor

@Gigitsu Gigitsu commented Apr 10, 2020

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.

@ream88
Copy link
Collaborator

ream88 commented Apr 20, 2020

I like this, @MSch what do you think?

@ream88 ream88 requested a review from MSch April 20, 2020 13:17
@ream88 ream88 merged commit 8e4b4d8 into PSPDFKit-labs:master Jun 4, 2020
@ream88 ream88 mentioned this pull request Jun 4, 2020
11 tasks
albertored added a commit to athonet-open/bypass that referenced this pull request Apr 17, 2023
…metricRoute"

This reverts commit 8e4b4d8, reversing
changes made to edf2d9b.
albertored added a commit to athonet-open/bypass that referenced this pull request May 27, 2025
…metricRoute"

This reverts commit 8e4b4d8, reversing
changes made to edf2d9b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants