paychex_api 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: 7251288b681c23b4098ba4bca7f19f0bd41bb734b393aeaf14248dc125bb8858
4
- data.tar.gz: 9c0ebd502d7bc21e7787f08e850fcd17565171ab36f254b8bde9f8067de54d09
3
+ metadata.gz: 26445528480bff4925df351a175a69bc283f73f628c5175dbe00e027cb791ab5
4
+ data.tar.gz: 062d617c2cb719806e45c96f861c1c2090fff9a31a0065a40a87ccd1a701a6f5
5
5
  SHA512:
6
- metadata.gz: e9e4f6648e59b1b540043aee20953417e80abad7a50a81517413ab1eb42b77b4e9a424edd1679c7f140e4f77d4f37b8bcd6f6cc1aa0292c3b176b920bd9e4a16
7
- data.tar.gz: c20be9e0f548f6a9c7ad88404493c26afb077e4b6bae82839696668e51f065c20dc4473b4bf1d65b3067c3247fcf1deeb559236273df49ba28c0b17dee0d140b
6
+ metadata.gz: b8f0e6534f085b51c2f0a8ff6616c1f60383e8448591e084c0236c4ce7afc3628c2dc9da92e8bb266f4c17fb6cda09d89a19f2ab5ace77701a40d9d6f45ee8b5
7
+ data.tar.gz: eeb98d3f9749faccbeed4558b4ff8772609b66778f101d9070cd399af8fad603632ec77ed1e8cbd20e70dbba2e4667a91a8a0cdc0e958ef1c22781d031d35302
@@ -20,7 +20,7 @@ module PaychexAPI
20
20
  @api_client = api_client
21
21
  @links = []
22
22
  @metadata = {}
23
- @errors = response.body['errors']
23
+ @errors = response.body['errors'] if response.body && response.body.key?('errors')
24
24
  case response.status
25
25
  when *((200..206).to_a + [302])
26
26
  apply_response_metadata(response)
@@ -18,6 +18,7 @@ module PaychexAPI
18
18
  ORGANIZATIONS_PATH = '/organizations'.freeze
19
19
  JOB_TITLES_PATH = '/jobtitles'.freeze
20
20
  WORKER_STATUSES_PATH = '/workerstatuses'.freeze
21
+ MESSAGES_PATH = '/messages'.freeze
21
22
  NOTIFICATIONS_PATH = '/notifications'.freeze
22
23
  WORKERS_PATH = '/workers'.freeze
23
24
  COMMUNICATIONS_PATH = '/communications'.freeze
@@ -0,0 +1,9 @@
1
+ module PaychexAPI
2
+ class Client
3
+ module Messages
4
+ def create_message(params = {})
5
+ post("#{API_PATH}#{MESSAGES_PATH}", params)
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module PaychexAPI
2
- VERSION = '0.0.4'.freeze unless defined?(PaychexAPI::VERSION)
2
+ VERSION = '0.0.5'.freeze unless defined?(PaychexAPI::VERSION)
3
3
  end
File without changes
@@ -0,0 +1,23 @@
1
+ require 'test_helper'
2
+ describe PaychexAPI::Client::Notifications do
3
+ let!(:body) do
4
+ {
5
+ 'companyId' => '00Z5V9BTI687WL8V60GT',
6
+ 'asOfDate' => '2018-01-12T00:00:00Z',
7
+ 'domains' => ['CLT_PROD'],
8
+ 'action' => 'ADD',
9
+ 'productCode' => 'LMS_ENH'
10
+ }
11
+ end
12
+
13
+ before do
14
+ @client = PaychexAPI::Client.new(
15
+ prefix: 'http://test.paychex.com', client_id: 'client_id', client_secret: 'client_secret'
16
+ )
17
+ end
18
+
19
+ it 'should create a message' do
20
+ response = @client.create_message(body)
21
+ expect(response.status).to(eq(201))
22
+ end
23
+ end
@@ -60,6 +60,12 @@ class FakePaychex < Sinatra::Base
60
60
  get_json_data 200, 'communications.json'
61
61
  end
62
62
 
63
+ # Messages
64
+
65
+ post %r{/messages$} do
66
+ get_json_data 201, 'messages.json'
67
+ end
68
+
63
69
  private
64
70
 
65
71
  def get_json_data(response_code, file_name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paychex_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-21 00:00:00.000000000 Z
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -239,6 +239,7 @@ files:
239
239
  - lib/paychex_api/client.rb
240
240
  - lib/paychex_api/client/associations.rb
241
241
  - lib/paychex_api/client/companies.rb
242
+ - lib/paychex_api/client/messages.rb
242
243
  - lib/paychex_api/client/notifications.rb
243
244
  - lib/paychex_api/client/workers.rb
244
245
  - lib/paychex_api/version.rb
@@ -246,11 +247,13 @@ files:
246
247
  - spec/fixtures/auth.json
247
248
  - spec/fixtures/communications.json
248
249
  - spec/fixtures/companies.json
250
+ - spec/fixtures/messages.json
249
251
  - spec/fixtures/organizations.json
250
252
  - spec/fixtures/workers.json
251
253
  - spec/paychex_api/api_array_spec.rb
252
254
  - spec/paychex_api/client/associations_spec.rb
253
255
  - spec/paychex_api/client/companies_spec.rb
256
+ - spec/paychex_api/client/messages_spec.rb
254
257
  - spec/paychex_api/client/notifications_spec.rb
255
258
  - spec/paychex_api/client/workers_spec.rb
256
259
  - spec/paychex_api/client_spec.rb
@@ -285,11 +288,13 @@ test_files:
285
288
  - spec/fixtures/auth.json
286
289
  - spec/fixtures/communications.json
287
290
  - spec/fixtures/companies.json
291
+ - spec/fixtures/messages.json
288
292
  - spec/fixtures/organizations.json
289
293
  - spec/fixtures/workers.json
290
294
  - spec/paychex_api/api_array_spec.rb
291
295
  - spec/paychex_api/client/associations_spec.rb
292
296
  - spec/paychex_api/client/companies_spec.rb
297
+ - spec/paychex_api/client/messages_spec.rb
293
298
  - spec/paychex_api/client/notifications_spec.rb
294
299
  - spec/paychex_api/client/workers_spec.rb
295
300
  - spec/paychex_api/client_spec.rb