myjohndeere 0.1.7 → 0.1.8

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: b526cc75a6720846322dc5e9c59edb027d43098d
4
- data.tar.gz: f9441bbe922c914a55e7a425fd7595cfe42a9cb3
3
+ metadata.gz: f6f1396f290f034c7d9bc96100a798d5e3a653e7
4
+ data.tar.gz: f0815526e2742dae974c1ed89745265e60a5a433
5
5
  SHA512:
6
- metadata.gz: 8d57d5d6887707b4d6a2abb31f8213b6cad412f7b2512b54a2b2c5a9f53d1b1805f172fe325a5f692d0f3b31f3cb177115c675102326f012fc367c82a36c3088
7
- data.tar.gz: dd0775f0d88d5ae46970cd5c3849758d9a52c0685a4b4fb7b88bcbac01dc054135bfe93fb1650acff6ee008dc65adcfd97e16f61046971bfe165bb45e8f3ce8a
6
+ metadata.gz: 6e09bf7d4e04d3a9d2b2093fdff043d5653c86d246fe5db098b6fc117db90f111cbf240b99a56f63ef41b81decae090338689843ec953a08ac66b34e283c4d05
7
+ data.tar.gz: ae920d40bdcb973f0fa8ecfe7a5bf3c8185f212c80578a0ccb975f6e1e6925183a63501d4c16a01a71e512766fdd2a28223c744fdead6df105cfbf80dd5fba37
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- myjohndeere (0.1.7)
4
+ myjohndeere (0.1.8)
5
5
  oauth (>= 0.5.3)
6
6
 
7
7
  GEM
@@ -36,9 +36,10 @@ module MyJohnDeere
36
36
 
37
37
  private
38
38
  def find_first_active_boundary(possible_boundaries)
39
- active_boundaries = possible_boundaries.select { |b| b.active && !b.deleted }
39
+ active_boundaries = possible_boundaries.select { |b| b.active && !b.deleted }.
40
+ uniq { |b| b.id }
40
41
  if active_boundaries.count > 1 then
41
- raise MyJohnDeereError.new("There was more than one boundary in the field, this is currently unexpected")
42
+ raise MyJohnDeereError.new("There was more than one boundary in the field ID: #{self.id}, this is currently unexpected")
42
43
  elsif active_boundaries.count == 1 then
43
44
  return active_boundaries.first
44
45
  else
@@ -46,7 +46,7 @@ module MyJohnDeere
46
46
  "#{self.base_jd_resource}/#{file_resource_id}",
47
47
  body: body,
48
48
  headers: {
49
- 'accept'=> 'application/vnd.deere.axiom.v3+json',
49
+ 'accept'=> JSON_CONTENT_HEADER_VALUE,
50
50
  "Content-Type"=>'application/octet-stream' ,
51
51
  "Content-Length" => body.bytesize.to_s
52
52
  })
@@ -1,3 +1,3 @@
1
1
  module MyJohnDeere
2
- VERSION = '0.1.7'
2
+ VERSION = '0.1.8'
3
3
  end
@@ -658,7 +658,7 @@
658
658
  "lon":-105.023052692
659
659
  }
660
660
  },
661
- "id":"f4828b25-2a92-12a4-bf3e-a107c39ecb85",
661
+ "id":"f4828b25-2a92-12a4-bf3e-a107c39ecb84",
662
662
  "links":[
663
663
  {
664
664
  "@type":"Link",
@@ -63,11 +63,12 @@ class TestField < Minitest::Test
63
63
  with(query: {embed: "boundaries"}).
64
64
  to_return(status: 200, body: fixture.to_json)
65
65
 
66
- assert_raises MyJohnDeere::MyJohnDeereError, "At the moment I don't have a use case where this would happen" do
67
- field = MyJohnDeere::Field.retrieve(default_access_token,
68
- fixture["id"], organization_id: ORGANIZATION_FIXTURE["id"],
69
- body: {embed: "boundaries"})
70
- end
66
+ field = MyJohnDeere::Field.retrieve(default_access_token,
67
+ fixture["id"], organization_id: ORGANIZATION_FIXTURE["id"],
68
+ body: {embed: "boundaries"})
69
+
70
+ assert field.boundary.is_a?(MyJohnDeere::Boundary),
71
+ "There should be only one boundary since the request returned 2 boundaries with the same id"
71
72
  end
72
73
 
73
74
  def test_list()
@@ -83,6 +84,6 @@ class TestField < Minitest::Test
83
84
 
84
85
  fields.next_page!
85
86
 
86
- assert_equal 1, fields.data
87
+ assert_equal 1, fields.data.count
87
88
  end
88
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myjohndeere
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Susmarski