Skip to content

Commit

Permalink
More tests about what to encode
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Mar 9, 2018
1 parent e968582 commit 010a2a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/test_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def call env

# TODO: Pork::Error: Missing assertions
# https://travis-ci.org/godfat/rest-core/jobs/105298775
# https://travis-ci.org/godfat/rest-core/jobs/306729633
would 'preserve promise and preserve wrapped call' do
c = json_client
stub_request(:get, 'http://me').to_return(:body => '{"a":"b"}')
Expand Down
7 changes: 5 additions & 2 deletions test/test_json_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
RC::REQUEST_PAYLOAD => RC::Json.encode(request_params))}
end

would 'encode false and nil' do
[[nil, 'null'], [false, 'false'], [true, 'true']].each do |(value, exp)|
[[nil, 'null'],
[false, 'false'],
[true, 'true'],
[{}, '{}']].each do |(value, exp)|
would "encode #{value} as #{exp.inspect}" do
[:post, :put, :patch, :delete].each do |meth|
e = env.merge(RC::REQUEST_METHOD => meth,
RC::REQUEST_PAYLOAD => value)
Expand Down

0 comments on commit 010a2a4

Please sign in to comment.