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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/plangrade/resources/user.rb +0 -1
- data/lib/plangrade/ruby/version.rb +1 -1
- data/spec/api/company_spec.rb +5 -5
- data/spec/api/participant_spec.rb +6 -6
- data/spec/api/user_spec.rb +4 -4
- data/spec/resources/base_spec.rb +6 -6
- data/spec/spec_helper.rb +0 -1
- data.tar.gz.sig +0 -0
- metadata +1 -3
- metadata.gz.sig +0 -0
- data/spec/user/user_test.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a747298c8947caf43e2c899335e247518fa82c5
|
4
|
+
data.tar.gz: b268c581169f0ae9920ab91232e27dbbe6ba1a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad60335946fbc4e557c195df1b2609198621f3425bbc3e1f00116360233853ff97b0a9545b70f94f0eaf44e6f756a21a32425ea294db8cfc945cbf124bdfd0ea
|
7
|
+
data.tar.gz: a0324fa62305eb3e9771d1d755d175b135d99660f672bb11b48bc1f0375093a0775fc3ae88930f95305be72b8db65154904e43bc65646408bd5f62c5a97f2588
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/spec/api/company_spec.rb
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
data/spec/api/user_spec.rb
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
61
|
+
expect(@client).to receive(:get).with('/api/v1/me')
|
62
62
|
@client.current_user
|
63
63
|
end
|
64
64
|
end
|
data/spec/resources/base_spec.rb
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
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.
|
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
|
data/spec/user/user_test.rb
DELETED
@@ -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
|