restforce-db 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restforce/db/collector.rb +1 -1
- data/lib/restforce/db/version.rb +1 -1
- data/test/cassettes/Restforce_DB_Collector/_run/given_an_existing_Salesforce_record/{returns_the_attributes_from_the_Salesforce_record.yml → which_has_been_synchronized/returns_the_attributes_from_the_Salesforce_record.yml} +72 -48
- data/test/cassettes/Restforce_DB_Collector/_run/given_an_existing_Salesforce_record/which_has_not_been_synchronized/does_not_store_any_attributes.yml +170 -0
- data/test/lib/restforce/db/collector_test.rb +25 -8
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d654a26f7dcf3a36b610fb1df64c96c1cb18cf0d
|
4
|
+
data.tar.gz: 8d2bc3363eaddfc8b716368852d6d849da7b93ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da5b6f83c431404f40886ece5ffc4cccdbe4a944b303d93ebfbb3768bc03da0ffddee231ff8679a1ac4268a9ef05bf693b087aecc9621edcd6dd8622f5a6f7ca
|
7
|
+
data.tar.gz: 15500d13fa9004bc5714df6f54c8d1e5d2ed1ece3cc31a049afe05843064f83ee6c63a1743f67fdc273d16fc8059e423feff3d9d0e416046e09fb0bfd17a248f
|
data/lib/restforce/db/version.rb
CHANGED
@@ -21,10 +21,10 @@ http_interactions:
|
|
21
21
|
message: OK
|
22
22
|
headers:
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Mon, 15 Jun 2015 16:10:41 GMT
|
25
25
|
Set-Cookie:
|
26
|
-
- BrowserId=
|
27
|
-
|
26
|
+
- BrowserId=6sBo_TM_T2-tBueXLpTjvg;Path=/;Domain=.salesforce.com;Expires=Fri,
|
27
|
+
14-Aug-2015 16:10:41 GMT
|
28
28
|
Expires:
|
29
29
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
30
30
|
Pragma:
|
@@ -37,9 +37,9 @@ http_interactions:
|
|
37
37
|
- chunked
|
38
38
|
body:
|
39
39
|
encoding: ASCII-8BIT
|
40
|
-
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"
|
40
|
+
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1434384641907","token_type":"Bearer","instance_url":"https://<host>","signature":"p7yu94exvyNzg2xE4lcpcFLv3oEo2eXNfL96OxU205w=","access_token":"00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s"}'
|
41
41
|
http_version:
|
42
|
-
recorded_at:
|
42
|
+
recorded_at: Mon, 15 Jun 2015 16:10:42 GMT
|
43
43
|
- request:
|
44
44
|
method: post
|
45
45
|
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c
|
@@ -52,39 +52,43 @@ http_interactions:
|
|
52
52
|
Content-Type:
|
53
53
|
- application/json
|
54
54
|
Authorization:
|
55
|
-
- OAuth 00D1a000000H3O9!
|
55
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
56
56
|
Accept-Encoding:
|
57
57
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
58
58
|
Accept:
|
59
59
|
- "*/*"
|
60
|
+
Connection:
|
61
|
+
- keep-alive
|
62
|
+
Keep-Alive:
|
63
|
+
- 30
|
60
64
|
response:
|
61
65
|
status:
|
62
66
|
code: 201
|
63
67
|
message: Created
|
64
68
|
headers:
|
65
69
|
Date:
|
66
|
-
-
|
70
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
67
71
|
Set-Cookie:
|
68
|
-
- BrowserId=
|
69
|
-
|
72
|
+
- BrowserId=bo3QkvtFTq2Tujqq81Wfqg;Path=/;Domain=.salesforce.com;Expires=Fri,
|
73
|
+
14-Aug-2015 16:10:42 GMT
|
70
74
|
Expires:
|
71
75
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
72
76
|
Sforce-Limit-Info:
|
73
|
-
- api-usage=
|
77
|
+
- api-usage=3/15000
|
74
78
|
Location:
|
75
|
-
- "/services/data/<api_version>/sobjects/CustomObject__c/
|
79
|
+
- "/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm88AAA"
|
76
80
|
Content-Type:
|
77
81
|
- application/json;charset=UTF-8
|
78
82
|
Transfer-Encoding:
|
79
83
|
- chunked
|
80
84
|
body:
|
81
85
|
encoding: ASCII-8BIT
|
82
|
-
string: '{"id":"
|
86
|
+
string: '{"id":"a001a000001cm88AAA","success":true,"errors":[]}'
|
83
87
|
http_version:
|
84
|
-
recorded_at:
|
88
|
+
recorded_at: Mon, 15 Jun 2015 16:10:42 GMT
|
85
89
|
- request:
|
86
90
|
method: get
|
87
|
-
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%
|
91
|
+
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c%20where%20Id%20=%20%27a001a000001cm88AAA%27
|
88
92
|
body:
|
89
93
|
encoding: US-ASCII
|
90
94
|
string: ''
|
@@ -92,35 +96,39 @@ http_interactions:
|
|
92
96
|
User-Agent:
|
93
97
|
- Faraday v0.9.1
|
94
98
|
Authorization:
|
95
|
-
- OAuth 00D1a000000H3O9!
|
99
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
96
100
|
Accept-Encoding:
|
97
101
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
98
102
|
Accept:
|
99
103
|
- "*/*"
|
104
|
+
Connection:
|
105
|
+
- keep-alive
|
106
|
+
Keep-Alive:
|
107
|
+
- 30
|
100
108
|
response:
|
101
109
|
status:
|
102
110
|
code: 200
|
103
111
|
message: OK
|
104
112
|
headers:
|
105
113
|
Date:
|
106
|
-
-
|
114
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
107
115
|
Set-Cookie:
|
108
|
-
- BrowserId
|
109
|
-
|
116
|
+
- BrowserId=zBabbH4QR_GN8s7h5EHtpw;Path=/;Domain=.salesforce.com;Expires=Fri,
|
117
|
+
14-Aug-2015 16:10:42 GMT
|
110
118
|
Expires:
|
111
119
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
112
120
|
Sforce-Limit-Info:
|
113
|
-
- api-usage=
|
121
|
+
- api-usage=3/15000
|
114
122
|
Content-Type:
|
115
123
|
- application/json;charset=UTF-8
|
116
124
|
Transfer-Encoding:
|
117
125
|
- chunked
|
118
126
|
body:
|
119
127
|
encoding: ASCII-8BIT
|
120
|
-
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/
|
128
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm88AAA"},"Id":"a001a000001cm88AAA","SystemModstamp":"2015-06-15T16:10:42.000+0000","LastModifiedById":"0051a000000UGT8AAO","Name":"Custom
|
121
129
|
object","Example_Field__c":"Some sample text"}]}'
|
122
130
|
http_version:
|
123
|
-
recorded_at:
|
131
|
+
recorded_at: Mon, 15 Jun 2015 16:10:42 GMT
|
124
132
|
- request:
|
125
133
|
method: get
|
126
134
|
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c
|
@@ -131,35 +139,39 @@ http_interactions:
|
|
131
139
|
User-Agent:
|
132
140
|
- Faraday v0.9.1
|
133
141
|
Authorization:
|
134
|
-
- OAuth 00D1a000000H3O9!
|
142
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
135
143
|
Accept-Encoding:
|
136
144
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
137
145
|
Accept:
|
138
146
|
- "*/*"
|
147
|
+
Connection:
|
148
|
+
- keep-alive
|
149
|
+
Keep-Alive:
|
150
|
+
- 30
|
139
151
|
response:
|
140
152
|
status:
|
141
153
|
code: 200
|
142
154
|
message: OK
|
143
155
|
headers:
|
144
156
|
Date:
|
145
|
-
-
|
157
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
146
158
|
Set-Cookie:
|
147
|
-
- BrowserId=
|
148
|
-
|
159
|
+
- BrowserId=8flibHNeQQKqNiE6OdFS7w;Path=/;Domain=.salesforce.com;Expires=Fri,
|
160
|
+
14-Aug-2015 16:10:42 GMT
|
149
161
|
Expires:
|
150
162
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
151
163
|
Sforce-Limit-Info:
|
152
|
-
- api-usage=
|
164
|
+
- api-usage=3/15000
|
153
165
|
Content-Type:
|
154
166
|
- application/json;charset=UTF-8
|
155
167
|
Transfer-Encoding:
|
156
168
|
- chunked
|
157
169
|
body:
|
158
170
|
encoding: ASCII-8BIT
|
159
|
-
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/
|
171
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm88AAA"},"Id":"a001a000001cm88AAA","SystemModstamp":"2015-06-15T16:10:42.000+0000","LastModifiedById":"0051a000000UGT8AAO","Name":"Custom
|
160
172
|
object","Example_Field__c":"Some sample text"}]}'
|
161
173
|
http_version:
|
162
|
-
recorded_at:
|
174
|
+
recorded_at: Mon, 15 Jun 2015 16:10:42 GMT
|
163
175
|
- request:
|
164
176
|
method: get
|
165
177
|
uri: https://<host>/services/data/<api_version>/
|
@@ -170,34 +182,38 @@ http_interactions:
|
|
170
182
|
User-Agent:
|
171
183
|
- Faraday v0.9.1
|
172
184
|
Authorization:
|
173
|
-
- OAuth 00D1a000000H3O9!
|
185
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
174
186
|
Accept-Encoding:
|
175
187
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
176
188
|
Accept:
|
177
189
|
- "*/*"
|
190
|
+
Connection:
|
191
|
+
- keep-alive
|
192
|
+
Keep-Alive:
|
193
|
+
- 30
|
178
194
|
response:
|
179
195
|
status:
|
180
196
|
code: 200
|
181
197
|
message: OK
|
182
198
|
headers:
|
183
199
|
Date:
|
184
|
-
-
|
200
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
185
201
|
Set-Cookie:
|
186
|
-
- BrowserId=
|
187
|
-
|
202
|
+
- BrowserId=5kCRT0onQxGgmhPhwUFR8g;Path=/;Domain=.salesforce.com;Expires=Fri,
|
203
|
+
14-Aug-2015 16:10:42 GMT
|
188
204
|
Expires:
|
189
205
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
190
206
|
Sforce-Limit-Info:
|
191
|
-
- api-usage=
|
207
|
+
- api-usage=3/15000
|
192
208
|
Content-Type:
|
193
209
|
- application/json;charset=UTF-8
|
194
210
|
Transfer-Encoding:
|
195
211
|
- chunked
|
196
212
|
body:
|
197
213
|
encoding: ASCII-8BIT
|
198
|
-
string: '{"limits":"/services/data/<api_version>/limits","sobjects":"/services/data/<api_version>/sobjects","connect":"/services/data/<api_version>/connect","query":"/services/data/<api_version>/query","theme":"/services/data/<api_version>/theme","queryAll":"/services/data/<api_version>/queryAll","tooling":"/services/data/<api_version>/tooling","chatter":"/services/data/<api_version>/chatter","analytics":"/services/data/<api_version>/analytics","recent":"/services/data/<api_version>/recent","commerce":"/services/data/<api_version>/commerce","licensing":"/services/data/<api_version>/licensing","identity":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","flexiPage":"/services/data/<api_version>/flexiPage","search":"/services/data/<api_version>/search","quickActions":"/services/data/<api_version>/quickActions","appMenu":"/services/data/<api_version>/appMenu"}'
|
214
|
+
string: '{"limits":"/services/data/<api_version>/limits","sobjects":"/services/data/<api_version>/sobjects","connect":"/services/data/<api_version>/connect","query":"/services/data/<api_version>/query","theme":"/services/data/<api_version>/theme","queryAll":"/services/data/<api_version>/queryAll","tooling":"/services/data/<api_version>/tooling","chatter":"/services/data/<api_version>/chatter","analytics":"/services/data/<api_version>/analytics","recent":"/services/data/<api_version>/recent","commerce":"/services/data/<api_version>/commerce","licensing":"/services/data/<api_version>/licensing","identity":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","flexiPage":"/services/data/<api_version>/flexiPage","search":"/services/data/<api_version>/search","quickActions":"/services/data/<api_version>/quickActions","wave":"/services/data/<api_version>/wave","appMenu":"/services/data/<api_version>/appMenu"}'
|
199
215
|
http_version:
|
200
|
-
recorded_at:
|
216
|
+
recorded_at: Mon, 15 Jun 2015 16:10:42 GMT
|
201
217
|
- request:
|
202
218
|
method: get
|
203
219
|
uri: https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO
|
@@ -208,22 +224,26 @@ http_interactions:
|
|
208
224
|
User-Agent:
|
209
225
|
- Faraday v0.9.1
|
210
226
|
Authorization:
|
211
|
-
- OAuth 00D1a000000H3O9!
|
227
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
212
228
|
Accept-Encoding:
|
213
229
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
214
230
|
Accept:
|
215
231
|
- "*/*"
|
232
|
+
Connection:
|
233
|
+
- keep-alive
|
234
|
+
Keep-Alive:
|
235
|
+
- 30
|
216
236
|
response:
|
217
237
|
status:
|
218
238
|
code: 200
|
219
239
|
message: OK
|
220
240
|
headers:
|
221
241
|
Date:
|
222
|
-
-
|
223
|
-
-
|
242
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
243
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
224
244
|
Set-Cookie:
|
225
|
-
- BrowserId=
|
226
|
-
|
245
|
+
- BrowserId=ov3ZUs7SQICPbmYozzKPJw;Path=/;Domain=.salesforce.com;Expires=Fri,
|
246
|
+
14-Aug-2015 16:10:42 GMT
|
227
247
|
Expires:
|
228
248
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
229
249
|
Content-Type:
|
@@ -235,10 +255,10 @@ http_interactions:
|
|
235
255
|
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","asserted_user":true,"user_id":"0051a000000UGT8AAO","organization_id":"00D1a000000H3O9EAK","username":"andrew+salesforce@tablexi.com","nick_name":"andrew+salesforce1.42656567106328E12","display_name":"Andrew
|
236
256
|
Horner","email":"andrew@tablexi.com","email_verified":true,"first_name":"Andrew","last_name":"Horner","timezone":"America/Los_Angeles","photos":{"picture":"https://c.na24.content.force.com/profilephoto/005/F","thumbnail":"https://c.na24.content.force.com/profilephoto/005/T"},"addr_street":null,"addr_city":null,"addr_state":null,"addr_country":"US","addr_zip":"60661","mobile_phone":null,"mobile_phone_verified":false,"status":{"created_date":null,"body":null},"urls":{"enterprise":"https://<host>/services/Soap/c/{version}/00D1a000000H3O9","metadata":"https://<host>/services/Soap/m/{version}/00D1a000000H3O9","partner":"https://<host>/services/Soap/u/{version}/00D1a000000H3O9","rest":"https://<host>/services/data/v{version}/","sobjects":"https://<host>/services/data/v{version}/sobjects/","search":"https://<host>/services/data/v{version}/search/","query":"https://<host>/services/data/v{version}/query/","recent":"https://<host>/services/data/v{version}/recent/","profile":"https://<host>/0051a000000UGT8AAO","feeds":"https://<host>/services/data/v{version}/chatter/feeds","groups":"https://<host>/services/data/v{version}/chatter/groups","users":"https://<host>/services/data/v{version}/chatter/users","feed_items":"https://<host>/services/data/v{version}/chatter/feed-items"},"active":true,"user_type":"STANDARD","language":"en_US","locale":"en_US","utcOffset":-28800000,"last_modified_date":"2015-03-17T04:14:23.000+0000","is_app_installed":true}'
|
237
257
|
http_version:
|
238
|
-
recorded_at:
|
258
|
+
recorded_at: Mon, 15 Jun 2015 16:10:43 GMT
|
239
259
|
- request:
|
240
260
|
method: delete
|
241
|
-
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/
|
261
|
+
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm88AAA
|
242
262
|
body:
|
243
263
|
encoding: US-ASCII
|
244
264
|
string: ''
|
@@ -246,28 +266,32 @@ http_interactions:
|
|
246
266
|
User-Agent:
|
247
267
|
- Faraday v0.9.1
|
248
268
|
Authorization:
|
249
|
-
- OAuth 00D1a000000H3O9!
|
269
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
250
270
|
Accept-Encoding:
|
251
271
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
252
272
|
Accept:
|
253
273
|
- "*/*"
|
274
|
+
Connection:
|
275
|
+
- keep-alive
|
276
|
+
Keep-Alive:
|
277
|
+
- 30
|
254
278
|
response:
|
255
279
|
status:
|
256
280
|
code: 204
|
257
281
|
message: No Content
|
258
282
|
headers:
|
259
283
|
Date:
|
260
|
-
-
|
284
|
+
- Mon, 15 Jun 2015 16:10:42 GMT
|
261
285
|
Set-Cookie:
|
262
|
-
- BrowserId=
|
263
|
-
|
286
|
+
- BrowserId=AMADcIxxRj2HlMrwv_pN1Q;Path=/;Domain=.salesforce.com;Expires=Fri,
|
287
|
+
14-Aug-2015 16:10:42 GMT
|
264
288
|
Expires:
|
265
289
|
- Thu, 01 Jan 1970 00:00:00 GMT
|
266
290
|
Sforce-Limit-Info:
|
267
|
-
- api-usage=
|
291
|
+
- api-usage=3/15000
|
268
292
|
body:
|
269
293
|
encoding: UTF-8
|
270
294
|
string: ''
|
271
295
|
http_version:
|
272
|
-
recorded_at:
|
296
|
+
recorded_at: Mon, 15 Jun 2015 16:10:43 GMT
|
273
297
|
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,170 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://<host>/services/oauth2/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=password&client_id=<client_id>&client_secret=<client_secret>&username=<username>&password=<password><security_token>
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.1
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Mon, 15 Jun 2015 16:10:39 GMT
|
25
|
+
Set-Cookie:
|
26
|
+
- BrowserId=dzP_F529QR-sBiPtEH7iSA;Path=/;Domain=.salesforce.com;Expires=Fri,
|
27
|
+
14-Aug-2015 16:10:39 GMT
|
28
|
+
Expires:
|
29
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
30
|
+
Pragma:
|
31
|
+
- no-cache
|
32
|
+
Cache-Control:
|
33
|
+
- no-cache, no-store
|
34
|
+
Content-Type:
|
35
|
+
- application/json;charset=UTF-8
|
36
|
+
Transfer-Encoding:
|
37
|
+
- chunked
|
38
|
+
body:
|
39
|
+
encoding: ASCII-8BIT
|
40
|
+
string: '{"id":"https://login.salesforce.com/id/00D1a000000H3O9EAK/0051a000000UGT8AAO","issued_at":"1434384639681","token_type":"Bearer","instance_url":"https://<host>","signature":"lxT8T2aK3/4NeVGP9ky8XUVegH5JQUWnPbylKKkHyjo=","access_token":"00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s"}'
|
41
|
+
http_version:
|
42
|
+
recorded_at: Mon, 15 Jun 2015 16:10:40 GMT
|
43
|
+
- request:
|
44
|
+
method: post
|
45
|
+
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c
|
46
|
+
body:
|
47
|
+
encoding: UTF-8
|
48
|
+
string: '{"Name":"Custom object","Example_Field__c":"Some sample text"}'
|
49
|
+
headers:
|
50
|
+
User-Agent:
|
51
|
+
- Faraday v0.9.1
|
52
|
+
Content-Type:
|
53
|
+
- application/json
|
54
|
+
Authorization:
|
55
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
56
|
+
Accept-Encoding:
|
57
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
58
|
+
Accept:
|
59
|
+
- "*/*"
|
60
|
+
Connection:
|
61
|
+
- keep-alive
|
62
|
+
Keep-Alive:
|
63
|
+
- 30
|
64
|
+
response:
|
65
|
+
status:
|
66
|
+
code: 201
|
67
|
+
message: Created
|
68
|
+
headers:
|
69
|
+
Date:
|
70
|
+
- Mon, 15 Jun 2015 16:10:39 GMT
|
71
|
+
Set-Cookie:
|
72
|
+
- BrowserId=VHJSda59TRGmlXsYzZMVew;Path=/;Domain=.salesforce.com;Expires=Fri,
|
73
|
+
14-Aug-2015 16:10:39 GMT
|
74
|
+
Expires:
|
75
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
76
|
+
Sforce-Limit-Info:
|
77
|
+
- api-usage=3/15000
|
78
|
+
Location:
|
79
|
+
- "/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm83AAA"
|
80
|
+
Content-Type:
|
81
|
+
- application/json;charset=UTF-8
|
82
|
+
Transfer-Encoding:
|
83
|
+
- chunked
|
84
|
+
body:
|
85
|
+
encoding: ASCII-8BIT
|
86
|
+
string: '{"id":"a001a000001cm83AAA","success":true,"errors":[]}'
|
87
|
+
http_version:
|
88
|
+
recorded_at: Mon, 15 Jun 2015 16:10:40 GMT
|
89
|
+
- request:
|
90
|
+
method: get
|
91
|
+
uri: https://<host>/services/data/<api_version>/query?q=select%20Id,%20SystemModstamp,%20LastModifiedById,%20Name,%20Example_Field__c%20from%20CustomObject__c
|
92
|
+
body:
|
93
|
+
encoding: US-ASCII
|
94
|
+
string: ''
|
95
|
+
headers:
|
96
|
+
User-Agent:
|
97
|
+
- Faraday v0.9.1
|
98
|
+
Authorization:
|
99
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
100
|
+
Accept-Encoding:
|
101
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
102
|
+
Accept:
|
103
|
+
- "*/*"
|
104
|
+
Connection:
|
105
|
+
- keep-alive
|
106
|
+
Keep-Alive:
|
107
|
+
- 30
|
108
|
+
response:
|
109
|
+
status:
|
110
|
+
code: 200
|
111
|
+
message: OK
|
112
|
+
headers:
|
113
|
+
Date:
|
114
|
+
- Mon, 15 Jun 2015 16:10:40 GMT
|
115
|
+
Set-Cookie:
|
116
|
+
- BrowserId=kGPZafRpTuKvcK0-QYNtFQ;Path=/;Domain=.salesforce.com;Expires=Fri,
|
117
|
+
14-Aug-2015 16:10:40 GMT
|
118
|
+
Expires:
|
119
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
120
|
+
Sforce-Limit-Info:
|
121
|
+
- api-usage=3/15000
|
122
|
+
Content-Type:
|
123
|
+
- application/json;charset=UTF-8
|
124
|
+
Transfer-Encoding:
|
125
|
+
- chunked
|
126
|
+
body:
|
127
|
+
encoding: ASCII-8BIT
|
128
|
+
string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"CustomObject__c","url":"/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm83AAA"},"Id":"a001a000001cm83AAA","SystemModstamp":"2015-06-15T16:10:39.000+0000","LastModifiedById":"0051a000000UGT8AAO","Name":"Custom
|
129
|
+
object","Example_Field__c":"Some sample text"}]}'
|
130
|
+
http_version:
|
131
|
+
recorded_at: Mon, 15 Jun 2015 16:10:40 GMT
|
132
|
+
- request:
|
133
|
+
method: delete
|
134
|
+
uri: https://<host>/services/data/<api_version>/sobjects/CustomObject__c/a001a000001cm83AAA
|
135
|
+
body:
|
136
|
+
encoding: US-ASCII
|
137
|
+
string: ''
|
138
|
+
headers:
|
139
|
+
User-Agent:
|
140
|
+
- Faraday v0.9.1
|
141
|
+
Authorization:
|
142
|
+
- OAuth 00D1a000000H3O9!AQ4AQAaHttmaq61w16eyINC0d2fYjByWdZ3nscOFKCC7bHt9ooYjoQJKYpsHaWtJ9d0jDhi0T6Hu7vMwBzun8zg14ADt0U9s
|
143
|
+
Accept-Encoding:
|
144
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
145
|
+
Accept:
|
146
|
+
- "*/*"
|
147
|
+
Connection:
|
148
|
+
- keep-alive
|
149
|
+
Keep-Alive:
|
150
|
+
- 30
|
151
|
+
response:
|
152
|
+
status:
|
153
|
+
code: 204
|
154
|
+
message: No Content
|
155
|
+
headers:
|
156
|
+
Date:
|
157
|
+
- Mon, 15 Jun 2015 16:10:40 GMT
|
158
|
+
Set-Cookie:
|
159
|
+
- BrowserId=0xfjARNuQSCukFfcouHzFw;Path=/;Domain=.salesforce.com;Expires=Fri,
|
160
|
+
14-Aug-2015 16:10:40 GMT
|
161
|
+
Expires:
|
162
|
+
- Thu, 01 Jan 1970 00:00:00 GMT
|
163
|
+
Sforce-Limit-Info:
|
164
|
+
- api-usage=3/15000
|
165
|
+
body:
|
166
|
+
encoding: UTF-8
|
167
|
+
string: ''
|
168
|
+
http_version:
|
169
|
+
recorded_at: Mon, 15 Jun 2015 16:10:41 GMT
|
170
|
+
recorded_with: VCR 2.9.3
|
@@ -22,15 +22,32 @@ describe Restforce::DB::Collector do
|
|
22
22
|
describe "given an existing Salesforce record" do
|
23
23
|
before { salesforce_id }
|
24
24
|
|
25
|
-
|
26
|
-
record = mapping.salesforce_record_type.find(salesforce_id)
|
25
|
+
describe "which has not been synchronized" do
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
it "does not store any attributes" do
|
28
|
+
expect(subject[key]).to_be :empty?
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "which has been synchronized" do
|
33
|
+
let(:database_metadata) { { salesforce_id: salesforce_id, synchronized_at: Time.now + 1 } }
|
34
|
+
let(:database_record) do
|
35
|
+
database_attributes = mapping.convert(database_model, attributes)
|
36
|
+
database_model.create!(database_attributes.merge(database_metadata))
|
37
|
+
end
|
38
|
+
|
39
|
+
before { database_record }
|
40
|
+
|
41
|
+
it "returns the attributes from the Salesforce record" do
|
42
|
+
record = mapping.salesforce_record_type.find(salesforce_id)
|
43
|
+
|
44
|
+
expect(subject[key]).to_equal(
|
45
|
+
record.last_update => {
|
46
|
+
"Name" => attributes["Name"],
|
47
|
+
"Example_Field__c" => attributes["Example_Field__c"],
|
48
|
+
},
|
49
|
+
)
|
50
|
+
end
|
34
51
|
end
|
35
52
|
end
|
36
53
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restforce-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Horner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -299,7 +299,8 @@ files:
|
|
299
299
|
- test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_record_has_been_deleted_in_Salesforce/drops_the_synchronized_database_record.yml
|
300
300
|
- test/cassettes/Restforce_DB_Cleaner/_run/given_a_synchronized_Salesforce_record/when_the_record_meets_the_mapping_conditions/does_not_drop_the_synchronized_database_record.yml
|
301
301
|
- test/cassettes/Restforce_DB_Collector/_run/given_a_Salesforce_record_with_an_associated_database_record/returns_the_attributes_from_both_records.yml
|
302
|
-
- test/cassettes/Restforce_DB_Collector/_run/given_an_existing_Salesforce_record/returns_the_attributes_from_the_Salesforce_record.yml
|
302
|
+
- test/cassettes/Restforce_DB_Collector/_run/given_an_existing_Salesforce_record/which_has_been_synchronized/returns_the_attributes_from_the_Salesforce_record.yml
|
303
|
+
- test/cassettes/Restforce_DB_Collector/_run/given_an_existing_Salesforce_record/which_has_not_been_synchronized/does_not_store_any_attributes.yml
|
303
304
|
- test/cassettes/Restforce_DB_Collector/_run/given_an_existing_database_record/returns_the_attributes_from_the_database_record.yml
|
304
305
|
- test/cassettes/Restforce_DB_Collector/_run/when_the_record_has_not_been_updated_outside_of_the_system/does_not_collect_any_changes.yml
|
305
306
|
- test/cassettes/Restforce_DB_Initializer/_run/given_an_existing_Salesforce_record/for_a_Passive_strategy/does_not_create_a_database_record.yml
|