openstax_salesforce 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/openstax/salesforce/spec_helpers.rb +37 -14
- data/lib/openstax/salesforce/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2665308e1bce27de1a593985b20e5be9b417ce167f84c3ffb90c168de9a3ac04
|
4
|
+
data.tar.gz: 74b24e8befe93000a02c04ba865cfb1d450219eca3f7ea9cd2926d6f45b5af7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 103644330f45ab5cf55372e10a9e44709a2c190e8c124cceefff0573491aafe3c25785a7d37ebda5a939ced4bcb9d15d3f3d1cefd75034c07f930eb446a34627
|
7
|
+
data.tar.gz: 87c623d6b32dc1fd15010b6dbe71d08b405e861f1909373b11bfebf40f67e2aa6a75275023691ab54b7ff5fb3bc823d5ccd2f19f1b45ce58d91865ec92b64936
|
@@ -131,27 +131,23 @@ module OpenStax::Salesforce::SpecHelpers
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def ensure_books_exist(book_names)
|
134
|
-
book_names.
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
books.push(book)
|
139
|
-
end
|
134
|
+
@books = OpenStax::Salesforce::Remote::Book.where(name: book_names).to_a
|
135
|
+
|
136
|
+
(book_names - books.map(&:name)).each do |book_name|
|
137
|
+
OpenStax::Salesforce::Remote::Book.new(name: book_name).save!
|
140
138
|
end
|
141
139
|
end
|
142
140
|
|
143
141
|
def ensure_schools_exist(school_names)
|
144
|
-
school_names.
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
schools.push(school)
|
149
|
-
end
|
142
|
+
@schools = OpenStax::Salesforce::Remote::School.where(name: school_names).to_a
|
143
|
+
|
144
|
+
(school_names - schools.map(&:name)).each do |school_name|
|
145
|
+
OpenStax::Salesforce::Remote::School.new(name: school_name).save!
|
150
146
|
end
|
151
147
|
end
|
152
148
|
|
153
149
|
def books
|
154
|
-
@books ||= Book.all
|
150
|
+
@books ||= OpenStax::Salesforce::Remote::Book.all
|
155
151
|
end
|
156
152
|
|
157
153
|
def book(name)
|
@@ -163,7 +159,7 @@ module OpenStax::Salesforce::SpecHelpers
|
|
163
159
|
end
|
164
160
|
|
165
161
|
def schools
|
166
|
-
@schools ||= School.all
|
162
|
+
@schools ||= OpenStax::Salesforce::Remote::School.all
|
167
163
|
end
|
168
164
|
|
169
165
|
def school_id(name)
|
@@ -173,5 +169,32 @@ module OpenStax::Salesforce::SpecHelpers
|
|
173
169
|
def school(name)
|
174
170
|
schools.find { |ss| ss.name == name }
|
175
171
|
end
|
172
|
+
|
173
|
+
def setup_cassette
|
174
|
+
VCR.configure do |config|
|
175
|
+
config.define_cassette_placeholder('<salesforce_instance_url>') do
|
176
|
+
'https://example.salesforce.com'
|
177
|
+
end
|
178
|
+
config.define_cassette_placeholder('<salesforce_instance_url_lower>') do
|
179
|
+
'https://example.salesforce.com'
|
180
|
+
end
|
181
|
+
authentication = ActiveForce.sfdc_client.authenticate!
|
182
|
+
config.define_cassette_placeholder('<salesforce_instance_url>') do
|
183
|
+
authentication.instance_url
|
184
|
+
end
|
185
|
+
config.define_cassette_placeholder('<salesforce_instance_url_lower>') do
|
186
|
+
authentication.instance_url.downcase
|
187
|
+
end
|
188
|
+
config.define_cassette_placeholder('<salesforce_id>') do
|
189
|
+
authentication.id
|
190
|
+
end
|
191
|
+
config.define_cassette_placeholder('<salesforce_access_token>') do
|
192
|
+
authentication.access_token
|
193
|
+
end
|
194
|
+
config.define_cassette_placeholder('<salesforce_signature>') do
|
195
|
+
authentication.signature
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
176
199
|
end
|
177
200
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.0.
|
146
|
+
rubygems_version: 3.0.4
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Interface gem for accessing OpenStax's Salesforce instance
|