greenhouse_io 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f943bd5a8beb683ca3d3e7093ab0da59b92dc080
4
- data.tar.gz: 61b72fbb33e6b07ff1182b73899820bbac253551
3
+ metadata.gz: d007b6cb0b14e9788a054d035734fcf354d1b40d
4
+ data.tar.gz: 05b9333916a792ba92250583b43ae85bbe64cb57
5
5
  SHA512:
6
- metadata.gz: 1a60fbbbc126b6972486f2acbbae28ae86aa8b7d2ad4f16b281941279c239be64116b983e44d836a3ab6243b7df49685219bd8d2f2c958b55f7edcaa8f16cca0
7
- data.tar.gz: 998ddf413dc68f561770df31e79211bd384f0219b3e87270cb5f5920bce64b4e400fb0565373ec2aa6dc29824dba43f7dfa639df0f286fa28d5c57b766d61b2b
6
+ metadata.gz: 311001bda1e1c84d3931cfc435b47e10b0efdf5440f680cf4f12c5bdf8f79d73add003a144d29949b541da4594b665fbb86009909e90bde71193f1cfcd8dc57d
7
+ data.tar.gz: a28e78440b4a6ec50a33583fb0bd3790eff5c7313c7951d328ac66328f3c34ed7f057f6b7ba9d97e646ac7f8d6a99f3e317d6eaad83a9f127cda2b3a39728e5d
data/.gitignore CHANGED
@@ -16,4 +16,4 @@ tmp
16
16
  .ruby-*
17
17
  *.swp
18
18
  *.un~
19
- tags
19
+ .tags
data/CHANGES.md CHANGED
@@ -2,8 +2,14 @@
2
2
 
