scorm_engine 0.2.0 → 0.3.0
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/scorm_engine/api/endpoints/courses.rb +2 -2
- data/lib/scorm_engine/api/endpoints/courses/configuration.rb +2 -2
- data/lib/scorm_engine/api/endpoints/courses/import.rb +2 -2
- data/lib/scorm_engine/api/endpoints/registrations.rb +3 -3
- data/lib/scorm_engine/api/endpoints/registrations/configuration.rb +2 -2
- data/lib/scorm_engine/api/endpoints/registrations/launch_history.rb +5 -3
- data/lib/scorm_engine/models/course.rb +6 -0
- data/lib/scorm_engine/version.rb +1 -1
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about/is_successful.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about/knows_the_platform.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about/knows_the_version.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/accepts_before_option.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/accepts_since_option.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/is_successful.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/tracks_combined_counts.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/tracks_per_tenantcounts.yml +5 -5
- data/spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/fails_when_id_is_invalid.yml +38 -0
- data/spec/scorm_engine/api/endpoints/about_spec.rb +1 -1
- data/spec/scorm_engine/api/endpoints/courses/configuration_spec.rb +3 -0
- data/spec/scorm_engine/api/endpoints/courses/import_spec.rb +1 -1
- data/spec/scorm_engine/api/endpoints/courses_spec.rb +9 -0
- data/spec/scorm_engine/api/endpoints/registrations/configuration_spec.rb +4 -0
- data/spec/scorm_engine/api/endpoints/registrations/launch_history_spec.rb +1 -0
- data/spec/scorm_engine/api/endpoints/registrations_spec.rb +4 -2
- data/spec/scorm_engine/models/course_spec.rb +9 -0
- metadata +3 -2
@@ -30,6 +30,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
30
30
|
expect(response.success?).to eq false
|
31
31
|
expect(response.status).to eq 404
|
32
32
|
expect(response.message).to match(/External Package ID 'nonexistent-course'/)
|
33
|
+
expect(response.result).to eq nil
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
@@ -99,6 +100,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
99
100
|
expect(response.success?).to eq false
|
100
101
|
expect(response.status).to eq 404
|
101
102
|
expect(response.message).to match(/External Package ID 'nonexistent-course'/)
|
103
|
+
expect(response.result).to eq nil
|
102
104
|
end
|
103
105
|
|
104
106
|
it "fails when setting_id is invalid" do
|
@@ -106,6 +108,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Configuration do
|
|
106
108
|
expect(response.success?).to eq false
|
107
109
|
expect(response.status).to eq 400
|
108
110
|
expect(response.message).to match(/No configuration setting found with id.*NonExistentSettingTotesBogus/)
|
111
|
+
expect(response.result).to eq nil
|
109
112
|
end
|
110
113
|
end
|
111
114
|
|
@@ -54,7 +54,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses::Import do
|
|
54
54
|
|
55
55
|
aggregate_failures do
|
56
56
|
expect(import.success?).to eq false
|
57
|
-
expect(import.result).to
|
57
|
+
expect(import.result).to eq nil
|
58
58
|
expect(import.message).to match(/A course already exists with the specified id: .*\|a-previously-existing-course!/)
|
59
59
|
end
|
60
60
|
end
|
@@ -129,6 +129,14 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses do
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
132
|
+
|
133
|
+
it "fails when id is invalid" do
|
134
|
+
response = subject.get_course_preview(course_id: "nonexistent-course")
|
135
|
+
expect(response.success?).to eq false
|
136
|
+
expect(response.status).to eq 404
|
137
|
+
expect(response.message).to match(/External Package ID 'nonexistent-course'/)
|
138
|
+
expect(response.result).to eq nil
|
139
|
+
end
|
132
140
|
end
|
133
141
|
|
134
142
|
describe "#get_course_preview" do
|
@@ -150,6 +158,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Courses do
|
|
150
158
|
expect(response.success?).to eq false
|
151
159
|
expect(response.status).to eq 404
|
152
160
|
expect(response.message).to match(/External Package ID 'nonexistent-course'/)
|
161
|
+
expect(response.result).to eq nil
|
153
162
|
end
|
154
163
|
end
|
155
164
|
end
|
@@ -41,6 +41,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations::Configuration do
|
|
41
41
|
expect(response.success?).to eq false
|
42
42
|
expect(response.status).to eq 404
|
43
43
|
expect(response.message).to match(/External Registration ID 'nonexistent-registration'/)
|
44
|
+
expect(response.result).to eq nil
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
@@ -79,6 +80,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations::Configuration do
|
|
79
80
|
expect(response.success?).to eq false
|
80
81
|
expect(response.status).to eq 404
|
81
82
|
expect(response.message).to match(/External Registration ID 'nonexistent-registration'/)
|
83
|
+
expect(response.result).to eq nil
|
82
84
|
end
|
83
85
|
|
84
86
|
it "fails when settings are invalid" do
|
@@ -110,6 +112,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations::Configuration do
|
|
110
112
|
expect(response.success?).to eq false
|
111
113
|
expect(response.status).to eq 404
|
112
114
|
expect(response.message).to match(/External Registration ID 'nonexistent-registration'/)
|
115
|
+
expect(response.result).to eq nil
|
113
116
|
end
|
114
117
|
|
115
118
|
it "fails when setting_id is invalid" do
|
@@ -142,6 +145,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations::Configuration do
|
|
142
145
|
expect(response.success?).to eq false
|
143
146
|
expect(response.status).to eq 404
|
144
147
|
expect(response.message).to match(/External Registration ID 'nonexistent-registration'/)
|
148
|
+
expect(response.result).to eq nil
|
145
149
|
end
|
146
150
|
|
147
151
|
it "fails when setting_id is invalid" do
|
@@ -93,7 +93,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
|
|
93
93
|
it "is false when registration does not exist" do
|
94
94
|
response = subject.get_registration_exists(registration_id: "reg-does-not-exist")
|
95
95
|
aggregate_failures do
|
96
|
-
expect(response.result).to eq
|
96
|
+
expect(response.result).to eq nil
|
97
97
|
expect(response.status).to eq 404
|
98
98
|
end
|
99
99
|
end
|
@@ -114,7 +114,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
|
|
114
114
|
aggregate_failures do
|
115
115
|
expect(response.success?).to eq false
|
116
116
|
expect(response.status).to eq 404
|
117
|
-
expect(response.result).to
|
117
|
+
expect(response.result).to eq nil
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
@@ -144,6 +144,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
|
|
144
144
|
aggregate_failures do
|
145
145
|
expect(response.success?).to eq false
|
146
146
|
expect(response.status).to eq 404
|
147
|
+
expect(response.result).to eq nil
|
147
148
|
end
|
148
149
|
end
|
149
150
|
end
|
@@ -196,6 +197,7 @@ RSpec.describe ScormEngine::Api::Endpoints::Registrations do
|
|
196
197
|
expect(response.success?).to eq false
|
197
198
|
expect(response.status).to eq 404
|
198
199
|
expect(response.message).to match(/External Registration ID 'nonexistent-registration'/)
|
200
|
+
expect(response.result).to eq nil
|
199
201
|
end
|
200
202
|
end
|
201
203
|
end
|
@@ -88,5 +88,14 @@ RSpec.describe ScormEngine::Models::Course do
|
|
88
88
|
end
|
89
89
|
end
|
90
90
|
end
|
91
|
+
|
92
|
+
describe ":course_learning_standard" do
|
93
|
+
it "is set properly" do
|
94
|
+
course = described_class.new_from_api(
|
95
|
+
"courseLearningStandard" => "SCORM_2004_4TH_EDITION"
|
96
|
+
)
|
97
|
+
expect(course.course_learning_standard).to eq "SCORM_2004_4TH_EDITION"
|
98
|
+
end
|
99
|
+
end
|
91
100
|
end
|
92
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scorm_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Hallstrom
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_About/_get_about_user_count/tracks_per_tenantcounts.yml
|
197
197
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_delete_course/fails_when_id_is_invalid.yml
|
198
198
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_delete_course/works.yml
|
199
|
+
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/fails_when_id_is_invalid.yml
|
199
200
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/is_successful.yml
|
200
201
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_detail/results/sucessfully_creates_the_Course_attributes.yml
|
201
202
|
- spec/fixtures/vcr/ScormEngine_Api_Endpoints_Courses/_get_course_preview/fails_when_id_is_invalid.yml
|