leap_salesforce 0.2.11 → 0.2.12

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: b9b7865d552e1f591be39301e900859d3e00bd0d196b00af5190a6f8f6d480f9
4
- data.tar.gz: 1e0755eaa5d99e2fc71083b994597df3bb9711fd6dd2dfd40026d68821ce196e
3
+ metadata.gz: cf476f468493821057b919e67cec01450df2e4776edeae3cf94ddccaac1d1539
4
+ data.tar.gz: '0364379e8b68a5873451b01411ae32346468e651729f8b6e883ca9393fb4b156'
5
5
  SHA512:
6
- metadata.gz: f2a4b2d52ac9fea1b4407505075ee4d5cc9fb48c82d578af16a332725b149f50423ec993145c629211c7bb8466a4913050bb3d50670141efce109a86d919c6d1
7
- data.tar.gz: 0fb073f6652bd70c1278ad8f61d78b8f3a8a90f00704afb4d6acaf71d060f52ee2a24ba55bc7aa518e29c5275395c0647e2dc175a0dc9829444156396ebb2f34
6
+ metadata.gz: feb85dd56212f73a939b83f3e5bd0c6c92ad366580b986b24e55acfeb01ab476fca9c9547bf0cb002dea17c1d430520913357274b37ff33ec05110990f306a55
7
+ data.tar.gz: 2ac29878de67c8f57b03025f901dd09bf53556eb1493c120b53a3e8466c55fa5dcaeee7111b58464a3b07150a8d92b2aa5bdd1a9ecc256095965a704e3757cb2
data/.gitlab-ci.yml CHANGED
@@ -5,6 +5,7 @@ image: ruby:2.6
5
5
 
6
6
  stages:
7
7
  - test
8
+ - deploy
8
9
 
9
10
  variables:
10
11
  password: $password
@@ -605,6 +606,19 @@ test:
605
606
  - bundle exec rake leaps:create_soql_objects
606
607
  - bundle exec rake leaps:create_enums
607
608
  - bundle exec rake
608
-
609
- #before_script:
610
- # - *sfdx_helpers
609
+ artifacts:
610
+ paths:
611
+ - coverage/
612
+
613
+ pages:
614
+ stage: deploy
615
+ dependencies:
616
+ - test
617
+ script:
618
+ - mv coverage/ public
619
+ artifacts:
620
+ paths:
621
+ - public
622
+ expire_in: 30 days
623
+ only:
624
+ - master
@@ -21,6 +21,7 @@
21
21
  <orderEntry type="library" scope="PROVIDED" name="colorize (v0.8.1, RVM: ruby-2.6.5) [gem]" level="application" />
22
22
  <orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.5, RVM: ruby-2.6.5) [gem]" level="application" />
23
23
  <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, RVM: ruby-2.6.5) [gem]" level="application" />
24
+ <orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, RVM: ruby-2.6.5) [gem]" level="application" />
24
25
  <orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, RVM: ruby-2.6.5) [gem]" level="application" />
25
26
  <orderEntry type="library" scope="PROVIDED" name="factory_bot (v5.1.1, RVM: ruby-2.6.5) [gem]" level="application" />
26
27
  <orderEntry type="library" scope="PROVIDED" name="faker (v2.6.0, RVM: ruby-2.6.5) [gem]" level="application" />
@@ -32,6 +33,7 @@
32
33
  <orderEntry type="library" scope="PROVIDED" name="humanize (v2.3.0, RVM: ruby-2.6.5) [gem]" level="application" />
33
34
  <orderEntry type="library" scope="PROVIDED" name="i18n (v1.7.0, RVM: ruby-2.6.5) [gem]" level="application" />
34
35
  <orderEntry type="library" scope="PROVIDED" name="jaro_winkler (v1.5.3, RVM: ruby-2.6.5) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.2.0, RVM: ruby-2.6.5) [gem]" level="application" />
35
37
  <orderEntry type="library" scope="PROVIDED" name="jsonpath (v1.0.5, RVM: ruby-2.6.5) [gem]" level="application" />
36
38
  <orderEntry type="library" scope="PROVIDED" name="kramdown (v2.1.0, RVM: ruby-2.6.5) [gem]" level="application" />
37
39
  <orderEntry type="library" scope="PROVIDED" name="launchy (v2.4.3, RVM: ruby-2.6.5) [gem]" level="application" />
@@ -62,9 +64,11 @@
62
64
  <orderEntry type="library" scope="PROVIDED" name="rspec-its (v1.3.0, RVM: ruby-2.6.5) [gem]" level="application" />
63
65
  <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.8.2, RVM: ruby-2.6.5) [gem]" level="application" />
64
66
  <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.8.3, RVM: ruby-2.6.5) [gem]" level="application" />
65
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v0.75.1, RVM: ruby-2.6.5) [gem]" level="application" />
67
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v0.76.0, RVM: ruby-2.6.5) [gem]" level="application" />
66
68
  <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, RVM: ruby-2.6.5) [gem]" level="application" />
67
69
  <orderEntry type="library" scope="PROVIDED" name="savon (v2.12.0, RVM: ruby-2.6.5) [gem]" level="application" />
70
+ <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.17.1, RVM: ruby-2.6.5) [gem]" level="application" />
71
+ <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.10.2, RVM: ruby-2.6.5) [gem]" level="application" />
68
72
  <orderEntry type="library" scope="PROVIDED" name="sinatra (v2.0.4, RVM: ruby-2.6.5) [gem]" level="application" />
69
73
  <orderEntry type="library" scope="PROVIDED" name="sinatra-basic-auth (v0.1.0, RVM: ruby-2.6.5) [gem]" level="application" />
70
74
  <orderEntry type="library" scope="PROVIDED" name="sinatra-docdsl (v0.8.6, RVM: ruby-2.6.5) [gem]" level="application" />
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Version 0.2.12
2
+ * Enhancement
3
+ * Made optional alias 'Leaps' as shorter form of LeapSalesforce
4
+ * Made more ways of easily setting/finding a user
5
+
1
6
  Version 0.2.11
2
7
  * Bug fix
3
8
  * Remove 'rubykeyword' gem's adding 'seek' to Sting which broke 'rubyzip' gem
data/README.md CHANGED
@@ -6,6 +6,7 @@ from Salesforce and creates the foundation for API tests.
6
6
  In the future it will also planned to be used to create page objects based on metadata to support UI testing.
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
+ [![Coverage](https://gitlab.com/leap-dojo/leap_salesforce/badges/master/coverage.svg)](https://leap-dojo.gitlab.io/leap_salesforce)
9
10
 
10
11
  ## Is this for you?
11
12
 
@@ -40,6 +40,7 @@ It reads the Metadata from Salesforce and creates the foundation for API tests.'
40
40
  spec.add_dependency 'rake'
41
41
  spec.add_dependency 'require_all'
42
42
  spec.add_dependency 'rubocop'
43
+ spec.add_dependency 'simplecov'
43
44
  spec.add_dependency 'soaspec', '>= 0.3.0'
44
45
  spec.add_dependency 'thor'
45
46
  end
@@ -0,0 +1,5 @@
1
+ # Create a Leaps alias to LeapSalesforce as it's faster to type.
2
+ # This will not be automatically required in case as 'Leaps' may be defined elsewhere
3
+
4
+ require 'leap_salesforce'
5
+ Leaps = LeapSalesforce
@@ -91,15 +91,12 @@ module LeapSalesforce
91
91
  "https://#{LeapSalesforce.environment == 'prod' ? 'login' : 'test'}.salesforce.com"
92
92
  end
93
93
 
94
- # @param [String, LeapSalesforce::User] user User or email address of user
94
+ # @param [String, Symbol, Regexp, LeapSalesforce::User] user User or email address of user
95
95
  def api_user=(user)
96
- user = LeapSalesforce::Users.where(user) if user.is_a? Hash
97
- @api_user = case user
98
- when String then user
99
- when LeapSalesforce::User then user.username
100
- when :default then nil # Will then use first user defined
96
+ @api_user = if user.is_a? String
97
+ user
101
98
  else
102
- raise ArgumentError, "Unable to use class '#{user.class}' to set api_user"
99
+ LeapSalesforce::Users.where(user)&.username
103
100
  end
104
101
  Soaspec::SpecLogger.info "Using user '#{@api_user}'"
105
102
  end
@@ -24,10 +24,26 @@ module LeapSalesforce
24
24
 
25
25
  # @return [LeapSalesforce::User] A user that meets the criteria
26
26
  def where(filter)
27
- lookup_key, lookup_value = filter.first
28
- user = @list.find { |user_queried| user_queried.match?(lookup_key, lookup_value) }
29
- raise LeapSalesforce::UserError, "Unable to find user based on filer #{filter}" unless user
27
+ case filter
28
+ when :default then list.first # Will then use first user defined
29
+ when Hash then match_params filter
30
+ when String then match_params(username: filter)
31
+ when Symbol then match_params(key: filter)
32
+ when Regexp then match_params(description: filter)
33
+ when LeapSalesforce::User then filter
34
+ else
35
+ raise "Unable to find user using class #{filter.class}"
36
+ end
37
+ end
30
38
 
39
+ # @return [LeapSalesforce::User] A user that meets the criteria
40
+ def match_params(hash_filter)
41
+ lookup_key, lookup_value = hash_filter.first
42
+ user = list.find { |user_queried| user_queried.match?(lookup_key, lookup_value) }
43
+ unless user
44
+ raise UserError, "Unable to find user based on filer #{hash_filter}. " \
45
+ "Users are: #{list}"
46
+ end
31
47
  user
32
48
  end
33
49
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '0.2.11'
5
+ VERSION = '0.2.12'
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.11
4
+ version: 0.2.12
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-10-29 00:00:00.000000000 Z
12
+ date: 2019-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -207,6 +207,20 @@ dependencies:
207
207
  - - ">="
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
+ - !ruby/object:Gem::Dependency
211
+ name: simplecov
212
+ requirement: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ type: :runtime
218
+ prerelease: false
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: '0'
210
224
  - !ruby/object:Gem::Dependency
211
225
  name: soaspec
212
226
  requirement: !ruby/object:Gem::Requirement
@@ -305,6 +319,7 @@ files:
305
319
  - lib/leap_salesforce/generator/templates/spec/spec_helper.rb.erb
306
320
  - lib/leap_salesforce/get_prod_auth.sh
307
321
  - lib/leap_salesforce/get_scratch_auth.sh
322
+ - lib/leap_salesforce/leaps.rb
308
323
  - lib/leap_salesforce/limits.rb
309
324
  - lib/leap_salesforce/loader.rb
310
325
  - lib/leap_salesforce/parameters.rb