scorm_engine 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/scorm_engine/api/endpoints.rb +12 -2
- data/lib/scorm_engine/api/endpoints/destinations.rb +225 -0
- data/lib/scorm_engine/api/endpoints/dispatches.rb +301 -0
- data/lib/scorm_engine/faraday/connection.rb +0 -1
- data/lib/scorm_engine/models.rb +3 -0
- data/lib/scorm_engine/models/destination.rb +27 -0
- data/lib/scorm_engine/models/dispatch.rb +51 -0
- data/lib/scorm_engine/models/dispatch_zip.rb +18 -0
- data/lib/scorm_engine/version.rb +1 -1
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_delete_destination/raises_ArgumentError_when_destination_id_is_missing.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_delete_destination/returns_success_even_when_id_is_invalid.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_delete_destination/works.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/fails_when_id_is_invalid.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/is_successful.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/results/sucessfully_creates_the_destination_attributes.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination_dispatches_registration_count/fails_when_invalid.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination_dispatches_registration_count/works.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_more_option_pagination_/returns_all_the_destinations.yml +73 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_more_option_pagination_/returns_the_more_key_in_the_raw_response.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_since_option/fails_when_passed_an_invalid_value.yml +37 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/_since_option/works.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/is_successful.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/results/is_an_enumerator_of_Destination_models.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destinations/results/sucessfully_creates_the_Destination_attributes.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination/is_successful.yml +61 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination/is_successful_even_if_the_destination_id_is_not_unique.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_enabled/fails_when_invalid.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_enabled/works_when_false.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_enabled/works_when_true.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_registration_instancing/fails_when_invalid.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_registration_instancing/works_when_false.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_post_destination_dispatches_registration_instancing/works_when_true.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_put_destination/is_successful.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_put_destination/results/sucessfully_creates_the_destination_attributes.yml +67 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch/returns_success_even_when_id_is_invalid.yml +30 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_delete_dispatch/works.yml +30 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch/fails_when_id_is_invalid.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch/is_successful.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch/results/sucessfully_creates_the_dispatch_attributes.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_enabled/is_false_when_disabled.yml +63 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_enabled/is_true_when_enabled.yml +63 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/fails_given_an_invalid_id.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/fails_given_an_invalid_type.yml +34 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works.yml +37 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_AICC.yml +37 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_SCORM12.yml +37 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatch_zip/works_when_type_is_SCORM20043RDEDITION.yml +35 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_more_option_pagination_/returns_all_the_dispatches.yml +69 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_more_option_pagination_/returns_the_more_key_in_the_raw_response.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_since_option/fails_when_passed_an_invalid_value.yml +35 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/_since_option/works.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/is_successful.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/results/is_an_enumerator_of_dispatch_models.yml +36 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/results/sucessfully_creates_the_dispatch_attributes.yml +69 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_post_dispatch/is_successful.yml +59 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch/is_successful.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch/results/sucessfully_creates_the_dispatch_attributes.yml +65 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/fails_when_invalid.yml +38 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/works_when_false.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/works_when_true.yml +32 -0
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Registrations/_post_registration/is_successful_even_when_given_a_UTF8/slashed_username.yml +97 -0
- data/spec/scorm_engine/api/endpoints/destinations_spec.rb +215 -0
- data/spec/scorm_engine/api/endpoints/dispatches_spec.rb +286 -0
- data/spec/scorm_engine/api/endpoints/registrations_spec.rb +12 -0
- data/spec/scorm_engine/models/destination_spec.rb +21 -0
- data/spec/scorm_engine/models/dispatch_spec.rb +85 -0
- data/spec/scorm_engine/models/dispatch_zip_spec.rb +18 -0
- data/spec/support/scorm_engine.rb +21 -0
- metadata +78 -2
@@ -8,7 +8,6 @@ module ScormEngine
|
|
8
8
|
|
9
9
|
def connection
|
10
10
|
@connection ||= ::Faraday.new(url: base_uri.to_s) do |faraday|
|
11
|
-
faraday.headers["Content-Type"] = "application/json"
|
12
11
|
faraday.headers["User-Agent"] = "ScormEngine Ruby Gem #{ScormEngine::VERSION}"
|
13
12
|
|
14
13
|
faraday.basic_auth(ScormEngine.configuration.username, ScormEngine.configuration.password)
|
data/lib/scorm_engine/models.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
require_relative "models/course"
|
2
2
|
require_relative "models/course_configuration"
|
3
3
|
require_relative "models/course_import"
|
4
|
+
require_relative "models/destination"
|
5
|
+
require_relative "models/dispatch"
|
6
|
+
require_relative "models/dispatch_zip"
|
4
7
|
require_relative "models/learner"
|
5
8
|
require_relative "models/registration"
|
6
9
|
require_relative "models/registration_activity_detail"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module ScormEngine
|
2
|
+
module Models
|
3
|
+
class Destination
|
4
|
+
attr_accessor :options
|
5
|
+
private :options
|
6
|
+
|
7
|
+
# TODO: Not sure we want this to be settable. Will depend on how we go
|
8
|
+
# about creating/updating records. For now it makes it easier to create
|
9
|
+
# instances from API options hash.
|
10
|
+
attr_accessor :id, :name
|
11
|
+
|
12
|
+
def self.new_from_api(options = {})
|
13
|
+
this = new
|
14
|
+
|
15
|
+
this.options = options.dup
|
16
|
+
this.id = options["id"]
|
17
|
+
|
18
|
+
# get_destinations (plural) returns values in a nested 'data' field.
|
19
|
+
# get_destination (singular) does not.
|
20
|
+
data = options["data"] || options
|
21
|
+
this.name = data["name"]
|
22
|
+
|
23
|
+
this
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "date"
|
2
|
+
|
3
|
+
module ScormEngine
|
4
|
+
module Models
|
5
|
+
class Dispatch
|
6
|
+
attr_accessor :options
|
7
|
+
private :options
|
8
|
+
|
9
|
+
# TODO: Not sure we want this to be settable. Will depend on how we go
|
10
|
+
# about creating/updating records. For now it makes it easier to create
|
11
|
+
# instances from API options hash.
|
12
|
+
attr_accessor :id, :destination_id, :course_id, :allow_new_registrations,
|
13
|
+
:instanced, :registration_cap, :expiration_date, :external_config
|
14
|
+
|
15
|
+
def self.new_from_api(options = {})
|
16
|
+
this = new
|
17
|
+
|
18
|
+
this.options = options.dup
|
19
|
+
this.id = options["id"]
|
20
|
+
|
21
|
+
# get_dispatches (plural) returns values in a nested 'data' field.
|
22
|
+
# get_dispatches (singular) does not.
|
23
|
+
data = options["data"] || options
|
24
|
+
this.destination_id = data["destinationId"]
|
25
|
+
this.course_id = data["courseId"]
|
26
|
+
this.allow_new_registrations = data["allowNewRegistrations"]
|
27
|
+
this.instanced = data["instanced"]
|
28
|
+
this.registration_cap = data["registrationCap"]&.to_i
|
29
|
+
this.expiration_date = get_expiration_date(data)
|
30
|
+
this.external_config = data["externalConfig"]
|
31
|
+
|
32
|
+
this
|
33
|
+
end
|
34
|
+
|
35
|
+
#
|
36
|
+
# Extract and normalize the expiration date from the API options.
|
37
|
+
#
|
38
|
+
# @param [Hash] options
|
39
|
+
# The API options hash
|
40
|
+
#
|
41
|
+
# @return [Time]
|
42
|
+
# a date/time or nil if undefined.
|
43
|
+
#
|
44
|
+
def self.get_expiration_date(options = {})
|
45
|
+
expiration_date = options["expirationDate"]
|
46
|
+
return if expiration_date.nil? || expiration_date == "none"
|
47
|
+
Time.parse(expiration_date)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ScormEngine
|
2
|
+
module Models
|
3
|
+
class DispatchZip
|
4
|
+
attr_accessor :options
|
5
|
+
private :options
|
6
|
+
|
7
|
+
attr_accessor :dispatch_id, :type, :filename, :body
|
8
|
+
|
9
|
+
def initialize(options = {})
|
10
|
+
@options = options.dup
|
11
|
+
@dispatch_id = options[:dispatch_id]
|
12
|
+
@type = options[:type]
|
13
|
+
@filename = options[:filename]
|
14
|
+
@body = options[:body]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/scorm_engine/version.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 204
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Mon, 20 Aug 2018 21:19:13 GMT
|
23
|
+
server:
|
24
|
+
- nginx
|
25
|
+
connection:
|
26
|
+
- Close
|
27
|
+
body:
|
28
|
+
encoding: UTF-8
|
29
|
+
string: ''
|
30
|
+
http_version:
|
31
|
+
recorded_at: Mon, 20 Aug 2018 21:19:13 GMT
|
32
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/nonexistent-destination
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 204
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Mon, 20 Aug 2018 21:19:15 GMT
|
23
|
+
server:
|
24
|
+
- nginx
|
25
|
+
connection:
|
26
|
+
- Close
|
27
|
+
body:
|
28
|
+
encoding: UTF-8
|
29
|
+
string: ''
|
30
|
+
http_version:
|
31
|
+
recorded_at: Mon, 20 Aug 2018 21:19:15 GMT
|
32
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/destination-to-be-deleted
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 204
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
date:
|
22
|
+
- Mon, 20 Aug 2018 21:19:11 GMT
|
23
|
+
server:
|
24
|
+
- nginx
|
25
|
+
connection:
|
26
|
+
- Close
|
27
|
+
body:
|
28
|
+
encoding: UTF-8
|
29
|
+
string: ''
|
30
|
+
http_version:
|
31
|
+
recorded_at: Mon, 20 Aug 2018 21:19:11 GMT
|
32
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/nonexistent-destination
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 404
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
date:
|
24
|
+
- Mon, 20 Aug 2018 21:19:02 GMT
|
25
|
+
server:
|
26
|
+
- nginx
|
27
|
+
vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
content-length:
|
30
|
+
- '79'
|
31
|
+
connection:
|
32
|
+
- Close
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: '{"message":"No destinations found with ID: nonexistent-destination"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 20 Aug 2018 21:19:02 GMT
|
38
|
+
recorded_with: VCR 4.0.0
|
data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Destinations/_get_destination/is_successful.yml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/testing-golf-club
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
date:
|
24
|
+
- Mon, 20 Aug 2018 21:19:01 GMT
|
25
|
+
server:
|
26
|
+
- nginx
|
27
|
+
vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
content-length:
|
30
|
+
- '40'
|
31
|
+
connection:
|
32
|
+
- Close
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: '{"name":"Golf Club"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 20 Aug 2018 21:19:01 GMT
|
38
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/testing-golf-club
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
date:
|
24
|
+
- Mon, 20 Aug 2018 21:19:03 GMT
|
25
|
+
server:
|
26
|
+
- nginx
|
27
|
+
vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
content-length:
|
30
|
+
- '40'
|
31
|
+
connection:
|
32
|
+
- Close
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: '{"name":"Golf Club"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 20 Aug 2018 21:19:03 GMT
|
38
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/nonexistent-destination/dispatches/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 404
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
date:
|
24
|
+
- Mon, 20 Aug 2018 21:19:00 GMT
|
25
|
+
server:
|
26
|
+
- nginx
|
27
|
+
vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
content-length:
|
30
|
+
- '79'
|
31
|
+
connection:
|
32
|
+
- Close
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: '{"message":"No destinations found with ID: nonexistent-destination"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 20 Aug 2018 21:19:00 GMT
|
38
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations/testing-golf-club/dispatches/registrationCount
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
date:
|
24
|
+
- Mon, 20 Aug 2018 21:19:01 GMT
|
25
|
+
server:
|
26
|
+
- nginx
|
27
|
+
content-length:
|
28
|
+
- '1'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '0'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Mon, 20 Aug 2018 21:19:01 GMT
|
36
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/destinations
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- ScormEngine Ruby Gem 0.3.0
|
14
|
+
Authorization:
|
15
|
+
- Basic <BASIC_AUTH>
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: ''
|
20
|
+
headers:
|
21
|
+
content-type:
|
22
|
+
- application/json
|
23
|
+
date:
|
24
|
+
- Mon, 20 Aug 2018 21:19:30 GMT
|
25
|
+
server:
|
26
|
+
- nginx
|
27
|
+
vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
content-length:
|
30
|
+
- '287'
|
31
|
+
connection:
|
32
|
+
- Close
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: '{"destinations":[{"id":"testing-golf-club","data":{"name":"Golf Club"}},{"id":"destination-to-be-deleted","data":{"name":"destination-to-be-deleted"}},{"id":"paginated-destination-0","data":{"name":"paginated-destination-0"}},{"id":"paginated-destination-1","data":{"name":"paginated-destination-1"}},{"id":"paginated-destination-2","data":{"name":"paginated-destination-2"}},{"id":"paginated-destination-3","data":{"name":"paginated-destination-3"}},{"id":"paginated-destination-4","data":{"name":"paginated-destination-4"}},{"id":"paginated-destination-5","data":{"name":"paginated-destination-5"}},{"id":"paginated-destination-6","data":{"name":"paginated-destination-6"}},{"id":"paginated-destination-7","data":{"name":"paginated-destination-7"}}],"more":"https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/scormenginegemtesting-default/destinations?configuration=ScormEngineGemTesting-default&more=AAABZVk035AAAAEA"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 20 Aug 2018 21:19:30 GMT
|
38
|
+
- request:
|
39
|
+
method: get
|
40
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/scormenginegemtesting-default/destinations?configuration=ScormEngineGemTesting-default&more=AAABZVk035AAAAEA
|
41
|
+
body:
|
42
|
+
encoding: US-ASCII
|
43
|
+
string: ''
|
44
|
+
headers:
|
45
|
+
Content-Type:
|
46
|
+
- application/json
|
47
|
+
User-Agent:
|
48
|
+
- ScormEngine Ruby Gem 0.3.0
|
49
|
+
Authorization:
|
50
|
+
- Basic <BASIC_AUTH>
|
51
|
+
response:
|
52
|
+
status:
|
53
|
+
code: 200
|
54
|
+
message: ''
|
55
|
+
headers:
|
56
|
+
content-type:
|
57
|
+
- application/json
|
58
|
+
date:
|
59
|
+
- Mon, 20 Aug 2018 21:19:31 GMT
|
60
|
+
server:
|
61
|
+
- nginx
|
62
|
+
vary:
|
63
|
+
- Accept-Encoding
|
64
|
+
content-length:
|
65
|
+
- '96'
|
66
|
+
connection:
|
67
|
+
- Close
|
68
|
+
body:
|
69
|
+
encoding: ASCII-8BIT
|
70
|
+
string: '{"destinations":[{"id":"paginated-destination-8","data":{"name":"paginated-destination-8"}},{"id":"paginated-destination-9","data":{"name":"paginated-destination-9"}},{"id":"paginated-destination-10","data":{"name":"paginated-destination-10"}}]}'
|
71
|
+
http_version:
|
72
|
+
recorded_at: Mon, 20 Aug 2018 21:19:31 GMT
|
73
|
+
recorded_with: VCR 4.0.0
|