plangrade-ruby 0.3.24 → 0.3.25

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: 84042f01be72b4e9a4f175176cdd38ca0f93ff82
4
- data.tar.gz: 3666e185380752fb2780dca13905ad3f6e5b2d94
3
+ metadata.gz: 6a747298c8947caf43e2c899335e247518fa82c5
4
+ data.tar.gz: b268c581169f0ae9920ab91232e27dbbe6ba1a87
5
5
  SHA512:
6
- metadata.gz: e0b23cff9db342711a11b81a4171d3e4a7321321d8d9a2af6735f1f3c4d9229a7378d5840b29e182c8dbe524fb43549b2e1504a17d4e9932779f9b0ec2f68aa2
7
- data.tar.gz: 1c89eef0bf1516cc388e4bf4257b419a96fc7a4e1f1bd25189d36c5f488d2026e95990c20dbb272eeea2b56f7f17d815938d094dd1936de6b1594535c338a514
6
+ metadata.gz: ad60335946fbc4e557c195df1b2609198621f3425bbc3e1f00116360233853ff97b0a9545b70f94f0eaf44e6f756a21a32425ea294db8cfc945cbf124bdfd0ea
7
+ data.tar.gz: a0324fa62305eb3e9771d1d755d175b135d99660f672bb11b48bc1f0375093a0775fc3ae88930f95305be72b8db65154904e43bc65646408bd5f62c5a97f2588
checksums.yaml.gz.sig CHANGED
Binary file
@@ -4,7 +4,6 @@ module Plangrade
4
4
 
5
5
  def self.current_user
6
6
  result = api_handler.current_user
7
- return nil unless result.success?
8
7
  new(result.body)
9
8
  end
10
9
 
@@ -1,5 +1,5 @@
1
1
  module Plangrade
2
2
  module Ruby
3
- VERSION = "0.3.24"
3
+ VERSION = "0.3.25"
4
4
  end
5
5
  end
@@ -36,7 +36,7 @@ describe Plangrade::Api::Company do
36
36
  describe 'create_company' do
37
37
  it 'makes an http request' do
38
38
  params = {:name => 'plangrade, llc', :ein => '123456789'}
39
- @client.should_receive(:post).with('/api/v1/companies', params)
39
+ expect(@client).to receive(:post).with('/api/v1/companies', params)
40
40
  @client.create_company(params)
41
41
  end
42
42
  end
@@ -44,28 +44,28 @@ describe Plangrade::Api::Company do
44
44
  describe 'update_company' do
45
45
  it 'makes an http request' do
46
46
  params = {:name => 'plangrade, inc'}
47
- @client.should_receive(:put).with('/api/v1/companies/1', params)
47
+ expect(@client).to receive(:put).with('/api/v1/companies/1', params)
48
48
  @client.update_company(1, params)
49
49
  end
50
50
  end
51
51
 
52
52
  describe 'delete_company' do
53
53
  it 'makes an http request' do
54
- @client.should_receive(:delete).with('/api/v1/companies/1')
54
+ expect(@client).to receive(:delete).with('/api/v1/companies/1')
55
55
  @client.delete_company(1)
56
56
  end
57
57
  end
58
58
 
59
59
  describe 'get_company' do
60
60
  it 'makes an http request' do
61
- @client.should_receive(:get).with('/api/v1/companies/1')
61
+ expect(@client).to receive(:get).with('/api/v1/companies/1')
62
62
  @client.get_company(1)
63
63
  end
64
64
  end
65
65
 
66
66
  describe 'all_companies' do
67
67
  it 'makes an http request' do
68
- @client.should_receive(:get).with('/api/v1/companies', {:page => 1, :letter => 'm'})
68
+ expect(@client).to receive(:get).with('/api/v1/companies', {:page => 1, :letter => 'm'})
69
69
  @client.all_companies({:page => 1, :letter => 'm'})
70
70
  end
71
71
  end
@@ -36,7 +36,7 @@ describe Plangrade::Api::Participant do
36
36
  describe 'create_participant' do
