leap_salesforce 0.2.17 → 0.2.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 906a5f6573d0bf393082eadac1e9935fcda4e89c6886a8e2d5fffa15010db289
4
- data.tar.gz: 8b8343640b11e301fc53f6c8c5ba6a7253b206a14caaf9f723d74ed4f834318c
3
+ metadata.gz: f2c0ca47804ac6b8569d9a025d57650cfd749000abcf51a32833734fe82aabc3
4
+ data.tar.gz: bfdbffd73951d36c605e51250d7db353d50408b1435f95a8a7bb2e296f923e29
5
5
  SHA512:
6
- metadata.gz: afecc4803505fb9599c49855d7105a9262e79e65f28156b3989508df973365d2f23a9525b306b845d2d30309561c39bcfc66bd092840a26ccf03a9df8de1675b
7
- data.tar.gz: 1b4b06ee4497c02852afd97ee9bdfa9d80b88a2df9e9498d6795d0d5fc7a39cad2150f6e2f5138075890d72a6220bc03380c72a83dd2c01914e4e66e449ef021
6
+ metadata.gz: fe62e4cc025ebb9b51432d295ff377f672127c07cc95d9f0691a3898339baee22beac1f01e8c0da5074bc6194fefde2465513e875e27b4d620dc285c45ef1b49
7
+ data.tar.gz: aa0431124e5a9e1b0e6664c175a8818af2283b73215c4a5f4cc34f2b3f45e09904560e1bff5c1c69b44e6964c774ce204028e35b619bea5e4c2ca98e1129a9d2
data/ChangeLog CHANGED
@@ -1,6 +1,10 @@
1
+ Version 0.2.18
2
+ * Bug fix
3
+ * Fixes #29 to raise error if value retrieved on object after an update failure
4
+
1
5
  Version 0.2.17
2
6
  * Bug fix
3
- * Do not fail SFDX if SFDX_ACCESS_TOKEN and SFDX_INSTANCE_URL are manually set
7
+ * Do not fail SFDX if SFDX_ACCESS_TOKEN and SFDX_INSTANCE_URL are manually set and no jwt file is present
4
8
 
5
9
  Version 0.2.16
6
10
  * Bug fix
