Comments (2)
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
from bypass.
@chulkilee, your solution worked for me! It should be part of the README or documentation.
from bypass.
Related Issues (20)
- Pipe expectations
- Add 'headers' param in expect and expect_once function HOT 1
- Building error with erlang 22 HOT 3
- Update cowlib dependency HOT 3
- Cannot wait (with timeout) for expectations HOT 4
- How to use bypass with Finch? HOT 2
- How to test request timeout with bypass? HOT 2
- Any support for ranch 2.x? HOT 1
- Crash on shutdown in `dispatch_awaiting_callers` HOT 2
- bypass randomly fails with eaddrinuse error
- bypass does not support paths containing ":" HOT 2
- Error initializing bypass HOT 1
- Match on request body HOT 1
- dialyzer issue
- Elixir 1.15 incompatible? HOT 1
- :simple_one_for_one strategy is deprecated HOT 1
- The future of bypass HOT 10
- Multiple expect_once HOT 4
- New release? HOT 5
- Move primary documentation out of the README HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bypass.