3
3
  This project follows [semantic versioning](http://semver.org/). This changelog follows suggestions from [keepachangelog.com](http://keepachangelog.com/).
4
4
 
5
+ ## Version 2.5.0
6
+ Released 2016-05-31. Contributed by [@theshanx](https://github.com/theshanx). Thanks! :)
7
+
8
+ #### Added
9
+ - Added methods for retrieving offers for an application: `current_offer_for_application` and `offers_for_application`
10
+
5
11
  ## Version 2.4.0
6
- Released 2016-04-20.
12
+ Released 2016-04-20. Contributed by [@mariochavez](https://github.com/mariochavez) -- thank you!
7
13
 
8
14
  #### Added
9
15
  - Exposed `link` HTTP header in `GreenhouseIo::Client`.
data/README.md CHANGED
@@ -183,6 +183,8 @@ Methods for which an `id` is **required**:
183
183
  * `activity_feed` *(requires a candidate ID)*
184
184
  * `scorecards` *(requires an application ID)*
185
185
  * `scheduled_interviews` *(requires an application ID)*
186
+ * `offers_for_application` *(requires an application ID)*
187
+ * `current_offer_for_application` *(requires an application ID)*
186
188
  * `stages` *(requires a job ID)*
187
189
  * `job_post` *(requires a job ID)*
188
190
  * `create_candidate_note` *(requires a candidate ID)*
@@ -44,6 +44,14 @@ module GreenhouseIo
44
44
  get_from_harvest_api "/applications#{path_id(id)}", options
45
45
  end
46
46
 
47
+ def offers_for_application(id, options = {})
48
+ get_from_harvest_api "/applications/#{id}/offers", options
49
+ end
50
+
51
+ def current_offer_for_application(id, options = {})
52
+ get_from_harvest_api "/applications/#{id}/offers/current_offer", options
53
+ end
54
+
47
55
  def scorecards(id, options = {})
48
56
  get_from_harvest_api "/applications/#{id}/scorecards", options
49
57
  end
@@ -1,3 +1,3 @@
1
1
  module GreenhouseIo
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
  end
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/applications/123/offers/current_offer
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Server:
16
+ - Cowboy
17
+ Connection:
18
+ - keep-alive
19
+ Date:
20
+ - Tue, 31 May 2016 19:48:29 GMT
21
+ Status:
22
+ - 200 OK
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '416'
27
+ X-Ratelimit-Limit:
28
+ - '40'
29
+ X-Ratelimit-Remaining:
30
+ - '39'
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Via:
34
+ - 1.1 vegur
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"id":320847,"version":1,"application_id":123,"created_at":"2016-05-31T19:38:43.623Z","updated_at":"2016-05-31T19:38:56.024Z","sent_at":null,"resolved_at":"2016-05-31T19:38:56.024Z","starts_at":"2016-05-31","status":"accepted","custom_fields":{"benefits":null,"bonus":"1000","current_salary":null,"employment_type":"Full-time","notes":null,"options":"2000","salary":"74111","source_cost":null,"visa_cost":null}}'
38
+ http_version:
39
+ recorded_at: Tue, 31 May 2016 19:48:32 GMT
40
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/applications/123/offers
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Server:
16
+ - Cowboy
17
+ Connection:
18
+ - keep-alive
19
+ Date:
20
+ - Tue, 31 May 2016 19:39:19 GMT
21
+ Status:
22
+ - 200 OK
23
+ Content-Type:
24
+ - application/json;charset=utf-8
25
+ Content-Length:
26
+ - '418'
27
+ X-Ratelimit-Limit:
28
+ - '40'
29
+ X-Ratelimit-Remaining:
30
+ - '39'
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Via:
34
+ - 1.1 vegur
35
+ body:
36
+ encoding: UTF-8
37
+ string: '[{"id":320847,"version":1,"application_id":123,"created_at":"2016-05-31T19:38:43.623Z","updated_at":"2016-05-31T19:38:56.024Z","sent_at":null,"resolved_at":"2016-05-31T19:38:56.024Z","starts_at":"2016-05-31","status":"accepted","custom_fields":{"benefits":null,"bonus":"1000","current_salary":null,"employment_type":"Full-time","notes":null,"options":"2000","salary":"74111","source_cost":null,"visa_cost":null}}]'
38
+ http_version:
39
+ recorded_at: Tue, 31 May 2016 19:39:22 GMT
40
+ recorded_with: VCR 3.0.1
@@ -634,5 +634,46 @@ describe GreenhouseIo::Client do
634
634
  end
635
635
  end
636
636
  end
637
+
638
+ describe "#offers_for_application" do
639
+ before do
640
+ VCR.use_cassette('client/offers_for_application') do
641
+ @offers = @client.offers_for_application(123)
642
+ end
643
+ end
644
+
645
+ it "returns a response" do
646
+ expect(@offers).to_not be_nil
647
+ end
648
+
649
+ it "returns an array of offers" do
650
+ expect(@offers).to be_an_instance_of(Array)
651
+
652
+ return unless @offers.size > 0
653
+ expect(@offers.first).to have_key(:application_id)
654
+ expect(@offers.first).to have_key(:version)
655
+ expect(@offers.first).to have_key(:status)
656
+ end
657
+ end
658
+
659
+ describe "#current_offer_for_application" do
660
+ before do
661
+ VCR.use_cassette('client/current_offer_for_application') do
662
+ @offer = @client.current_offer_for_application(123)
663
+ end
664
+ end
665
+
666
+ it "returns a response" do
667
+ expect(@offer).to_not be_nil
668
+ end
669
+
670
+ it "returns an offer object" do
671
+ expect(@offer).to be_an_instance_of(Hash)
672
+ expect(@offer[:id]).to be_a(Integer).and be > 0
673
+ expect(@offer[:created_at]).to be_a(String)
674
+ expect(@offer[:version]).to be_a(Integer).and be > 0
675
+ expect(@offer[:status]).to be_a(String)
676
+ end
677
+ end
637
678
  end
638
679
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greenhouse_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greenhouse Software
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-20 00:00:00.000000000 Z
12
+ date: 2016-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httmultiparty
@@ -131,6 +131,7 @@ files:
131
131
  - spec/fixtures/cassettes/client/create_candidate_note_invalid_missing_field.yml
132
132
  - spec/fixtures/cassettes/client/create_candidate_note_invalid_on_behalf_of.yml
133
133
  - spec/fixtures/cassettes/client/create_candidate_note_invalid_user_id.yml
134
+ - spec/fixtures/cassettes/client/current_offer_for_application.yml
134
135
  - spec/fixtures/cassettes/client/department.yml
135
136
  - spec/fixtures/cassettes/client/departments.yml
136
137
  - spec/fixtures/cassettes/client/headers.yml
@@ -139,6 +140,7 @@ files:
139
140
  - spec/fixtures/cassettes/client/jobs.yml
140
141
  - spec/fixtures/cassettes/client/offer.yml
141
142
  - spec/fixtures/cassettes/client/offers.yml
143
+ - spec/fixtures/cassettes/client/offers_for_application.yml
142
144
  - spec/fixtures/cassettes/client/office.yml
143
145
  - spec/fixtures/cassettes/client/offices.yml
144
146
  - spec/fixtures/cassettes/client/scheduled_interviews.yml
@@ -203,6 +205,7 @@ test_files:
203
205
  - spec/fixtures/cassettes/client/create_candidate_note_invalid_missing_field.yml
204
206
  - spec/fixtures/cassettes/client/create_candidate_note_invalid_on_behalf_of.yml
205
207
  - spec/fixtures/cassettes/client/create_candidate_note_invalid_user_id.yml
208
+ - spec/fixtures/cassettes/client/current_offer_for_application.yml
206
209
  - spec/fixtures/cassettes/client/department.yml
207
210
  - spec/fixtures/cassettes/client/departments.yml
208
211
  - spec/fixtures/cassettes/client/headers.yml
@@ -211,6 +214,7 @@ test_files:
211
214
  - spec/fixtures/cassettes/client/jobs.yml
212
215
  - spec/fixtures/cassettes/client/offer.yml
213
216
  - spec/fixtures/cassettes/client/offers.yml
217
+ - spec/fixtures/cassettes/client/offers_for_application.yml
214
218
  - spec/fixtures/cassettes/client/office.yml
215
219
  - spec/fixtures/cassettes/client/offices.yml
216
220
  - spec/fixtures/cassettes/client/scheduled_interviews.yml