marketo-api-ruby 0.8 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -111,16 +111,16 @@ class TestMarketoAPILead < Minitest::Test
111
111
 
112
112
  def test_params_for_sync
113
113
  result = {
114
- return_lead: true,
115
- lead_record: {
116
- email: @email,
117
- id: @id,
118
- lead_attribute_list: {
114
+ returnLead: true,
115
+ leadRecord: {
116
+ Email: @email,
117
+ Id: @id,
118
+ leadAttributeList: {
119
119
  attribute: [
120
- { attr_name: 'Email', attr_type: 'string', attr_value: @email },
121
- { attr_name: 'String', attr_type: 'string', attr_value: 'string' },
122
- { attr_name: 'Int', attr_type: 'integer', attr_value: 5 },
123
- { attr_name: 'Date', attr_type: 'datetime', attr_value: @date }
120
+ { attrName: 'Email', attrType: 'string', attrValue: @email },
121
+ { attrName: 'String', attrType: 'string', attrValue: 'string' },
122
+ { attrName: 'Int', attrType: 'integer', attrValue: 5 },
123
+ { attrName: 'Date', attrType: 'datetime', attrValue: @date }
124
124
  ]
125
125
  }
126
126
  }
@@ -131,7 +131,7 @@ class TestMarketoAPILead < Minitest::Test
131
131
 
132
132
  def test_class_key
133
133
  subject.class::NAMED_KEYS.each { |k, v|
134
- result = { lead_key: { key_type: v, key_value: 'value' } }
134
+ result = { leadKey: { keyType: v, keyValue: 'value' } }
135
135
 
136
136
  assert_equal result, subject.class.key(k, 'value')
137
137
  assert_equal result, subject.class.key(v, 'value')
@@ -16,7 +16,7 @@ class TestMarketoAPILeads < Minitest::Test
16
16
  {
17
17
  lead_record_list: {
18
18
  lead_record: {
19
- id: key[:lead_key][:key_value].to_i,
19
+ id: key[:leadKey][:keyValue].to_i,
20
20
  lead_attribute_list: {
21
21
  attribute: [
22
22
  { attr_name: 'Email', attr_value: nil, attr_type: 'string' },
@@ -30,7 +30,7 @@ class TestMarketoAPILeads < Minitest::Test
30
30
  }
31
31
 
32
32
  def test_get_valid_lead_key
33
- lead_key = { lead_key: { key_type: 'id', key_value: 416 } }
33
+ lead_key = { leadKey: { keyType: 'id', keyValue: 416 } }
34
34
  subject.stub :call, GET_LEAD_STUB do
35
35
  lead = subject.get(lead_key)
36
36
  assert_instance_of MarketoAPI::Lead, lead
@@ -120,8 +120,8 @@ class TestMarketoAPILeads < Minitest::Test
120
120
  }
121
121
  lead_list = subject.send(:transform_param_list, :sync, leads)
122
122
  result = {
123
- dedup_enabled: true,
124
- lead_record_list: lead_list
123
+ dedupEnabled: true,
124
+ leadRecordList: lead_list
125
125
  }
126
126
 
127
127
  method, params = subject.sync_multiple(leads)
@@ -14,10 +14,10 @@ class TestMarketoAPILists < Minitest::Test
14
14
  end
15
15
  stub_soap_call do
16
16
  result = {
17
- list_operation: :ADDTOLIST,
18
- list_key: :list_key,
19
- strict: false,
20
- list_member_list: [ lead_key(416) ]
17
+ listOperation: :ADDTOLIST,
18
+ listKey: :list_key,
19
+ strict: false,
20
+ listMemberList: [ lead_key(416) ]
21
21
  }
22
22
 
23
23
  method, options = subject.add(:list_key, lead: lead_key(416))
@@ -33,10 +33,10 @@ class TestMarketoAPILists < Minitest::Test
33
33
  def test_add_merged_leads
34
34
  stub_soap_call do
35
35
  result = {
36
- list_operation: :ADDTOLIST,
37
- list_key: :list_key,
38
- strict: false,
39
- list_member_list: [ lead_key(905), lead_key(416) ]
36
+ listOperation: :ADDTOLIST,
37
+ listKey: :list_key,
38
+ strict: false,
39
+ listMemberList: [ lead_key(905), lead_key(416) ]
40
40
  }
41
41
 
42
42
  method, options = subject.add(:list_key, leads: lead_key(905),
@@ -52,10 +52,10 @@ class TestMarketoAPILists < Minitest::Test
52
52
  end
53
53
  stub_soap_call do
54
54
  result = {
55
- list_operation: :REMOVEFROMLIST,
56
- list_key: :list_key,
57
- strict: false,
58
- list_member_list: [ lead_key(416) ]
55
+ listOperation: :REMOVEFROMLIST,
56
+ listKey: :list_key,
57
+ strict: false,
58
+ listMemberList: [ lead_key(416) ]
59
59
  }
60
60
 
61
61
  method, options = subject.remove(:list_key, lead: lead_key(416))
@@ -70,10 +70,10 @@ class TestMarketoAPILists < Minitest::Test
70
70
  end
71
71
  stub_soap_call do
72
72
  result = {
73
- list_operation: :ISMEMBEROFLIST,
74
- list_key: :list_key,
75
- strict: false,
76
- list_member_list: [ lead_key(416) ]
73
+ listOperation: :ISMEMBEROFLIST,
74
+ listKey: :list_key,
75
+ strict: false,
76
+ listMemberList: [ lead_key(416) ]
77
77
  }
78
78
 
79
79
  method, options = subject.member?(:list_key, lead: lead_key(416))
@@ -84,7 +84,7 @@ class TestMarketoAPILists < Minitest::Test
84
84
 
85
85
  def test_class_key
86
86
  subject.class::NAMED_TYPES.each { |k, v|
87
- result = { list_key: { key_type: v, key_value: 'value' } }
87
+ result = { listKey: { keyType: v, keyValue: 'value' } }
88
88
 
89
89
  assert_equal result, subject.class.key(k, 'value')
90
90
  assert_equal result, subject.class.key(v, 'value')
@@ -103,8 +103,8 @@ class TestMarketoAPIMObject < Minitest::Test
103
103
  MarketoAPI::MObject::Criteria::CMP.each do |cmp|
104
104
  c = subject.criteria(k, 'value', cmp).last
105
105
  e = {
106
- attr_name: v,
107
- attr_value: 'value',
106
+ attrName: v,
107
+ attrValue: 'value',
108
108
  comparison: cmp
109
109
  }
110
110
 
@@ -155,9 +155,9 @@ class TestMarketoAPIMObject < Minitest::Test
155
155
  MarketoAPI::MObject::Association::TYPES.each do |k|
156
156
  c = subject.association(k, id: 3, external: 4).last
157
157
  e = {
158
- m_obj_type: k,
159
- id: 3,
160
- external_key: 4
158
+ mObjType: k,
159
+ id: 3,
160
+ externalKey: 4
161
161
  }
162
162
 
163
163
  assert_equal e, c.to_h
@@ -189,40 +189,44 @@ class TestMarketoAPIMObject < Minitest::Test
189
189
 
190
190
  def test_params_for_get
191
191
  assert_equal({
192
- type: subject.type, id: subject.id, include_details: false
192
+ type: subject.type, id: subject.id, includeDetails: false
193
193
  }, subject.params_for_get)
194
194
  end
195
195
 
196
196
  def test_params_for_get_minimal
197
197
  subject.id = nil
198
198
  assert_equal({
199
- type: subject.type, include_details: false
199
+ type: subject.type, includeDetails: false
200
200
  }, subject.params_for_get)
201
201
  end
202
202
 
203
203
  def test_params_for_get_with_details
204
204
  subject.include_details = true
205
205
  assert_equal({
206
- type: subject.type, id: subject.id, include_details: true
206
+ type: subject.type, id: subject.id, includeDetails: true
207
207
  }, subject.params_for_get)
208
208
  end
209
209
 
210
210
  def test_params_for_get_with_stream_position
211
211
  subject.stream_position = 'position'
212
212
  assert_equal({
213
- type: subject.type, id: subject.id, include_details: false,
214
- stream_position: 'position'
213
+ type: subject.type,
214
+ id: subject.id,
215
+ includeDetails: false,
216
+ streamPosition: 'position'
215
217
  }, subject.params_for_get)
216
218
  end
217
219
 
218
220
  def test_params_for_get_with_criteria
219
221
  subject.criteria(:name, 'value', :eq)
220
222
  assert_equal({
221
- type: subject.type, id: subject.id, include_details: false,
222
- m_obj_criteria_list: [
223
+ type: subject.type,
224
+ id: subject.id,
225
+ includeDetails: false,
226
+ mObjCriteriaList: [
223
227
  {
224
- attr_name: 'Name',
225
- attr_value: 'value',
228
+ attrName: 'Name',
229
+ attrValue: 'value',
226
230
  comparison: :EQ
227
231
  }
228
232
  ]
@@ -232,12 +236,14 @@ class TestMarketoAPIMObject < Minitest::Test
232
236
  def test_params_for_get_with_association
233
237
  subject.association(:Lead, id: 3, external: 4)
234
238
  assert_equal({
235
- type: subject.type, id: subject.id, include_details: false,
236
- m_obj_association_list: [
239
+ type: subject.type,
240
+ id: subject.id,
241
+ includeDetails: false,
242
+ mObjAssociationList: [
237
243
  {
238
- m_obj_type: :Lead,
239
- id: 3,
240
- external_key: 4
244
+ mObjType: :Lead,
245
+ id: 3,
246
+ externalKey: 4
241
247
  }
242
248
  ]
243
249
  }, subject.params_for_get)
@@ -32,13 +32,13 @@ class TestMarketoAPIMObjects < Minitest::Test
32
32
  source = MarketoAPI::MObject.opportunity(3)
33
33
  method, params = subject.delete(source)
34
34
  assert_equal :delete_m_objects, method
35
- assert_equal({ m_object_list: [ source.params_for_delete ] }, params)
35
+ assert_equal({ mObjectList: [ source.params_for_delete ] }, params)
36
36
  end
37
37
  end
38
38
 
39
39
  extractor = ->(*args) {
40
40
  {
41
- m_obj_status_list: args.last[:m_object_list].map { |mobject|
41
+ m_obj_status_list: args.last[:mObjectList].map { |mobject|
42
42
  {
43
43
  m_object_status: { id: mobject[:id], status: 'DELETED' }
44
44
  }
@@ -81,7 +81,7 @@ class TestMarketoAPIMObjects < Minitest::Test
81
81
  stub_soap_call do
82
82
  method, params = subject.describe('Opportunity')
83
83
  assert_equal :describe_m_object, method
84
- assert_equal({ object_name: 'Opportunity' }, params)
84
+ assert_equal({ objectName: 'Opportunity' }, params)
85
85
  end
86
86
  end
87
87
 
@@ -104,7 +104,7 @@ class TestMarketoAPIMObjects < Minitest::Test
104
104
  stub_soap_call do
105
105
  method, params = subject.get(MarketoAPI::MObject.opportunity)
106
106
  assert_equal :get_m_objects, method
107
- assert_equal({ type: :Opportunity, include_details: false }, params)
107
+ assert_equal({ type: :Opportunity, includeDetails: false }, params)
108
108
  end
109
109
  end
110
110
  end
@@ -66,4 +66,17 @@ module MarketoTestHelper
66
66
  def refute_missing_keys object, *keys
67
67
  keys.each { |key| assert object.has_key? key }
68
68
  end
69
+
70
+ def assert_raises_with_message exception_class, message, &block
71
+ exception_message = nil
72
+ assert_raises(exception_class) do
73
+ begin
74
+ block.call
75
+ rescue exception_class => exception
76
+ exception_message = exception.message
77
+ raise
78
+ end
79
+ end
80
+ assert_equal message, exception_message
81
+ end
69
82
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marketo-api-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.8'
4
+ version: '0.9'
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Austin Ziegler
@@ -36,11 +37,12 @@ cert_chain:
36
37
  SHkzay9FVEZoaSs3cElVV2xGbzBpbXJkeUxoZCtKdzNib1ZqM0NtdnloY3dt
37
38
  cG9NMEs5bApBT21yVWlFbFVxTE9aQT09Ci0tLS0tRU5EIENFUlRJRklDQVRF
38
39
  LS0tLS0K
39
- date: 2014-04-16 00:00:00.000000000 Z
40
+ date: 2014-05-12 00:00:00.000000000 Z
40
41
  dependencies:
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: savon
43
44
  requirement: !ruby/object:Gem::Requirement
45
+ none: false
44
46
  requirements:
45
47
  - - ~>
46
48
  - !ruby/object:Gem::Version
@@ -48,6 +50,7 @@ dependencies:
48
50
  type: :runtime
49
51
  prerelease: false
50
52
  version_requirements: !ruby/object:Gem::Requirement
53
+ none: false
51
54
  requirements:
52
55
  - - ~>
53
56
  - !ruby/object:Gem::Version
@@ -55,6 +58,7 @@ dependencies:
55
58
  - !ruby/object:Gem::Dependency
56
59
  name: minitest
57
60
  requirement: !ruby/object:Gem::Requirement
61
+ none: false
58
62
  requirements:
59
63
  - - ~>
60
64
  - !ruby/object:Gem::Version
@@ -62,6 +66,7 @@ dependencies:
62
66
  type: :development
63
67
  prerelease: false
64
68
  version_requirements: !ruby/object:Gem::Requirement
69
+ none: false
65
70
  requirements:
66
71
  - - ~>
67
72
  - !ruby/object:Gem::Version
@@ -69,6 +74,7 @@ dependencies:
69
74
  - !ruby/object:Gem::Dependency
70
75
  name: rdoc
71
76
  requirement: !ruby/object:Gem::Requirement
77
+ none: false
72
78
  requirements:
73
79
  - - ~>
74
80
  - !ruby/object:Gem::Version
@@ -76,6 +82,7 @@ dependencies:
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
85
+ none: false
79
86
  requirements:
80
87
  - - ~>
81
88
  - !ruby/object:Gem::Version
@@ -83,6 +90,7 @@ dependencies:
83
90
  - !ruby/object:Gem::Dependency
84
91
  name: hoe-doofus
85
92
  requirement: !ruby/object:Gem::Requirement
93
+ none: false
86
94
  requirements:
87
95
  - - ~>
88
96
  - !ruby/object:Gem::Version
@@ -90,6 +98,7 @@ dependencies:
90
98
  type: :development
91
99
  prerelease: false
92
100
  version_requirements: !ruby/object:Gem::Requirement
101
+ none: false
93
102
  requirements:
94
103
  - - ~>
95
104
  - !ruby/object:Gem::Version
@@ -97,6 +106,7 @@ dependencies:
97
106
  - !ruby/object:Gem::Dependency
98
107
  name: hoe-gemspec2
99
108
  requirement: !ruby/object:Gem::Requirement
109
+ none: false
100
110
  requirements:
101
111
  - - ~>
102
112
  - !ruby/object:Gem::Version
@@ -104,6 +114,7 @@ dependencies:
104
114
  type: :development
105
115
  prerelease: false
106
116
  version_requirements: !ruby/object:Gem::Requirement
117
+ none: false
107
118
  requirements:
108
119
  - - ~>
109
120
  - !ruby/object:Gem::Version
@@ -111,6 +122,7 @@ dependencies:
111
122
  - !ruby/object:Gem::Dependency
112
123
  name: hoe-git
113
124
  requirement: !ruby/object:Gem::Requirement
125
+ none: false
114
126
  requirements:
115
127
  - - ~>
116
128
  - !ruby/object:Gem::Version
@@ -118,6 +130,7 @@ dependencies:
118
130
  type: :development
119
131
  prerelease: false
120
132
  version_requirements: !ruby/object:Gem::Requirement
133
+ none: false
121
134
  requirements:
122
135
  - - ~>
123
136
  - !ruby/object:Gem::Version
@@ -125,6 +138,7 @@ dependencies:
125
138
  - !ruby/object:Gem::Dependency
126
139
  name: hoe-rubygems
127
140
  requirement: !ruby/object:Gem::Requirement
141
+ none: false
128
142
  requirements:
129
143
  - - ~>
130
144
  - !ruby/object:Gem::Version
@@ -132,6 +146,7 @@ dependencies:
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
149
+ none: false
135
150
  requirements:
136
151
  - - ~>
137
152
  - !ruby/object:Gem::Version
@@ -139,6 +154,7 @@ dependencies:
139
154
  - !ruby/object:Gem::Dependency
140
155
  name: hoe-travis
141
156
  requirement: !ruby/object:Gem::Requirement
157
+ none: false
142
158
  requirements:
143
159
  - - ~>
144
160
  - !ruby/object:Gem::Version
@@ -146,6 +162,7 @@ dependencies:
146
162
  type: :development
147
163
  prerelease: false
148
164
  version_requirements: !ruby/object:Gem::Requirement
165
+ none: false
149
166
  requirements:
150
167
  - - ~>
151
168
  - !ruby/object:Gem::Version
@@ -153,6 +170,7 @@ dependencies:
153
170
  - !ruby/object:Gem::Dependency
154
171
  name: rake
155
172
  requirement: !ruby/object:Gem::Requirement
173
+ none: false
156
174
  requirements:
157
175
  - - ~>
158
176
  - !ruby/object:Gem::Version
@@ -160,6 +178,7 @@ dependencies:
160
178
  type: :development
161
179
  prerelease: false
162
180
  version_requirements: !ruby/object:Gem::Requirement
181
+ none: false
163
182
  requirements:
164
183
  - - ~>
165
184
  - !ruby/object:Gem::Version
@@ -167,6 +186,7 @@ dependencies:
167
186
  - !ruby/object:Gem::Dependency
168
187
  name: simplecov
169
188
  requirement: !ruby/object:Gem::Requirement
189
+ none: false
170
190
  requirements:
171
191
  - - ~>
172
192
  - !ruby/object:Gem::Version
@@ -174,6 +194,7 @@ dependencies:
174
194
  type: :development
175
195
  prerelease: false
176
196
  version_requirements: !ruby/object:Gem::Requirement
197
+ none: false
177
198
  requirements:
178
199
  - - ~>
179
200
  - !ruby/object:Gem::Version
@@ -181,6 +202,7 @@ dependencies:
181
202
  - !ruby/object:Gem::Dependency
182
203
  name: coveralls
183
204
  requirement: !ruby/object:Gem::Requirement
205
+ none: false
184
206
  requirements:
185
207
  - - ~>
186
208
  - !ruby/object:Gem::Version
@@ -188,6 +210,7 @@ dependencies:
188
210
  type: :development
189
211
  prerelease: false
190
212
  version_requirements: !ruby/object:Gem::Requirement
213
+ none: false
191
214
  requirements:
192
215
  - - ~>
193
216
  - !ruby/object:Gem::Version
@@ -195,6 +218,7 @@ dependencies:
195
218
  - !ruby/object:Gem::Dependency
196
219
  name: hoe
197
220
  requirement: !ruby/object:Gem::Requirement
221
+ none: false
198
222
  requirements:
199
223
  - - ~>
200
224
  - !ruby/object:Gem::Version
@@ -202,6 +226,7 @@ dependencies:
202
226
  type: :development
203
227
  prerelease: false
204
228
  version_requirements: !ruby/object:Gem::Requirement
229
+ none: false
205
230
  requirements:
206
231
  - - ~>
207
232
  - !ruby/object:Gem::Version
@@ -218,9 +243,18 @@ description: ! 'MarketoAPI (marketo-api-ruby) provides a native Ruby interface t
218
243
  working with MarketoAPI not feel like working with a hinky Java port.
219
244
 
220
245
 
221
- This is release 0.8, targeting Marketo API version
246
+ This is release 0.9, targeting Marketo API version
222
247
 
223
- {2.3}[http://app.marketo.com/soap/mktows/2_3?WSDL].'
248
+ {2.3}[http://app.marketo.com/soap/mktows/2_3?WSDL], fixing a +syncLead+ problem
249
+
250
+ where +Id+, +Email+, and +ForeignSysPersonId+ are inconsistent with other
251
+
252
+ +syncLead+ parameters.
253
+
254
+
255
+ Please note that Ruby 1.9.2 is not officially supported, but MarketoAPI will
256
+
257
+ install on any version of Ruby 1.9.2 or later.'
224
258
  email:
225
259
  - halostatue@gmail.com
226
260
  executables: []
@@ -232,7 +266,10 @@ extra_rdoc_files:
232
266
  - Manifest.txt
233
267
  - README.rdoc
234
268
  files:
269
+ - .coveralls.yml
235
270
  - .gemtest
271
+ - .hoerc
272
+ - .travis.yml
236
273
  - Contributing.rdoc
237
274
  - Gemfile
238
275
  - History.rdoc
@@ -250,11 +287,6 @@ files:
250
287
  - lib/marketo_api/lists.rb
251
288
  - lib/marketo_api/mobject.rb
252
289
  - lib/marketo_api/mobjects.rb
253
- - spec/marketo/authentication_header_spec.rb
254
- - spec/marketo/client_spec.rb
255
- - spec/marketo/lead_key_spec.rb
256
- - spec/marketo/lead_record_spec.rb
257
- - spec/spec_helper.rb
258
290
  - test/marketo_api/test_campaigns.rb
259
291
  - test/marketo_api/test_client.rb
260
292
  - test/marketo_api/test_lead.rb
@@ -267,7 +299,6 @@ files:
267
299
  homepage: https://github.com/ClearFit/marketo-api-ruby
268
300
  licenses:
269
301
  - MIT
270
- metadata: {}
271
302
  post_install_message:
272
303
  rdoc_options:
273
304
  - --main
@@ -275,20 +306,22 @@ rdoc_options:
275
306
  require_paths:
276
307
  - lib
277
308
  required_ruby_version: !ruby/object:Gem::Requirement
309
+ none: false
278
310
  requirements:
279
311
  - - ! '>='
280
312
  - !ruby/object:Gem::Version
281
313
  version: 1.9.2
282
314
  required_rubygems_version: !ruby/object:Gem::Requirement
315
+ none: false
283
316
  requirements:
284
317
  - - ! '>='
285
318
  - !ruby/object:Gem::Version
286
319
  version: '0'
287
320
  requirements: []
288
321
  rubyforge_project:
289
- rubygems_version: 2.2.2
322
+ rubygems_version: 1.8.23.2
290
323
  signing_key:
291
- specification_version: 4
324
+ specification_version: 3
292
325
  summary: MarketoAPI (marketo-api-ruby) provides a native Ruby interface to the {Marketo
293
326
  SOAP API}[http://developers.marketo.com/documentation/soap/], using {savon}[https://github.com/savonrb/savon]
294
327
  test_files: