greenhouse_io-gitlab 2.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.travis.yml +11 -0
  4. data/CHANGES.md +41 -0
  5. data/Gemfile +11 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +200 -0
  8. data/Rakefile +8 -0
  9. data/greenhouse_io.gemspec +29 -0
  10. data/lib/greenhouse_io.rb +9 -0
  11. data/lib/greenhouse_io/api.rb +19 -0
  12. data/lib/greenhouse_io/api/client.rb +145 -0
  13. data/lib/greenhouse_io/api/job_board.rb +66 -0
  14. data/lib/greenhouse_io/configuration.rb +21 -0
  15. data/lib/greenhouse_io/error.rb +10 -0
  16. data/lib/greenhouse_io/version.rb +3 -0
  17. data/spec/fixtures/cassettes/apply_to_job.yml +44 -0
  18. data/spec/fixtures/cassettes/client/activity_feed.yml +36 -0
  19. data/spec/fixtures/cassettes/client/all_scorecards.yml +38 -0
  20. data/spec/fixtures/cassettes/client/application.yml +36 -0
  21. data/spec/fixtures/cassettes/client/application_by_job_id.yml +139 -0
  22. data/spec/fixtures/cassettes/client/applications.yml +43 -0
  23. data/spec/fixtures/cassettes/client/candidate.yml +36 -0
  24. data/spec/fixtures/cassettes/client/candidates.yml +38 -0
  25. data/spec/fixtures/cassettes/client/create_candidate_note.yml +42 -0
  26. data/spec/fixtures/cassettes/client/create_candidate_note_invalid_candidate_id.yml +42 -0
  27. data/spec/fixtures/cassettes/client/create_candidate_note_invalid_missing_field.yml +42 -0
  28. data/spec/fixtures/cassettes/client/create_candidate_note_invalid_on_behalf_of.yml +42 -0
  29. data/spec/fixtures/cassettes/client/create_candidate_note_invalid_user_id.yml +42 -0
  30. data/spec/fixtures/cassettes/client/current_offer_for_application.yml +40 -0
  31. data/spec/fixtures/cassettes/client/department.yml +36 -0
  32. data/spec/fixtures/cassettes/client/departments.yml +38 -0
  33. data/spec/fixtures/cassettes/client/headers.yml +38 -0
  34. data/spec/fixtures/cassettes/client/job.yml +37 -0
  35. data/spec/fixtures/cassettes/client/job_post.yml +49 -0
  36. data/spec/fixtures/cassettes/client/jobs.yml +39 -0
  37. data/spec/fixtures/cassettes/client/offer.yml +48 -0
  38. data/spec/fixtures/cassettes/client/offers.yml +51 -0
  39. data/spec/fixtures/cassettes/client/offers_for_application.yml +40 -0
  40. data/spec/fixtures/cassettes/client/office.yml +36 -0
  41. data/spec/fixtures/cassettes/client/offices.yml +46 -0
  42. data/spec/fixtures/cassettes/client/scheduled_interviews.yml +38 -0
  43. data/spec/fixtures/cassettes/client/scorecards.yml +37 -0
  44. data/spec/fixtures/cassettes/client/source.yml +39 -0
  45. data/spec/fixtures/cassettes/client/sources.yml +37 -0
  46. data/spec/fixtures/cassettes/client/stages.yml +36 -0
  47. data/spec/fixtures/cassettes/client/user.yml +36 -0
  48. data/spec/fixtures/cassettes/client/users.yml +38 -0
  49. data/spec/fixtures/cassettes/department.yml +45 -0
  50. data/spec/fixtures/cassettes/departments.yml +45 -0
  51. data/spec/fixtures/cassettes/invalid_application.yml +43 -0
  52. data/spec/fixtures/cassettes/invalid_application_id.yml +44 -0
  53. data/spec/fixtures/cassettes/invalid_id.yml +40 -0
  54. data/spec/fixtures/cassettes/invalid_organization.yml +40 -0
  55. data/spec/fixtures/cassettes/job.yml +80 -0
  56. data/spec/fixtures/cassettes/job_with_questions.yml +85 -0
  57. data/spec/fixtures/cassettes/jobs.yml +44 -0
  58. data/spec/fixtures/cassettes/jobs_with_content.yml +118 -0
  59. data/spec/fixtures/cassettes/office.yml +45 -0
  60. data/spec/fixtures/cassettes/offices.yml +45 -0
  61. data/spec/greenhouse_io/api/client_spec.rb +679 -0
  62. data/spec/greenhouse_io/api/job_board_spec.rb +187 -0
  63. data/spec/greenhouse_io/configuration_spec.rb +71 -0
  64. data/spec/greenhouse_io/error_spec.rb +23 -0
  65. data/spec/spec_helper.rb +22 -0
  66. metadata +242 -0