37
37
  it 'makes an http request' do
38
38
  params = {:company_id => 1, :employee_id => 0, :ssn => '1234', :first_name => 'Joe', :last_name => 'Compliance', :street1 => '1234 Fake St.', :city => 'Fake', :state => 'UT', :zip => '84606', :dob => '1983-12-31', :email => 'compliance@plangrade.com', :phone => 1234567890}
39
- @client.should_receive(:post).with('/api/v1/participants', params)
39
+ expect(@client).to receive(:post).with('/api/v1/participants', params)
40
40
  @client.create_participant(params)
41
41
  end
42
42
  end
@@ -44,35 +44,35 @@ describe Plangrade::Api::Participant do
44
44
  describe 'update_participant' do
45
45
  it 'makes an http request' do
46
46
  params = {:employee_id => 0, :first_name => 'John'}
47
- @client.should_receive(:put).with('/api/v1/participants/1', params)
47
+ expect(@client).to receive(:put).with('/api/v1/participants/1', params)
48
48
  @client.update_participant(1, params)
49
49
  end
50
50
  end
51
51
 
52
52
  describe 'archive_participant' do
53
53
  it 'makes an http request' do
54
- @client.should_receive(:get).with('/api/v1/participants/archive?participant_id=1')
54
+ expect(@client).to receive(:get).with('/api/v1/participants/archive?participant_id=1')
55
55
  @client.archive_participant(1)
56
56
  end
57
57
  end
58
58
 
59
59
  describe 'delete_participant' do
60
60
  it 'makes an http request' do
61
- @client.should_receive(:delete).with('/api/v1/participants/1')
61
+ expect(@client).to receive(:delete).with('/api/v1/participants/1')
62
62
  @client.delete_participant(1)
63
63
  end
64
64
  end
65
65
 
66
66
  describe 'get_participant' do
67
67
  it 'makes an http request' do
68
- @client.should_receive(:get).with('/api/v1/participants/1')
68
+ expect(@client).to receive(:get).with('/api/v1/participants/1')
69
69
  @client.get_participant(1)
70
70
  end
71
71
  end
72
72
 
73
73
  describe 'all_participants' do
74
74
  it 'makes an http request' do
75
- @client.should_receive(:get).with('/api/v1/participants?company_id=1')
75
+ expect(@client).to receive(:get).with('/api/v1/participants?company_id=1')
76
76
  @client.all_participants(1)
77
77
  end
78
78
  end
@@ -36,7 +36,7 @@ describe Plangrade::Api::User do
36
36
  describe 'create_user' do
37
37
  it 'makes an http request' do
38
38
  params = {:name => 'topher', :email => 'compliance@plangrade.com'}
39
- @client.should_receive(:post).with('/api/v1/users', params)
39
+ expect(@client).to receive(:post).with('/api/v1/users', params)
40
40
  @client.create_user(params)
41
41
  end
42
42
  end
@@ -44,21 +44,21 @@ describe Plangrade::Api::User do
44
44
  describe 'update_user' do
45
45
  it 'makes an http request' do
46
46
  params = {:name => 'christopher'}
47
- @client.should_receive(:put).with('/api/v1/users/1', params)
47
+ expect(@client).to receive(:put).with('/api/v1/users/1', params)
48
48
  @client.update_user(1, params)
49
49
  end
50
50
  end
51
51
 
52
52
  describe 'delete_user' do
53
53
  it 'makes an http request' do
54
- @client.should_receive(:delete).with('/api/v1/users/1')
54
+ expect(@client).to receive(:delete).with('/api/v1/users/1')
55
55
  @client.delete_user(1)
56
56
  end
57
57
  end
58
58
 
59
59
  describe 'current_user' do
60
60
  it 'makes an http request' do
61
- @client.should_receive(:get).with('/api/v1/me')
61
+ expect(@client).to receive(:get).with('/api/v1/me')
62
62
  @client.current_user
63
63
  end
64
64
  end
@@ -144,12 +144,12 @@ describe Plangrade::Resources::Base do
144
144
 
