-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query string in the URL fails with Route error #55
Comments
bypass accepts "path", not with query string. See https://github.com/PSPDFKit-labs/bypass/blob/v0.8.1/lib/bypass.ex#L111 from https://github.com/chulkilee/ex_force/blob/v0.1.0/test/ex_force_test.exs#L241 test "get_sobject with fields", %{bypass: bypass} do
Bypass.expect_once(bypass, "GET", "/services/data/v40.0/sobjects/Account/foo", fn conn ->
%{"fields" => "Name,Site"} = URI.decode_query(conn.query_string)
resp_body = """
{
"attributes": {
"type": "Account",
"url": "/services/data/v40.0/sobjects/Account/foo"
},
"Id": "foo",
"Name": "name",
"Site": null
}
"""
conn
|> Conn.put_resp_content_type("application/json")
|> Conn.resp(200, resp_body)
end)
{:ok, got} = ExForce.get_sobject("foo", "Account", ["Name", "Site"], dummy_config(bypass))
assert got == %SObject{
id: "foo",
type: "Account",
data: %{"Id" => "foo", "Name" => "name", "Site" => nil}
}
end |
@chulkilee, your solution worked for me! It should be part of the README or documentation. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If testing a URL like
/foo.json?bar=baz&doo=1
this fails with:However just
/foo.json
will work.The text was updated successfully, but these errors were encountered: