airborne 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 974f95ebc76433918713edbe0273a157f0c6e1fa491ec6c40742a02c02fd7bf2
4
- data.tar.gz: d540143ad81c8823600e5e844902c2ed27d79e609efd857e753dae71e40b165a
3
+ metadata.gz: 76027591f241db7b9efd84d1b7218ed94b75aaa6fdc048ae9b19b65ce4d75eee
4
+ data.tar.gz: 680096ee8bfcfbfe892e0500a7f53723666ea69f953d70dc5556b58f27e80bbb
5
5
  SHA512:
6
- metadata.gz: 1514e97580341b263333f6fa869674b2e52f9d1afdd812dc0b54c6d0bc0548ce98a007997bf3a3a0b75a395d2d2cb9724a55e7f532f1323161fddcd8fc4d0680
7
- data.tar.gz: 2ea81d1f6f99f7f41d4f5139f0b0ee88507d8ffecf6148ed32cd960935e5c46a614cfde9f4c68268a834d6898c123fb0d52a741b14d30438c18aaebbc7bd0e06
6
+ metadata.gz: 2f33893ad03e5187642bdd2afbb33d00541018a6d659dce1445d77d041f9da21699b1306a4541e886d29b6013415bbf6de42415a8b43281a1abf66342a634a74
7
+ data.tar.gz: f2a98178ac9c3b96e9008155450bc63b3ee4e97d77fd0e0b494b3b080fa6a2b67569a6f8ef8a31e927dc88e8dcffa9a1c4561956480a8f7bb125d536e9f601a4
@@ -2,7 +2,7 @@ require 'date'
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'airborne'
5
- s.version = '0.3.4'
5
+ s.version = '0.3.5'
6
6
  s.date = Date.today.to_s
7
7
  s.summary = 'RSpec driven API testing framework'
8
8
  s.authors = ['Alex Friedman', 'Seth Pollack']
@@ -7,8 +7,8 @@ module Airborne
7
7
  verify_ssl = options.fetch(:verify_ssl, true)
8
8
  res = if method == :post || method == :patch || method == :put || method == :delete
9
9
  begin
10
- request_body = options[:body].nil? ? '' : options[:body]
11
- request_body = request_body.to_json if is_json_request(headers)
10
+ request_body = options[:body].nil? || options[:body].empty? ? '' : options[:body]
11
+ request_body = request_body.to_json if is_json_request(headers) && !request_body.empty?
12
12
  RestClient::Request.execute(
13
13
  method: method,
14
14
  url: get_url(url),
@@ -1,9 +1,27 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe 'put' do
4
- it 'should allow testing on put requests' do
4
+ it 'should allow testing on put requests w/no body' do
5
+ mock_put('simple_put')
6
+ put '/simple_put'
7
+ expect_json_types(status: :string, someNumber: :int)
8
+ end
9
+
10
+ it 'should allow testing on put requests w/empty body' do
5
11
  mock_put('simple_put')
6
12
  put '/simple_put', {}
7
13
  expect_json_types(status: :string, someNumber: :int)
8
14
  end
15
+
16
+ it 'should allow testing on put requests w/body' do
17
+ mock_put('simple_put')
18
+ put '/simple_put', {:key=>:value}
19
+ expect_json_types(status: :string, someNumber: :int)
20
+ end
21
+
22
+ it 'should allow testing on put requests w/body, empty string' do
23
+ mock_put('simple_put')
24
+ put '/simple_put', ''
25
+ expect_json_types(status: :string, someNumber: :int)
26
+ end
9
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airborne
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Friedman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-04-30 00:00:00.000000000 Z
12
+ date: 2020-07-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  requirements: []
233
- rubygems_version: 3.0.1
233
+ rubygems_version: 3.0.3
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: RSpec driven API testing framework