fieldview 0.0.3 → 0.0.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
  SHA1:
3
- metadata.gz: e0b4d597a39d0a0c0833ea45cd5d5abf2374743a
4
- data.tar.gz: d85bc687c56ac861d75633080582841f59b2364d
3
+ metadata.gz: 12d759d08d6454a977dae753a9983a321ba49dd0
4
+ data.tar.gz: 9de183d6a3ec0a79ae300e6556085197e5a3dba8
5
5
  SHA512:
6
- metadata.gz: 61dce5f68747baa88c0272247ddbc2be85467178292f3358a6b7f613be78777e1eddaae0897d53167eb9c358ca9a86c9208cc9da7c5019a5d94c4f31fe445654
7
- data.tar.gz: fc4a4fad66da59753792453d4307950a30f3c51309d176184d9a3270fd227468e58bd3ea09f9f41f1b27e8067c65ef2ccb1b26bec4b137bad494fc794f1a90d7
6
+ metadata.gz: b06dc6f850c20233bb39cb3258e0f37cf80f33f6d5f93ec58f0025f3019f2a7eebd670dfe73bcc07e5e17ce0aefb2d1225fe67a9ebca562b8cac85513ecb1125
7
+ data.tar.gz: 218f4758b114688aabbb854df717e46fded8631127583808197df8cc8962a2ca2bf34c57a1d5536f9e572305cd82d37a8bf5e059df1b936c2d67638574a55e81
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fieldview (0.0.2)
4
+ fieldview (0.0.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -26,21 +26,21 @@ module FieldView
26
26
  FieldView::NEXT_TOKEN_HEADER_KEY => next_token,
27
27
  FieldView::PAGE_LIMIT_HEADER_KEY => limit
28
28
  })
29
+
30
+ Util.verify_response_with_code("Field list", response, 200, 206, 304)
31
+
29
32
  next_token = response.http_headers[FieldView::NEXT_TOKEN_HEADER_KEY]
30
33
 
31
- if (response.http_status == 200 || response.http_status == 206) then
34
+ case response.http_status
35
+ when 200, 206
32
36
  # 206: Partial result, will have more data
33
37
  # 200: When all the results were in the list
34
38
  return_data = response.data[:results]
35
- elsif (response.http_status == 304)
39
+ when 304
36
40
  # 304: Nothing modified since last request
37
41
  return_data = []
38
- else
39
- # This should never happen
40
- raise UnexpectedResponseError.new("Fields list expects 200,206, or 304 for codes",
41
- fieldview_response: response)
42
42
  end
43
-
43
+
44
44
  return ListObject.new(
45
45
  self,
46
46
  auth_token,
@@ -18,7 +18,7 @@ module FieldView
18
18
  params: {
19
19
  "md5" => md5,
20
20
  "length" => content_length,
21
- "content-type" => content_type
21
+ "contentType" => content_type
22
22
  })
23
23
 
24
24
  Util.verify_response_with_code("Upload creation", response, 201)
@@ -1,3 +1,3 @@
1
1
  module FieldView
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.5'
3
3
  end
data/test/test_field.rb CHANGED
@@ -23,6 +23,15 @@ class TestField < Minitest::Test
23
23
  assert_equal FIXTURE[:boundaryId], field.boundary_id
24
24
  assert_equal new_auth_token.access_token, field.auth_token.access_token
25
25
  end
26
+
27
+ def test_list_with_bad_status()
28
+ stub_request(:get, /fields/).
29
+ to_return(status: 207)
30
+
31
+ assert_raises FieldView::UnexpectedResponseError do
32
+ field = FieldView::Field.list(new_auth_token)
33
+ end
34
+ end
26
35
 
27
36
  def test_list_with_one_page()
28
37
  next_token = "AZXJKLA123"
data/test/test_upload.rb CHANGED
@@ -28,7 +28,7 @@ class TestUpload < Minitest::Test
28
28
  with(body: {
29
29
  "md5" => md5,
30
30
  "length" => content_length,
31
- "content-type" => content_type
31
+ "contentType" => content_type
32
32
  }).
33
33
  to_return(status: 201, body: %Q!"#{uuid}"!)
34
34
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fieldview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Susmarski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ' FieldView is used to make data-driven decisions to maximize your return
14
14
  on every acre. This Ruby Gem is provided as a convenient way to access their API.'