scorm_engine 0.6.6 → 0.6.7
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/dispatches.rb +2 -1
- data/lib/scorm_engine/version.rb +1 -1
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_post_dispatch/is_updates_if_same_dispatch_id.yml +98 -0
- data/spec/scorm_engine/api/endpoints/dispatches_spec.rb +15 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2323920f6cad4a17b64952bcedfc10cc2bf479ece620202fe9556e104c2d89fb
|
4
|
+
data.tar.gz: 0f15942cf9e9f71d50d086ba98865295b2e18e3157961bae5698b2ccd3b57bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ed8f4351b49ece62eb448c101c73f798c410345a6ec4e02a86404879320fe72cfc3e5d986f2bff2d3c04ea35b5d8321911133c2d354d4ba671c8853c3854ed7
|
7
|
+
data.tar.gz: 623b7900eddf5b066158e1da192255ad46bc0564acff6b3773f394ab9f5ce173e82d757e3efa8422bb89e3ccc0e326c6c0b9dc026aa98ab92c9232a9725c2d71
|
@@ -130,7 +130,8 @@ module ScormEngine
|
|
130
130
|
|
131
131
|
response = get("dispatches/#{options[:dispatch_id]}")
|
132
132
|
|
133
|
-
|
133
|
+
# merge options to pick up dispatch_id which isn't passed back in the response
|
134
|
+
result = response.success? ? ScormEngine::Models::Dispatch.new_from_api({ "id" => options[:dispatch_id] }.merge(response.body)) : nil
|
134
135
|
|
135
136
|
Response.new(raw_response: response, result: result)
|
136
137
|
end
|
data/lib/scorm_engine/version.rb
CHANGED
@@ -0,0 +1,98 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- ScormEngine Ruby Gem 0.6.6
|
12
|
+
Authorization:
|
13
|
+
- Basic <BASIC_AUTH>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
content-type:
|
20
|
+
- application/json
|
21
|
+
date:
|
22
|
+
- Mon, 17 Sep 2018 22:04:10 GMT
|
23
|
+
server:
|
24
|
+
- nginx
|
25
|
+
vary:
|
26
|
+
- Accept-Encoding
|
27
|
+
content-length:
|
28
|
+
- '178'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: ASCII-8BIT
|
33
|
+
string: '{"destinationId":"testing-golf-club","courseId":"testing-golf-explained","allowNewRegistrations":false,"instanced":false,"registrationCap":0,"expirationDate":"none","externalConfig":"scormenginegemtesting-default","enabled":true,"registrationCount":0,"registrationResetDate":"none"}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Mon, 17 Sep 2018 22:04:10 GMT
|
36
|
+
- request:
|
37
|
+
method: post
|
38
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"dispatches":[{"id":"testing-dispatch-id","data":{"destinationId":"testing-golf-club","courseId":"testing-golf-explained","allowNewRegistrations":false,"instanced":false,"registrationCap":0,"expirationDate":"2030-01-01","externalConfig":null}}]}'
|
42
|
+
headers:
|
43
|
+
User-Agent:
|
44
|
+
- ScormEngine Ruby Gem 0.6.6
|
45
|
+
Authorization:
|
46
|
+
- Basic <BASIC_AUTH>
|
47
|
+
Content-Type:
|
48
|
+
- application/json
|
49
|
+
response:
|
50
|
+
status:
|
51
|
+
code: 204
|
52
|
+
message: ''
|
53
|
+
headers:
|
54
|
+
date:
|
55
|
+
- Mon, 17 Sep 2018 22:04:11 GMT
|
56
|
+
server:
|
57
|
+
- nginx
|
58
|
+
connection:
|
59
|
+
- Close
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: ''
|
63
|
+
http_version:
|
64
|
+
recorded_at: Mon, 17 Sep 2018 22:04:11 GMT
|
65
|
+
- request:
|
66
|
+
method: get
|
67
|
+
uri: https://<SCORM_ENGINE_HOST>/ScormEngineInterface/api/v1/ScormEngineGemTesting-default/dispatches/testing-dispatch-id
|
68
|
+
body:
|
69
|
+
encoding: US-ASCII
|
70
|
+
string: ''
|
71
|
+
headers:
|
72
|
+
User-Agent:
|
73
|
+
- ScormEngine Ruby Gem 0.6.6
|
74
|
+
Authorization:
|
75
|
+
- Basic <BASIC_AUTH>
|
76
|
+
response:
|
77
|
+
status:
|
78
|
+
code: 200
|
79
|
+
message: ''
|
80
|
+
headers:
|
81
|
+
content-type:
|
82
|
+
- application/json
|
83
|
+
date:
|
84
|
+
- Mon, 17 Sep 2018 22:04:11 GMT
|
85
|
+
server:
|
86
|
+
- nginx
|
87
|
+
vary:
|
88
|
+
- Accept-Encoding
|
89
|
+
content-length:
|
90
|
+
- '196'
|
91
|
+
connection:
|
92
|
+
- Close
|
93
|
+
body:
|
94
|
+
encoding: ASCII-8BIT
|
95
|
+
string: '{"destinationId":"testing-golf-club","courseId":"testing-golf-explained","allowNewRegistrations":false,"instanced":false,"registrationCap":0,"expirationDate":"2030-01-01T00:00:00Z","externalConfig":"scormenginegemtesting-default","enabled":true,"registrationCount":0,"registrationResetDate":"none"}'
|
96
|
+
http_version:
|
97
|
+
recorded_at: Mon, 17 Sep 2018 22:04:11 GMT
|
98
|
+
recorded_with: VCR 4.0.0
|
@@ -96,6 +96,20 @@ RSpec.describe ScormEngine::Api::Endpoints::Dispatches do
|
|
96
96
|
expect(response.status).to eq 204
|
97
97
|
end
|
98
98
|
end
|
99
|
+
|
100
|
+
it "is updates if same dispatch_id" do
|
101
|
+
response = subject.get_dispatch(dispatch_id: dispatch_options[:dispatch_id])
|
102
|
+
expect(response.result.expiration_date).to eq nil
|
103
|
+
|
104
|
+
response = subject.post_dispatch(dispatch_options.merge(expiration_date: Date.new(2030, 1, 1)))
|
105
|
+
aggregate_failures do
|
106
|
+
expect(response.success?).to eq true
|
107
|
+
expect(response.status).to eq 204
|
108
|
+
end
|
109
|
+
|
110
|
+
response = subject.get_dispatch(dispatch_id: dispatch_options[:dispatch_id])
|
111
|
+
expect(response.result.expiration_date).to be_a Time
|
112
|
+
end
|
99
113
|
end
|
100
114
|
|
101
115
|
describe "#get_dispatch" do
|
@@ -109,6 +123,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Dispatches do
|
|
109
123
|
it "sucessfully creates the dispatch attributes" do
|
110
124
|
dispatch = response.result
|
111
125
|
aggregate_failures do
|
126
|
+
expect(dispatch.id).to eq dispatch_options[:dispatch_id]
|
112
127
|
expect(dispatch.destination_id).to eq dispatch_options[:destination_id]
|
113
128
|
expect(dispatch.course_id).to eq dispatch_options[:course_id]
|
114
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scorm_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Hallstrom
|
@@ -297,6 +297,7 @@ files:
|
|
297
297
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/results/is_an_enumerator_of_dispatch_models.yml
|
298
298
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_get_dispatches/results/sucessfully_creates_the_dispatch_attributes.yml
|
299
299
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_post_dispatch/is_successful.yml
|
300
|
+
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_post_dispatch/is_updates_if_same_dispatch_id.yml
|
300
301
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch/is_successful.yml
|
301
302
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch/results/sucessfully_creates_the_dispatch_attributes.yml
|
302
303
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Dispatches/_put_dispatch_enabled/fails_when_invalid.yml
|