leap_salesforce 0.1.16 → 0.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/.rakeTasks +2 -2
- data/.idea/leap-salesforce.iml +4 -4
- data/.leap_salesforce.yml +1 -1
- data/ChangeLog +4 -0
- data/README.md +173 -19
- data/leap_salesforce.gemspec +1 -1
- data/lib/leap_salesforce/soql_data/soql_global_object_data.rb +6 -3
- data/lib/leap_salesforce/soql_data/soql_handler.rb +3 -0
- data/lib/leap_salesforce/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 455d4ec9852a5afd9bf82cbe504b755fee025025ff3a7ad35d958ca944ea89cd
|
4
|
+
data.tar.gz: 304a5f93081a5e65fff63b34ce61a8cb0f4a8ed90e71d4ef9947a57eb8155562
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfa00811dd445829c140a9980353c32b8568feb47c3caa37a8e950426b7b31c1ac00bb333ac1707861271b21684d770892263061c7cddc7f0c2d3cf22b553c8a
|
7
|
+
data.tar.gz: b48b467b870cf0b239d39ce648d2ed7b7cc5d4762c9c9bb6668f89a92b4a5a298535e6a08d12e8c3baedc1de13717952b886926a8eb2df35d0052e971aace28c
|
data/.idea/.rakeTasks
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
3
|
You are allowed to:
|
4
4
|
1. Remove rake task
|
5
5
|
2. Add existing rake tasks
|
6
6
|
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
-
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build leap_salesforce-0.1.16.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Check Salesforce OAuth2 authentication is working" fullCmd="check_oauth" taksId="check_oauth" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install leap_salesforce-0.1.16.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install leap_salesforce-0.1.16.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="leaps"><RakeTask description="Create objects, fields, enums" fullCmd="leaps:create_all" taksId="create_all" /><RakeTask description="Create Enumeration objects for picklists from Salesforce Metadata" fullCmd="leaps:create_enums" taksId="create_enums" /><RakeTask description="Create Soql Data objects" fullCmd="leaps:create_soql_objects" taksId="create_soql_objects" /></RakeGroup><RakeTask description="Create tag v0.1.16 and build and push leap_salesforce-0.1.16.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="Create stubs for dynamic methods so they're picked up by the IDE" fullCmd="stub" taksId="stub" /><RakeGroup description="" fullCmd="" taksId="yard"><RakeTask description="Run YARD doctests" fullCmd="yard:doctest" taksId="doctest" /></RakeGroup><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build leap_salesforce-0.1.16.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Check Salesforce OAuth2 authentication is working" fullCmd="check_oauth" taksId="check_oauth" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install leap_salesforce-0.1.16.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install leap_salesforce-0.1.16.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeGroup description="" fullCmd="" taksId="leaps"><RakeTask description="Create objects, fields, enums" fullCmd="leaps:create_all" taksId="create_all" /><RakeTask description="Create Enumeration objects for picklists from Salesforce Metadata" fullCmd="leaps:create_enums" taksId="create_enums" /><RakeTask description="Create Soql Data objects" fullCmd="leaps:create_soql_objects" taksId="create_soql_objects" /></RakeGroup><RakeTask description="Create tag v0.1.16 and build and push leap_salesforce-0.1.16.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="Create stubs for dynamic methods so they're picked up by the IDE" fullCmd="stub" taksId="stub" /><RakeGroup description="" fullCmd="" taksId="yard"><RakeTask description="Run YARD doctests" fullCmd="yard:doctest" taksId="doctest" /></RakeGroup><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/.idea/leap-salesforce.iml
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, RVM: ruby-2.6.0) [gem]" level="application" />
|
23
23
|
<orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, RVM: ruby-2.6.0) [gem]" level="application" />
|
24
24
|
<orderEntry type="library" scope="PROVIDED" name="factory_bot (v5.0.2, RVM: ruby-2.6.0) [gem]" level="application" />
|
25
|
-
<orderEntry type="library" scope="PROVIDED" name="faker (v2.1.
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="faker (v2.1.2, RVM: ruby-2.6.0) [gem]" level="application" />
|
26
26
|
<orderEntry type="library" scope="PROVIDED" name="gyoku (v1.3.1, RVM: ruby-2.6.0) [gem]" level="application" />
|
27
27
|
<orderEntry type="library" scope="PROVIDED" name="hashie (v3.6.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
28
28
|
<orderEntry type="library" scope="PROVIDED" name="http-cookie (v1.0.3, RVM: ruby-2.6.0) [gem]" level="application" />
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.13.1, RVM: ruby-2.6.0) [gem]" level="application" />
|
42
42
|
<orderEntry type="library" scope="PROVIDED" name="mustermann (v1.0.3, RVM: ruby-2.6.0) [gem]" level="application" />
|
43
43
|
<orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
44
|
-
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.10.
|
44
|
+
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.10.4, RVM: ruby-2.6.0) [gem]" level="application" />
|
45
45
|
<orderEntry type="library" scope="PROVIDED" name="nori (v2.6.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
46
46
|
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.17.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
47
47
|
<orderEntry type="library" scope="PROVIDED" name="parser (v2.6.3.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
@@ -51,7 +51,7 @@
|
|
51
51
|
<orderEntry type="library" scope="PROVIDED" name="rack-protection (v2.0.4, RVM: ruby-2.6.0) [gem]" level="application" />
|
52
52
|
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
53
53
|
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, RVM: ruby-2.6.0) [gem]" level="application" />
|
54
|
-
<orderEntry type="library" scope="PROVIDED" name="random-port (v0.3.
|
54
|
+
<orderEntry type="library" scope="PROVIDED" name="random-port (v0.3.2, RVM: ruby-2.6.0) [gem]" level="application" />
|
55
55
|
<orderEntry type="library" scope="PROVIDED" name="require_all (v2.0.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
56
56
|
<orderEntry type="library" scope="PROVIDED" name="rest-client (v2.0.2, RVM: ruby-2.6.0) [gem]" level="application" />
|
57
57
|
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.8.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
@@ -67,7 +67,7 @@
|
|
67
67
|
<orderEntry type="library" scope="PROVIDED" name="sinatra (v2.0.4, RVM: ruby-2.6.0) [gem]" level="application" />
|
68
68
|
<orderEntry type="library" scope="PROVIDED" name="sinatra-basic-auth (v0.1.0, RVM: ruby-2.6.0) [gem]" level="application" />
|
69
69
|
<orderEntry type="library" scope="PROVIDED" name="sinatra-docdsl (v0.8.6, RVM: ruby-2.6.0) [gem]" level="application" />
|
70
|
-
<orderEntry type="library" scope="PROVIDED" name="soaspec (v0.2.
|
70
|
+
<orderEntry type="library" scope="PROVIDED" name="soaspec (v0.2.30, RVM: ruby-2.6.0) [gem]" level="application" />
|
71
71
|
<orderEntry type="library" scope="PROVIDED" name="socksify (v1.7.1, RVM: ruby-2.6.0) [gem]" level="application" />
|
72
72
|
<orderEntry type="library" scope="PROVIDED" name="thor (v0.20.3, RVM: ruby-2.6.0) [gem]" level="application" />
|
73
73
|
<orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.6, RVM: ruby-2.6.0) [gem]" level="application" />
|
data/.leap_salesforce.yml
CHANGED
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -7,6 +7,35 @@ In the future it will also planned to be used to create page objects based on me
|
|
7
7
|
|
8
8
|
[![Build Status](https://gitlab.com/leap-dojo/leap_salesforce/badges/master/build.svg)](https://gitlab.com/leap-dojo/leap_salesforce/pipelines)
|
9
9
|
|
10
|
+
## Table of Contents
|
11
|
+
|
12
|
+
* [LeapSalesforce](#leapsalesforce)
|
13
|
+
* [Table of Contents](#table-of-contents)
|
14
|
+
* [Installation](#installation)
|
15
|
+
* [Usage](#usage)
|
16
|
+
* [Getting started](#getting-started)
|
17
|
+
* [Understanding how things work](#understanding-how-things-work)
|
18
|
+
* [Important files](#important-files)
|
19
|
+
* [.leap_salesforce.yml](#leap_salesforceyml)
|
20
|
+
* [salesforce_oauth2.yml](#salesforce_oauth2yml)
|
21
|
+
* [config/general.rb](#configgeneralrb)
|
22
|
+
* [Test Users](#test-users)
|
23
|
+
* [CRUD of data](#crud-of-data)
|
24
|
+
* [Creating entities](#creating-entities)
|
25
|
+
* [Reading entities](#reading-entities)
|
26
|
+
* [Retrieving entities](#retrieving-entities)
|
27
|
+
* [Retrieving the value of a field](#retrieving-the-value-of-a-field)
|
28
|
+
* [Updating entities](#updating-entities)
|
29
|
+
* [Deleting entities](#deleting-entities)
|
30
|
+
* [Other Examples](#other-examples)
|
31
|
+
* [Structure](#structure)
|
32
|
+
* [Docs](#docs)
|
33
|
+
* [Development](#development)
|
34
|
+
* [Contributing](#contributing)
|
35
|
+
* [License](#license)
|
36
|
+
* [Code of Conduct](#code-of-conduct)
|
37
|
+
* [References](#references)
|
38
|
+
|
10
39
|
> Note this documentation is a work in progress. Look at `spec` for code examples.
|
11
40
|
|
12
41
|
## Installation
|
@@ -114,7 +143,7 @@ LeapSalesforce.api_user = LeapSalesforce::Users.where username: /admin/
|
|
114
143
|
LeapSalesforce.api_user = LeapSalesforce::Users.where description: /System Admin/
|
115
144
|
```
|
116
145
|
|
117
|
-
|
146
|
+
### CRUD of data
|
118
147
|
|
119
148
|
To work data in Salesforce, an object inheriting from the `SoqlData` class is always used. The idea is
|
120
149
|
that an object in Ruby code maps to the object in Salesforce and requests and updates to this object
|
@@ -137,7 +166,7 @@ end
|
|
137
166
|
For all interactions with Salesforce the API traffic logs are recorded in a log created in the `logs`
|
138
167
|
folder of the suite.
|
139
168
|
|
140
|
-
|
169
|
+
#### Creating entities
|
141
170
|
|
142
171
|
There are several ways entities can be created. By instantiating the object with the `new` method a new
|
143
172
|
object will be created in memory but in Salesforce. Only when the `save!` method is called will an object
|
@@ -201,8 +230,8 @@ example:
|
|
201
230
|
@contact = Contact.create
|
202
231
|
```
|
203
232
|
|
204
|
-
|
205
|
-
|
233
|
+
#### Reading entities
|
234
|
+
##### Retrieving entities
|
206
235
|
To retrieve an entity, the `find` method can be called on the class for the object required. For example
|
207
236
|
to obtain an object representing a contact with a last name of 'Test Person' we could do:
|
208
237
|
|
@@ -210,6 +239,145 @@ to obtain an object representing a contact with a last name of 'Test Person' we
|
|
210
239
|
@contact = Contact.find last_name: 'Test Person'
|
211
240
|
```
|
212
241
|
|
242
|
+
This uses the ruby friendly method defined for `Contact` and shown in `Contact::Fields` to extract
|
243
|
+
the Salesforce field name `LastName`. Note, the name designated is derived from the `label` name which
|
244
|
+
is assumed to be more user friendly than the backend name. See `spec/unit/ext/string_spec.rb` for
|
245
|
+
examples of how different behaviours are handled.
|
246
|
+
The backend name can also be used directly within a `find` so
|
247
|
+
the following could also be done:
|
248
|
+
|
249
|
+
```ruby
|
250
|
+
@contact = Contact.find LastName: 'Test Person'
|
251
|
+
```
|
252
|
+
|
253
|
+
The values used in these requests are validated against Metadata before the request is made so an
|
254
|
+
error will be received if a field name is used that does not exist on the object.
|
255
|
+
|
256
|
+
Any number of parameters can be passed to the find method to narrow the search. For example:
|
257
|
+
|
258
|
+
```ruby
|
259
|
+
@contact = Contact.find last_name: 'Test Person', first_name: 'Number 1'
|
260
|
+
```
|
261
|
+
|
262
|
+
When a date is passed as the value it will be automatically formatted so that it can be used in the
|
263
|
+
backend SOQL query. So to get a contact created less than 5 days ago one can use:
|
264
|
+
|
265
|
+
```ruby
|
266
|
+
@contact = Contact.find created_date: "<#{5.days.ago}"
|
267
|
+
```
|
268
|
+
|
269
|
+
To use the `LIKE` operator for partial matches put a '`' at the start of the string. Following is an
|
270
|
+
example of finding a contact that has the string 'Test' anywhere in their first name. As one can see
|
271
|
+
the '%' symbols are used as a wild card to indicate any value.
|
272
|
+
|
273
|
+
```ruby
|
274
|
+
@contact = Contact.find(first_name: '~%Test%')
|
275
|
+
```
|
276
|
+
|
277
|
+
Note for non unique criterion, the value returned will be the most recent one.
|
278
|
+
|
279
|
+
##### Retrieving the value of a field
|
280
|
+
|
281
|
+
Getters (methods that retrieve something about an object) are created for each field name on an object.
|
282
|
+
So to get the first name of the contact, the `first_name` method is simply called on it.
|
283
|
+
|
284
|
+
```ruby
|
285
|
+
@contact = Contact.find first_name: 'Test Person'
|
286
|
+
@contact.first_name # => 'Test Person'
|
287
|
+
```
|
288
|
+
|
289
|
+
The backend name can also be used in the `[]` method to retrieve a value.
|
290
|
+
|
291
|
+
```ruby
|
292
|
+
@contact['FirstName'] # => 'Test Person'
|
293
|
+
```
|
294
|
+
|
295
|
+
There are 2 special methods related to verifying that a response is successful or not.
|
296
|
+
|
297
|
+
* `success` - returns `true` or `false` indicating whether the previous action performed worked
|
298
|
+
as expected
|
299
|
+
* `error_message` - returns a string with the error message returned from Salesforce.
|
300
|
+
|
301
|
+
For example, say you want to test that a `LineItem` cannot be deleted. You can verify it and it's
|
302
|
+
error message with:
|
303
|
+
|
304
|
+
```ruby
|
305
|
+
item = LineItem.find status: 'New'
|
306
|
+
expect(item.delete.error_message).to eq 'Deleting of line item is not allowed.'
|
307
|
+
```
|
308
|
+
|
309
|
+
#### Updating entities
|
310
|
+
|
311
|
+
The same field name used above is used as a setter to update an individual field. For example, to
|
312
|
+
change the first name of a contact from Test1 to Test2:
|
313
|
+
|
314
|
+
```ruby
|
315
|
+
@contact = Contact.find first_name: 'Test1'
|
316
|
+
@contact.first_name = 'Test2'
|
317
|
+
```
|
318
|
+
|
319
|
+
To update multiple fields at once, use the `update` method:
|
320
|
+
|
321
|
+
```ruby
|
322
|
+
@case.update status: Case::Status.escalated, case_reason: 'Feedback'
|
323
|
+
```
|
324
|
+
|
325
|
+
This does not fail if the update is not successful. To fail in this situation, the `success_update`
|
326
|
+
method can be used:
|
327
|
+
|
328
|
+
```ruby
|
329
|
+
@case.success_update status: Case::Status.escalated, case_reason: 'Feedback'
|
330
|
+
```
|
331
|
+
|
332
|
+
If the main action of the test is this update, it is recommended that success be verified
|
333
|
+
explicitly with:
|
334
|
+
|
335
|
+
```ruby
|
336
|
+
@case.update status: Case::Status.escalated, case_reason: 'Feedback'
|
337
|
+
expect(@case).to be_successful
|
338
|
+
```
|
339
|
+
|
340
|
+
The reason for this is to account for error scenarios where you want to update a value and expect
|
341
|
+
and error message. For example:
|
342
|
+
|
343
|
+
```ruby
|
344
|
+
item = LineItem.find(status: 'New')
|
345
|
+
update = item.update owner_id: User.find(Name: '~%Confidential%').id
|
346
|
+
expect(update.error_message).to eq 'Cannot change owner to confidential user'
|
347
|
+
```
|
348
|
+
|
349
|
+
#### Deleting entities
|
350
|
+
|
351
|
+
Once an entity is obtained through `find` or `create`, it can be deleted simply with the
|
352
|
+
`delete`. If you want an exception to be raised if the delete fails, pass `must_pass: true` to the
|
353
|
+
delete method. For example:
|
354
|
+
|
355
|
+
```ruby
|
356
|
+
@contact = Contact.find first_name 'No longer needed'
|
357
|
+
@contact.delete must_pass: true
|
358
|
+
```
|
359
|
+
|
360
|
+
An entity can also be deleted with merely it's id. For example:
|
361
|
+
|
362
|
+
```ruby
|
363
|
+
Contact.delete '0032v00002rgv2pAAA', must_pass: true
|
364
|
+
```
|
365
|
+
|
366
|
+
### Other Examples
|
367
|
+
|
368
|
+
See [spec/integration](spec/integration) folder for examples of tests.
|
369
|
+
|
370
|
+
#### Delete old contacts
|
371
|
+
```ruby
|
372
|
+
# Deleting old contacts
|
373
|
+
objects = Contact.each_id_with created_date: "<#{5.days.ago}"
|
374
|
+
puts objects.count # Log how many are being deleted
|
375
|
+
objects.each do |id|
|
376
|
+
puts "Deleting #{id}"
|
377
|
+
Contact.delete id
|
378
|
+
end
|
379
|
+
```
|
380
|
+
|
213
381
|
## Structure
|
214
382
|
|
215
383
|
Following is the general structure of test automation suite that uses this approach. Details may vary depending on the
|
@@ -256,20 +424,6 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
256
424
|
|
257
425
|
Everyone interacting in the LeapSalesforce project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/leap-dojo/leap_salesforce/blob/master/CODE_OF_CONDUCT.md).
|
258
426
|
|
259
|
-
|
260
|
-
|
261
|
-
See [spec/integration](spec/integration) folder for examples of tests.
|
262
|
-
|
263
|
-
```ruby
|
264
|
-
# deleting old contacts
|
265
|
-
objects = Contact.each_id_with CreatedDate: "<#{5.days.ago}"
|
266
|
-
puts objects.count
|
267
|
-
objects.each do |id|
|
268
|
-
puts "Deleting #{id}"
|
269
|
-
Contact.delete id
|
270
|
-
end
|
271
|
-
```
|
272
|
-
|
273
|
-
# References
|
427
|
+
## References
|
274
428
|
|
275
429
|
See the presentation on this [here](https://gitpitch.com/leap-dojo/leap_salesforce?grs=gitlab)
|
data/leap_salesforce.gemspec
CHANGED
@@ -40,6 +40,6 @@ It reads the Metadata from Salesforce and creates the foundation for API tests.'
|
|
40
40
|
spec.add_dependency 'require_all'
|
41
41
|
spec.add_dependency 'rubocop'
|
42
42
|
spec.add_dependency 'rubykeyword'
|
43
|
-
spec.add_dependency 'soaspec', '>= 0.2.
|
43
|
+
spec.add_dependency 'soaspec', '>= 0.2.30'
|
44
44
|
spec.add_dependency 'thor'
|
45
45
|
end
|
@@ -65,10 +65,10 @@ module SoqlGlobalObjectData
|
|
65
65
|
|
66
66
|
# Find the data for a single SoqlObject using the calling class's table.
|
67
67
|
# Will get the latest created date.
|
68
|
-
# @example Get a contact where LastName is 'Bob'
|
68
|
+
# @example Get a contact where LastName is 'Bob' using backend name
|
69
69
|
# Contact.find(LastName: 'Bob')
|
70
|
-
# @example Get a contact that includes 'Test' in their first name
|
71
|
-
# Contact.find(
|
70
|
+
# @example Get a contact that includes 'Test' in their first name (using ruby accessor name)
|
71
|
+
# Contact.find(first_name: '~%Test%')
|
72
72
|
# @example Get a contact created 10 days ago
|
73
73
|
# Contact.find CreatedDate: "<#{10.days.ago}"
|
74
74
|
# @param [Hash] lookup Key value pair unique to Salesforce to query for
|
@@ -160,6 +160,9 @@ module SoqlGlobalObjectData
|
|
160
160
|
end
|
161
161
|
|
162
162
|
# Remove object from Salesforce with provided id
|
163
|
+
# @example Delete a contact with a specified id, failing if the delete fails
|
164
|
+
# Contact.delete '0032v00002rgv2pAAA', must_pass: true
|
165
|
+
#
|
163
166
|
# @param [String] id Id of element to remove
|
164
167
|
# @param [Boolean] must_pass Whether to raise exception if call is not successful
|
165
168
|
# @return [self] Exchange object making delete call
|
@@ -17,6 +17,9 @@ class SoqlHandler < Soaspec::RestHandler
|
|
17
17
|
element :error_message_element, '$..message'
|
18
18
|
element :soql_fields, :fields
|
19
19
|
|
20
|
+
# This error appears to happen intermittently on test environments
|
21
|
+
retry_on_exceptions [RestClient::ServerBrokeConnection], pause: 1, count: 5
|
22
|
+
|
20
23
|
# @return [String] Version of Salesforce API to use
|
21
24
|
@api_version = '45.0'
|
22
25
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leap_salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IQA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-08-
|
12
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -213,14 +213,14 @@ dependencies:
|
|
213
213
|
requirements:
|
214
214
|
- - ">="
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version: 0.2.
|
216
|
+
version: 0.2.30
|
217
217
|
type: :runtime
|
218
218
|
prerelease: false
|
219
219
|
version_requirements: !ruby/object:Gem::Requirement
|
220
220
|
requirements:
|
221
221
|
- - ">="
|
222
222
|
- !ruby/object:Gem::Version
|
223
|
-
version: 0.2.
|
223
|
+
version: 0.2.30
|
224
224
|
- !ruby/object:Gem::Dependency
|
225
225
|
name: thor
|
226
226
|
requirement: !ruby/object:Gem::Requirement
|