@@ -0,0 +1,36 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates/1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - application/json;charset=utf-8
17
+ Date:
18
+ - Wed, 23 Apr 2014 23:23:01 GMT
19
+ Status:
20
+ - 200 OK
21
+ X-Content-Type-Options:
22
+ - nosniff
23
+ X-Ratelimit-Limit:
24
+ - '20'
25
+ X-Ratelimit-Remaining:
26
+ - '20'
27
+ Content-Length:
28
+ - '68109'
29
+ Connection:
30
+ - keep-alive
31
+ body:
32
+ encoding: UTF-8
33
+ string: "{\"id\":1,\"first_name\":\"User\",\"last_name\":\"One\",\"company\":null,\"title\":null,\"created_at\":\"2013-10-17T15:32:26Z\",\"last_activity\":\"2013-10-30T14:37:10Z\",\"photo_url\":null,\"attachments\":[{\"filename\":\"USER_1_Resume_10.13.pdf\",\"url\":\"https://prod-heroku.s3.amazonaws.com/person_attachments/USER_1_Resume_10.13.pdf\",\"type\":\"cover_letter\"},{\"filename\":\"USER_1_Resume_10.13.pdf\",\"url\":\"https://resume.com/USER_1_Resume_10.13.pdf\",\"type\":\"resume\"}],\"application_ids\":[1234],\"phone_numbers\":[{\"value\":\"123-345-5678\",\"type\":\"other\"}],\"addresses\":[],\"email_addresses\":[{\"value\":\"user_one@email.com\",\"type\":\"personal\"}],\"website_addresses\":[],\"social_media_addresses\":[]}"
34
+ http_version:
35
+ recorded_at: Wed, 23 Apr 2014 23:23:02 GMT
36
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - application/json;charset=utf-8
17
+ Date:
18
+ - Wed, 23 Apr 2014 23:23:01 GMT
19
+ Link:
20
+ - "<https://harvest.greenhouse.io/v1/candidates?page=2&per_page=100>; rel=\"next\""
21
+ Status:
22
+ - 200 OK
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ X-Ratelimit-Limit:
26
+ - '20'
27
+ X-Ratelimit-Remaining:
28
+ - '20'
29
+ Content-Length:
30
+ - '68109'
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: "[{\"id\":1,\"first_name\":\"User\",\"last_name\":\"One\",\"company\":null,\"title\":null,\"created_at\":\"2013-10-17T15:32:26Z\",\"last_activity\":\"2013-10-30T14:37:10Z\",\"photo_url\":null,\"attachments\":[{\"filename\":\"USER_1_Resume_10.13.pdf\",\"url\":\"https://resumes.com/USER_1_Resume_10.13.pdf\",\"type\":\"cover_letter\"},{\"filename\":\"USER_1_Resume_10.13.pdf\",\"url\":\"https://prod-heroku.s3.amazonaws.com/person_attachments/USER_1_Resume_10.13.pdf\",\"type\":\"resume\"}],\"application_ids\":[1234],\"phone_numbers\":[{\"value\":\"123-345-5678\",\"type\":\"other\"}],\"addresses\":[],\"email_addresses\":[{\"value\":\"user_one@email.com\",\"type\":\"personal\"}],\"website_addresses\":[],\"social_media_addresses\":[]}]"
36
+ http_version:
37
+ recorded_at: Wed, 23 Apr 2014 23:23:02 GMT
38
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates/1/activity_feed/notes
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"user_id":2,"message":"Candidate on vacation","visibility":"public"}'
9
+ headers:
10
+ On-Behalf-Of:
11
+ - '2'
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ Server:
18
+ - Cowboy
19
+ Connection:
20
+ - close
21
+ Date:
22
+ - Mon, 18 Apr 2016 19:41:43 GMT
23
+ Status:
24
+ - 200 OK
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '154'
29
+ X-Ratelimit-Limit:
30
+ - '40'
31
+ X-Ratelimit-Remaining:
32
+ - '39'
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Via:
36
+ - 1.1 vegur
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"created_at":"2016-04-18T19:43:52.534Z","body":"Candidate on vacation","user":{"id":2,"name":"Richard Feynman"},"private":false,"visiblity":"public"}'
40
+ http_version:
41
+ recorded_at: Mon, 18 Apr 2016 19:41:44 GMT
42
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates/99/activity_feed/notes
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"user_id":2,"message":"Candidate on vacation","visibility":"public"}'
9
+ headers:
10
+ On-Behalf-Of:
11
+ - '2'
12
+ response:
13
+ status:
14
+ code: 404
15
+ message: Resource not found
16
+ headers:
17
+ Server:
18
+ - Cowboy
19
+ Connection:
20
+ - close
21
+ Date:
22
+ - Mon, 18 Apr 2016 19:41:43 GMT
23
+ Status:
24
+ - 200 OK
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '32'
29
+ X-Ratelimit-Limit:
30
+ - '40'
31
+ X-Ratelimit-Remaining:
32
+ - '39'
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Via:
36
+ - 1.1 vegur
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"message":"Resource not found"}'
40
+ http_version:
41
+ recorded_at: Mon, 18 Apr 2016 19:41:44 GMT
42
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates/1/activity_feed/notes
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"user_id":2,"visibility":"public"}'
9
+ headers:
10
+ On-Behalf-Of:
11
+ - '2'
12
+ response:
13
+ status:
14
+ code: 422
15
+ message: Unprocessable Entity
16
+ headers:
17
+ Server:
18
+ - Cowboy
19
+ Connection:
20
+ - close
21
+ Date:
22
+ - Mon, 18 Apr 2016 19:41:43 GMT
23
+ Status:
24
+ - 200 OK
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '70'
29
+ X-Ratelimit-Limit:
30
+ - '40'
31
+ X-Ratelimit-Remaining:
32
+ - '39'
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Via:
36
+ - 1.1 vegur
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"errors":[{"message":"Missing required field: body","field":"body"}]}'
40
+ http_version:
41
+ recorded_at: Mon, 18 Apr 2016 19:41:44 GMT
42
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates/1/activity_feed/notes
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"user_id":2,"message":"Candidate on vacation","visibility":"public"}'
9
+ headers:
10
+ On-Behalf-Of:
11
+ - '99'
12
+ response:
13
+ status:
14
+ code: 404
15
+ message: Resource not found
16
+ headers:
17
+ Server:
18
+ - Cowboy
19
+ Connection:
20
+ - close
21
+ Date:
22
+ - Mon, 18 Apr 2016 19:41:43 GMT
23
+ Status:
24
+ - 200 OK
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '32'
29
+ X-Ratelimit-Limit:
30
+ - '40'
31
+ X-Ratelimit-Remaining:
32
+ - '39'
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Via:
36
+ - 1.1 vegur
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"message":"Resource not found"}'
40
+ http_version:
41
+ recorded_at: Mon, 18 Apr 2016 19:41:44 GMT
42
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates/1/activity_feed/notes
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"user_id":99,"message":"Candidate on vacation","visibility":"public"}'
9
+ headers:
10
+ On-Behalf-Of:
11
+ - '2'
12
+ response:
13
+ status:
14
+ code: 404
15
+ message: Resource not found
16
+ headers:
17
+ Server:
18
+ - Cowboy
19
+ Connection:
20
+ - close
21
+ Date:
22
+ - Mon, 18 Apr 2016 19:41:43 GMT
23
+ Status:
24
+ - 200 OK
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '32'
29
+ X-Ratelimit-Limit:
30
+ - '40'
31
+ X-Ratelimit-Remaining:
32
+ - '39'
33
+ X-Content-Type-Options:
34
+ - nosniff
35
+ Via:
36
+ - 1.1 vegur
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"message":"Resource not found"}'
40
+ http_version:
41
+ recorded_at: Mon, 18 Apr 2016 19:41:44 GMT
42
+ 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/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,36 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/departments/187
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - application/json;charset=utf-8
17
+ Date:
18
+ - Tue, 22 Apr 2014 02:35:58 GMT
19
+ Status:
20
+ - 200 OK
21
+ X-Content-Type-Options:
22
+ - nosniff
23
+ X-Ratelimit-Limit:
24
+ - '20'
25
+ X-Ratelimit-Remaining:
26
+ - '20'
27
+ Content-Length:
28
+ - '31'
29
+ Connection:
30
+ - keep-alive
31
+ body:
32
+ encoding: UTF-8
33
+ string: "{\"id\":187,\"name\":\"Engineering\"}"
34
+ http_version:
35
+ recorded_at: Tue, 22 Apr 2014 02:35:58 GMT
36
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/departments
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - application/json;charset=utf-8
17
+ Date:
18
+ - Tue, 22 Apr 2014 02:35:25 GMT
19
+ Status:
20
+ - 200 OK
21
+ X-Content-Type-Options:
22
+ - nosniff
23
+ X-Ratelimit-Limit:
24
+ - '20'
25
+ X-Ratelimit-Remaining:
26
+ - '20'
27
+ Content-Length:
28
+ - '427'
29
+ Connection:
30
+ - keep-alive
31
+ body:
32
+ encoding: UTF-8
33
+ string: "[{\"id\":187,\"name\":\"Engineering\"},{\"id\":188,\"name\":\"Finance\"},{\"id\":364,\"name\":\"HR\"},{\"id\":365,\"name\":\"Marketing\"},{\"id\":366,\"name\":\"Curriculum\"},{\"id\":367,\"name\":\"Enterprise\"},{\"id\":368,\"name\":\"Online\"},{\"id\":369,\"name\":\"Education
34
+ Operations\"},{\"id\":370,\"name\":\"Frontlines\"},{\"id\":371,\"name\":\"Real
35
+ Estate\"},{\"id\":372,\"name\":\"Admissions\"},{\"id\":373,\"name\":\"Design\"},{\"id\":374,\"name\":\"Executive\"},{\"id\":499,\"name\":\"Instruction\"}]"
36
+ http_version:
37
+ recorded_at: Tue, 22 Apr 2014 02:35:25 GMT
38
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,38 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/candidates
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - application/json;charset=utf-8
17
+ Date:
18
+ - Wed, 23 Apr 2014 23:23:01 GMT
19
+ Link:
20
+ - "<https://harvest.greenhouse.io/v1/candidates/?page=1&per_page=100>; rel=\"last\""
21
+ Status:
22
+ - 200 OK
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ X-Ratelimit-Limit:
26
+ - '20'
27
+ X-Ratelimit-Remaining:
28
+ - '19'
29
+ Content-Length:
30
+ - '68109'
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: "[{\"id\":1,\"first_name\":\"User\",\"last_name\":\"One\",\"company\":null,\"title\":null,\"created_at\":\"2013-10-17T15:32:26Z\",\"last_activity\":\"2013-10-30T14:37:10Z\",\"photo_url\":null,\"attachments\":[{\"filename\":\"USER_1_Resume_10.13.pdf\",\"url\":\"https://resumes.com/USER_1_Resume_10.13.pdf\",\"type\":\"cover_letter\"},{\"filename\":\"USER_1_Resume_10.13.pdf\",\"url\":\"https://prod-heroku.s3.amazonaws.com/person_attachments/USER_1_Resume_10.13.pdf\",\"type\":\"resume\"}],\"application_ids\":[1234],\"phone_numbers\":[{\"value\":\"123-345-5678\",\"type\":\"other\"}],\"addresses\":[],\"email_addresses\":[{\"value\":\"user_one@email.com\",\"type\":\"personal\"}],\"website_addresses\":[],\"social_media_addresses\":[]}]"
36
+ http_version:
37
+ recorded_at: Wed, 23 Apr 2014 23:23:02 GMT
38
+ recorded_with: VCR 2.5.0