scorm_engine 0.6.6 → 0.6.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c507da57a7a18d0c058187941df270ff46ef49adf40a3014e5db7634e171966
4
- data.tar.gz: fcfdde88f3edc1626bb5d8706baf44e57e435a3261a7c97b82db9fbd79f0a9f4
3
+ metadata.gz: 2323920f6cad4a17b64952bcedfc10cc2bf479ece620202fe9556e104c2d89fb
4
+ data.tar.gz: 0f15942cf9e9f71d50d086ba98865295b2e18e3157961bae5698b2ccd3b57bd3
5
5
  SHA512:
6
- metadata.gz: e879b2fa7079cf528999dbc8858b2a6e7ce4ae2e98e956981ccc4febb08bfe1386978ba4d4a0378224d57c64f4d1f892c2fe41ef7dfd05b7f786917af1b58491
7
- data.tar.gz: 1f008d07e1816cb3e908b2329c613d5bb08b8e368c1e7a1519f248ded21b4cd96c836e4050a70289924f1ad1e40c7acd042ece0304b3557bf9e918adcd09a813
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
- result = response.success? ? ScormEngine::Models::Dispatch.new_from_api(response.body) : nil
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
@@ -1,3 +1,3 @@
1
1
  module ScormEngine
2
- VERSION = "0.6.6".freeze
2
+ VERSION = "0.6.7".freeze
3
3
  end
@@ -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.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