145
145
  it 'should update model' do
146
146
  api_handler = double("ApiHandler")
147
- api_handler.should_receive(:update_dummy_model).with(42, hash_including(
147
+ expect(api_handler).to receive(:update_dummy_model).with(42, hash_including(
148
148
  :name =>'john',
149
149
  :email => 'support@plangrade.com')
150
150
  ).and_return(double('Response', :success? => true, :created? => true, :body => {:id => 2}))
151
151
 
152
- subject.stub(:api_handler).and_return(api_handler)
152
+ allow(subject).to receive_message_chain(:api_handler).and_return(api_handler)
153
153
  subject.name = 'john'
154
154
  subject.email = 'support@plangrade.com'
155
155
  subject.save
@@ -161,11 +161,11 @@ describe Plangrade::Resources::Base do
161
161
 
162
162
  it 'should do nothing' do
163
163
  api_handler = double("ApiHandler")
164
- api_handler.should_receive(:create_dummy_model).with(
164
+ expect(api_handler).to receive(:create_dummy_model).with(
165
165
  hash_including(:name =>'jim', :email => 'compliance@plangrade.com')
166
166
  ).and_return(double('Response', :success? => true, :created? => true, :body => {:id => '2'}))
167
167
 
168
- subject.stub(:api_handler).and_return(api_handler)
168
+ allow(subject).to receive_message_chain(:api_handler).and_return(api_handler)
169
169
  subject.save
170
170
  end
171
171
  end
@@ -175,12 +175,12 @@ describe Plangrade::Resources::Base do
175
175
 
176
176
  it 'should create model' do
177
177
  api_handler = double("ApiHandler")
178
- api_handler.should_receive(:create_dummy_model).with({
178
+ expect(api_handler).to receive(:create_dummy_model).with({
179
179
  :name =>'john',
180
180
  :email => 'compliance@plangrade.com'
181
181
  }).and_return(double('Response', :success? => true, :created? => true, :body => {:id => 2}))
182
182
 
183
- subject.stub(:api_handler).and_return(api_handler)
183
+ allow(subject).to receive_message_chain(:api_handler).and_return(api_handler)
184
184
  subject.name = 'john'
185
185
  subject.save
186
186
  end
data/spec/spec_helper.rb CHANGED
@@ -28,7 +28,6 @@ SimpleCov.start
28
28
 
29
29
  require 'plangrade'
30
30
  require 'rspec'
31
- require 'rspec/autorun'
32
31
  require 'webmock/rspec'
33
32
 
34
33
  WebMock.disable_net_connect!(:allow => 'coveralls.io')
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plangrade-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.24
4
+ version: 0.3.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Reynoso
@@ -223,7 +223,6 @@ files:
223
223
  - spec/resources/participant_spec.rb
224
224
  - spec/resources/user_spec.rb
225
225
  - spec/spec_helper.rb
226
- - spec/user/user_test.rb
227
226
  homepage: https://github.com/topherreynoso/plangrade-ruby
228
227
  licenses:
229
228
  - MIT
@@ -266,5 +265,4 @@ test_files:
266
265
  - spec/resources/participant_spec.rb
267
266
  - spec/resources/user_spec.rb
268
267
  - spec/spec_helper.rb
269
- - spec/user/user_test.rb
270
268
  has_rdoc:
metadata.gz.sig CHANGED
Binary file
@@ -1,19 +0,0 @@
1
- require './test/test_helper'
2
-
3
- class PlangradeUserTest < Minitest::Test
4
- def test_exists
5
- assert Plangrade::User
6
- end
7
-
8
- def test_it_gives_back_a_single_user
9
- VCR.use_cassette('one_user') do
10
- user = Plangrade::User.find(4)
11
- assert_equal Plangrade::User, user.class
12
-
13
- # Check that the fields are accessible by our model
14
- assert_equal 4, user.id
15
- assert_equal "topherreynoso@gmail.com", user.email
16
- assert_equal "Christopher Reynoso", user.name
17
- end
18
- end
19
- end