data/README.md CHANGED
@@ -46,6 +46,8 @@ The benefits of an open source tool like this are:
46
46
  * [.leap_salesforce.yml](#leap_salesforceyml)
47
47
  * [salesforce_oauth2.yml](#salesforce_oauth2yml)
48
48
  * [config/general.rb](#configgeneralrb)
49
+ * [Setup scripts](#setup-scripts)
50
+ * [Changing environment](#changing-environment)
49
51
  * [Test Users](#test-users)
50
52
  * [CRUD of data](#crud-of-data)
51
53
  * [Creating entities](#creating-entities)
@@ -82,6 +84,9 @@ Or install it yourself as:
82
84
  $ gem install leap_salesforce
83
85
 
84
86
  ## Usage
87
+ Note there is a `Leaps` alias that can be declared if you require `leap_salesforce/leaps` which makes commands
88
+ shorter, meaning that `Leaps` can be used instead of `LeapSalesforce`
89
+
85
90
  ### Getting started
86
91
  After installing the gem, to get started in creating a fresh repository, the `leap_salesforce` executable can be used.
87
92
  It will ask for credentials and setup files that will locally store them.
@@ -150,7 +155,55 @@ This is where common code is stored for all the environments. This is where you
150
155
  as described in the next section.
151
156
 
152
157
  For sfdx, set the `ENV['SF_USERNAME']` to the user to login to sfdx with and create a `server.key` for
153
- authentication. How sfdx will fully work with different user roles is still a work in progress.
158
+ authentication. How sfdx will fully work with different user roles is still a work in progress.
159
+
160
+ #### Setup scripts
161
+ The `leap_salesforce init` runs 2 rake tasks on the initial suite after having created the basic files. These are:
162
+
163
+ * `leaps:create_soql_objects`
164
+ This reads from the list of soql objects defined in `.leap_salesforce.yml` and creates a class inheriting from
165
+ `SoqlData` that maps to a backend object. A difference in name created from this script can be defined in that file
166
+ with format `DesiredClassName:ActualClassName`.
167
+
168
+ E.g., `Broker: Broker__c` will mean that a Ruby class called `Broker` will be created that will map to the `Broker__c`
169
+ custom object.
170
+
171
+ A separate file with the ending `_field_names` is also created from the metadata for each object. This creates
172
+ accessors for each field in the table with names that map from a Ruby friendly name to the Salesforce backend name.
173
+
174
+ * `leaps:create_enums`
175
+
176
+ This task reads the soql objects defined in `.leap_salesforce.yml` and creates a `metadata/enum` folder that has
177
+ picklist information for all the picklist fields of each object. These are designed to be readonly as they will
178
+ be overridden when this command is run again.
179
+
180
+ These are designed to be used as:
181
+
182
+ 1. A reference when setting the value of a picklist. Rather than
183
+
184
+ `contact.lead_source = 'Web'`
185
+ one can use
186
+ `contact.lead_source = Contact::LeadSource.web`
187
+ which makes it clearer that a picklist value is used (not just free text) and also have a value that can be
188
+ refactored if there is a change in the picklist.
189
+
190
+ 2. A method of detecting changes in picklist values
191
+ Sometimes due to older methods of deployment (or a disconnect between dev and testing team), a picklist value
192
+ may change without the test team knowing about it (or a known change needs to be verified).
193
+ Since the history of these values can be tracked when these files are committed to source control, a change
194
+ can be detected when a test like the following is run
195
+
196
+ ```ruby
197
+ RSpec.describe 'Picklists' do
198
+ LeapSalesforce.objects_to_verify.each do |data_class|
199
+ SoqlEnum.values_for(data_class).each do |picklist|
200
+ it "#{picklist} has not changed values" do
201
+ expect(data_class.picklist_for(picklist.name)).to match_array picklist.values
202
+ end
203
+ end
204
+ end
205
+ end
206
+ ```
154
207
 
155
208
  #### Changing environment
156
209
 
@@ -430,23 +483,25 @@ Following is the general structure of test automation suite that uses this appro
430
483
  test framework used and other preferences.
431
484
 
432
485
  .
433
- ├── config # Code for the configuration of the automation suite
434
- │ ├── general.rb # Code loaded for common (non confidential code) setup across environments
435
- │ ├── credentials # Setting of secret properties like passwords
436
- │ │ └── salesforce_oauth.yml # Credentials for connecting to Salesforce via OAuth2.
437
- │ └── environments # Contains ruby files loaded specific to environment following `ENVIRONMENT_NAME.rb`
438
- ├── lib # Common library code
439
- │ └── leap_salesforce # Code generated by or specific to leap_salesforce
440
- │ ├── factories # FactoryBot definitions, describing how to mass produce objects
441
- │ ├── metadata # Code generated and updated automatically from metadata
442
- │ │ └── enum # Picklist enumeration objects are stored here
443
- │ └── soql_data # Objects for handling each object in the backend specified in '.leap_salesforce.yml'
444
- ├── logs # Contains API traffic logs for transactions against Salesforce
445
- ├── spec # Where RSpec automated tests are stored
446
- ├── .leap_salesforce.yml # Where common configuration is stored regarding your project. This complements and is read before what's in 'config'
447
- ├── Gemfile # Where required ruby gems/libraries are specified
448
- ├── Gemfile.lock # Generated file specified details of versions installed by `Gemfile`
449
- └── Rakefile # Where common `Rake` tasks are specified. LeapSalesforce specific tasks are required from here
486
+ ├── config # Code for the configuration of the automation suite
487
+ │ ├── general.rb # Code loaded for common (non confidential code) setup across environments
488
+ │ ├── credentials # Setting of secret properties like passwords
489
+ │ │ └── salesforce_oauth.yml # Credentials for connecting to Salesforce via OAuth2.
490
+ │ └── environments # Contains ruby files loaded specific to environment following `ENVIRONMENT_NAME.rb`
491
+ ├── lib # Common library code
492
+ │ └── leap_salesforce # Code generated by or specific to leap_salesforce (this folder can be configured in .leap_salesforce.yml)
493
+ │ ├── factories # FactoryBot definitions, describing how to mass produce objects
494
+ │ ├── metadata # Code generated and updated automatically from metadata
495
+ │ │ └── enum # Picklist enumeration objects are stored here
496
+ │ └── soql_data # Objects for handling each object in the backend specified in '.leap_salesforce.yml'
497
+ ├── {object_name} # Class mapping to a Soql object
498
+ │ └── {object_name}_field_names # Field name accessors auto created/updated based no metadata in Salesforce
499
+ ├── logs # Contains API traffic logs for transactions against Salesforce
500
+ ├── spec # Where RSpec automated tests are stored
501
+ ├── .leap_salesforce.yml # Where common configuration is stored regarding your project. This complements and is read before what's in 'config'
502
+ ├── Gemfile # Where required ruby gems/libraries are specified
503
+ ├── Gemfile.lock # Generated file specified details of versions installed by `Gemfile`
504
+ └── Rakefile # Where common `Rake` tasks are specified. LeapSalesforce specific tasks are required from here
450
505
 
451
506
  ## Docs
452
507
 
@@ -192,6 +192,7 @@ class SoqlData < Exchange
192
192
  # @return [String] Value at backend name
193
193
  def [](backend_name)
194
194
  if @updated
195
+ successful? unless backend_name.to_s == 'message' || backend_name.to_s == '$..message'
195
196
  @updated = false
196
197
  find # Retrieve data freshly after an update
197
198
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '0.2.17'
5
+ VERSION = '0.2.18'
6
6
  end
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.2.17
4
+ version: 0.2.18
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-12-09 00:00:00.000000000 Z
12
+ date: 2019-12-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler