rustici_software_cloud_v2 1.0.0beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. data/Gemfile +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +283 -0
  4. data/Rakefile +8 -0
  5. data/docs/ActivityResultSchema.md +20 -0
  6. data/docs/ApplicationListSchema.md +8 -0
  7. data/docs/ApplicationManagementApi.md +570 -0
  8. data/docs/ApplicationSchema.md +9 -0
  9. data/docs/ApplicationToken.md +10 -0
  10. data/docs/AuthenticationApi.md +64 -0
  11. data/docs/CommentSchema.md +10 -0
  12. data/docs/CompletionAmountSchema.md +8 -0
  13. data/docs/CourseActivitySchema.md +15 -0
  14. data/docs/CourseApi.md +1459 -0
  15. data/docs/CourseListNonPagedSchema.md +8 -0
  16. data/docs/CourseListSchema.md +9 -0
  17. data/docs/CourseReferenceSchema.md +10 -0
  18. data/docs/CourseSchema.md +20 -0
  19. data/docs/CourseTagsBatchSchema.md +9 -0
  20. data/docs/CreateRegistrationSchema.md +17 -0
  21. data/docs/CredentialCreatedSchema.md +12 -0
  22. data/docs/CredentialListSchema.md +8 -0
  23. data/docs/CredentialRequestSchema.md +9 -0
  24. data/docs/CredentialSchema.md +12 -0
  25. data/docs/ImportFetchRequestSchema.md +8 -0
  26. data/docs/ImportJobResultSchema.md +11 -0
  27. data/docs/ImportResultSchema.md +11 -0
  28. data/docs/IntegerResultSchema.md +8 -0
  29. data/docs/ItemValuePairSchema.md +9 -0
  30. data/docs/LaunchHistoryListSchema.md +8 -0
  31. data/docs/LaunchHistorySchema.md +17 -0
  32. data/docs/LaunchLinkRequestSchema.md +17 -0
  33. data/docs/LaunchLinkSchema.md +8 -0
  34. data/docs/LearnerPreferenceSchema.md +11 -0
  35. data/docs/LearnerSchema.md +11 -0
  36. data/docs/LinkSchema.md +8 -0
  37. data/docs/MessageSchema.md +8 -0
  38. data/docs/MetadataSchema.md +14 -0
  39. data/docs/ObjectiveSchema.md +20 -0
  40. data/docs/PermissionsSchema.md +9 -0
  41. data/docs/PingApi.md +57 -0
  42. data/docs/PingSchema.md +8 -0
  43. data/docs/PostBackSchema.md +12 -0
  44. data/docs/RegistrationApi.md +1490 -0
  45. data/docs/RegistrationCompletion.md +7 -0
  46. data/docs/RegistrationListSchema.md +9 -0
  47. data/docs/RegistrationSchema.md +27 -0
  48. data/docs/RegistrationSuccess.md +7 -0
  49. data/docs/RegistrationTagsBatchSchema.md +9 -0
  50. data/docs/ResponseError.md +8 -0
  51. data/docs/RuntimeInteractionSchema.md +18 -0
  52. data/docs/RuntimeObjectiveSchema.md +16 -0
  53. data/docs/RuntimeSchema.md +27 -0
  54. data/docs/ScoreSchema.md +8 -0
  55. data/docs/SettingItem.md +12 -0
  56. data/docs/SettingListSchema.md +8 -0
  57. data/docs/SettingMetadata.md +15 -0
  58. data/docs/SettingMetadataValidValues.md +9 -0
  59. data/docs/SettingValidValue.md +9 -0
  60. data/docs/SettingsIndividualSchema.md +10 -0
  61. data/docs/SettingsPostSchema.md +8 -0
  62. data/docs/SharedDataEntrySchema.md +9 -0
  63. data/docs/StaticPropertiesSchema.md +13 -0
  64. data/docs/StringResultSchema.md +8 -0
  65. data/docs/TagListSchema.md +8 -0
  66. data/docs/TagPostSchema.md +7 -0
  67. data/docs/TitleSchema.md +8 -0
  68. data/docs/TokenRequestSchema.md +9 -0
  69. data/docs/XapiAccount.md +9 -0
  70. data/docs/XapiActivity.md +10 -0
  71. data/docs/XapiActivityDefinition.md +19 -0
  72. data/docs/XapiAgentGroup.md +14 -0
  73. data/docs/XapiAttachment.md +14 -0
  74. data/docs/XapiContext.md +16 -0
  75. data/docs/XapiContextActivity.md +11 -0
  76. data/docs/XapiInteractionComponent.md +9 -0
  77. data/docs/XapiResult.md +13 -0
  78. data/docs/XapiScore.md +11 -0
  79. data/docs/XapiStatement.md +20 -0
  80. data/docs/XapiStatementReference.md +9 -0
  81. data/docs/XapiStatementResult.md +9 -0
  82. data/docs/XapiVerb.md +9 -0
  83. data/git_push.sh +55 -0
  84. data/lib/rustici_software_cloud_v2.rb +116 -0
  85. data/lib/rustici_software_cloud_v2/api/application_management_api.rb +574 -0
  86. data/lib/rustici_software_cloud_v2/api/authentication_api.rb +87 -0
  87. data/lib/rustici_software_cloud_v2/api/course_api.rb +1469 -0
  88. data/lib/rustici_software_cloud_v2/api/ping_api.rb +69 -0
  89. data/lib/rustici_software_cloud_v2/api/registration_api.rb +1499 -0
  90. data/lib/rustici_software_cloud_v2/api_client.rb +389 -0
  91. data/lib/rustici_software_cloud_v2/api_error.rb +38 -0
  92. data/lib/rustici_software_cloud_v2/configuration.rb +237 -0
  93. data/lib/rustici_software_cloud_v2/models/activity_result_schema.rb +341 -0
  94. data/lib/rustici_software_cloud_v2/models/application_list_schema.rb +185 -0
  95. data/lib/rustici_software_cloud_v2/models/application_schema.rb +194 -0
  96. data/lib/rustici_software_cloud_v2/models/application_token.rb +201 -0
  97. data/lib/rustici_software_cloud_v2/models/comment_schema.rb +201 -0
  98. data/lib/rustici_software_cloud_v2/models/completion_amount_schema.rb +184 -0
  99. data/lib/rustici_software_cloud_v2/models/course_activity_schema.rb +289 -0
  100. data/lib/rustici_software_cloud_v2/models/course_list_non_paged_schema.rb +185 -0
  101. data/lib/rustici_software_cloud_v2/models/course_list_schema.rb +194 -0
  102. data/lib/rustici_software_cloud_v2/models/course_reference_schema.rb +202 -0
  103. data/lib/rustici_software_cloud_v2/models/course_schema.rb +328 -0
  104. data/lib/rustici_software_cloud_v2/models/course_tags_batch_schema.rb +204 -0
  105. data/lib/rustici_software_cloud_v2/models/create_registration_schema.rb +287 -0
  106. data/lib/rustici_software_cloud_v2/models/credential_created_schema.rb +223 -0
  107. data/lib/rustici_software_cloud_v2/models/credential_list_schema.rb +185 -0
  108. data/lib/rustici_software_cloud_v2/models/credential_request_schema.rb +194 -0
  109. data/lib/rustici_software_cloud_v2/models/credential_schema.rb +223 -0
  110. data/lib/rustici_software_cloud_v2/models/import_fetch_request_schema.rb +190 -0
  111. data/lib/rustici_software_cloud_v2/models/import_job_result_schema.rb +244 -0
  112. data/lib/rustici_software_cloud_v2/models/import_result_schema.rb +215 -0
  113. data/lib/rustici_software_cloud_v2/models/integer_result_schema.rb +188 -0
  114. data/lib/rustici_software_cloud_v2/models/item_value_pair_schema.rb +192 -0
  115. data/lib/rustici_software_cloud_v2/models/launch_history_list_schema.rb +185 -0
  116. data/lib/rustici_software_cloud_v2/models/launch_history_schema.rb +317 -0
  117. data/lib/rustici_software_cloud_v2/models/launch_link_request_schema.rb +282 -0
  118. data/lib/rustici_software_cloud_v2/models/launch_link_schema.rb +188 -0
  119. data/lib/rustici_software_cloud_v2/models/learner_preference_schema.rb +210 -0
  120. data/lib/rustici_software_cloud_v2/models/learner_schema.rb +216 -0
  121. data/lib/rustici_software_cloud_v2/models/link_schema.rb +188 -0
  122. data/lib/rustici_software_cloud_v2/models/message_schema.rb +188 -0
  123. data/lib/rustici_software_cloud_v2/models/metadata_schema.rb +239 -0
  124. data/lib/rustici_software_cloud_v2/models/objective_schema.rb +355 -0
  125. data/lib/rustici_software_cloud_v2/models/permissions_schema.rb +195 -0
  126. data/lib/rustici_software_cloud_v2/models/ping_schema.rb +188 -0
  127. data/lib/rustici_software_cloud_v2/models/post_back_schema.rb +273 -0
  128. data/lib/rustici_software_cloud_v2/models/registration_completion.rb +31 -0
  129. data/lib/rustici_software_cloud_v2/models/registration_list_schema.rb +199 -0
  130. data/lib/rustici_software_cloud_v2/models/registration_schema.rb +360 -0
  131. data/lib/rustici_software_cloud_v2/models/registration_success.rb +31 -0
  132. data/lib/rustici_software_cloud_v2/models/registration_tags_batch_schema.rb +204 -0
  133. data/lib/rustici_software_cloud_v2/models/response_error.rb +188 -0
  134. data/lib/rustici_software_cloud_v2/models/runtime_interaction_schema.rb +311 -0
  135. data/lib/rustici_software_cloud_v2/models/runtime_objective_schema.rb +305 -0
  136. data/lib/rustici_software_cloud_v2/models/runtime_schema.rb +398 -0
  137. data/lib/rustici_software_cloud_v2/models/score_schema.rb +184 -0
  138. data/lib/rustici_software_cloud_v2/models/setting_item.rb +256 -0
  139. data/lib/rustici_software_cloud_v2/models/setting_list_schema.rb +190 -0
  140. data/lib/rustici_software_cloud_v2/models/setting_metadata.rb +294 -0
  141. data/lib/rustici_software_cloud_v2/models/setting_metadata_valid_values.rb +209 -0
  142. data/lib/rustici_software_cloud_v2/models/setting_valid_value.rb +193 -0
  143. data/lib/rustici_software_cloud_v2/models/settings_individual_schema.rb +203 -0
  144. data/lib/rustici_software_cloud_v2/models/settings_post_schema.rb +185 -0
  145. data/lib/rustici_software_cloud_v2/models/shared_data_entry_schema.rb +192 -0
  146. data/lib/rustici_software_cloud_v2/models/static_properties_schema.rb +228 -0
  147. data/lib/rustici_software_cloud_v2/models/string_result_schema.rb +188 -0
  148. data/lib/rustici_software_cloud_v2/models/tag_list_schema.rb +185 -0
  149. data/lib/rustici_software_cloud_v2/models/tag_post_schema.rb +174 -0
  150. data/lib/rustici_software_cloud_v2/models/title_schema.rb +183 -0
  151. data/lib/rustici_software_cloud_v2/models/token_request_schema.rb +203 -0
  152. data/lib/rustici_software_cloud_v2/models/xapi_account.rb +203 -0
  153. data/lib/rustici_software_cloud_v2/models/xapi_activity.rb +209 -0
  154. data/lib/rustici_software_cloud_v2/models/xapi_activity_definition.rb +301 -0
  155. data/lib/rustici_software_cloud_v2/models/xapi_agent_group.rb +279 -0
  156. data/lib/rustici_software_cloud_v2/models/xapi_attachment.rb +267 -0
  157. data/lib/rustici_software_cloud_v2/models/xapi_context.rb +258 -0
  158. data/lib/rustici_software_cloud_v2/models/xapi_context_activity.rb +219 -0
  159. data/lib/rustici_software_cloud_v2/models/xapi_interaction_component.rb +200 -0
  160. data/lib/rustici_software_cloud_v2/models/xapi_result.rb +231 -0
  161. data/lib/rustici_software_cloud_v2/models/xapi_score.rb +211 -0
  162. data/lib/rustici_software_cloud_v2/models/xapi_statement.rb +294 -0
  163. data/lib/rustici_software_cloud_v2/models/xapi_statement_reference.rb +205 -0
  164. data/lib/rustici_software_cloud_v2/models/xapi_statement_result.rb +200 -0
  165. data/lib/rustici_software_cloud_v2/models/xapi_verb.rb +200 -0
  166. data/lib/rustici_software_cloud_v2/version.rb +15 -0
  167. data/rustici_software_cloud_v2.gemspec +45 -0
  168. data/spec/api_client_spec.rb +237 -0
  169. data/spec/configuration_spec.rb +42 -0
  170. data/spec/models/activity_result_schema_spec.rb +133 -0
  171. data/spec/models/application_list_schema_spec.rb +53 -0
  172. data/spec/models/application_schema_spec.rb +59 -0
  173. data/spec/models/application_token_spec.rb +65 -0
  174. data/spec/models/comment_schema_spec.rb +65 -0
  175. data/spec/models/completion_amount_schema_spec.rb +53 -0
  176. data/spec/models/course_activity_schema_spec.rb +99 -0
  177. data/spec/models/course_list_non_paged_schema_spec.rb +53 -0
  178. data/spec/models/course_list_schema_spec.rb +59 -0
  179. data/spec/models/course_reference_schema_spec.rb +65 -0
  180. data/spec/models/course_schema_spec.rb +129 -0
  181. data/spec/models/create_registration_schema_spec.rb +107 -0
  182. data/spec/models/credential_created_schema_spec.rb +77 -0
  183. data/spec/models/credential_list_schema_spec.rb +53 -0
  184. data/spec/models/credential_request_schema_spec.rb +59 -0
  185. data/spec/models/credential_schema_spec.rb +77 -0
  186. data/spec/models/import_fetch_request_schema_spec.rb +53 -0
  187. data/spec/models/import_job_result_schema_spec.rb +75 -0
  188. data/spec/models/import_result_schema_spec.rb +71 -0
  189. data/spec/models/integer_result_schema_spec.rb +53 -0
  190. data/spec/models/item_value_pair_schema_spec.rb +59 -0
  191. data/spec/models/launch_history_list_schema_spec.rb +53 -0
  192. data/spec/models/launch_history_schema_spec.rb +115 -0
  193. data/spec/models/launch_link_request_schema_spec.rb +107 -0
  194. data/spec/models/launch_link_schema_spec.rb +53 -0
  195. data/spec/models/learner_preference_schema_spec.rb +71 -0
  196. data/spec/models/learner_schema_spec.rb +71 -0
  197. data/spec/models/link_schema_spec.rb +53 -0
  198. data/spec/models/message_schema_spec.rb +53 -0
  199. data/spec/models/metadata_schema_spec.rb +89 -0
  200. data/spec/models/objective_schema_spec.rb +137 -0
  201. data/spec/models/permissions_schema_spec.rb +59 -0
  202. data/spec/models/ping_schema_spec.rb +53 -0
  203. data/spec/models/post_back_schema_spec.rb +85 -0
  204. data/spec/models/registration_completion_spec.rb +47 -0
  205. data/spec/models/registration_list_schema_spec.rb +59 -0
  206. data/spec/models/registration_schema_spec.rb +167 -0
  207. data/spec/models/registration_success_spec.rb +47 -0
  208. data/spec/models/response_error_spec.rb +53 -0
  209. data/spec/models/runtime_interaction_schema_spec.rb +117 -0
  210. data/spec/models/runtime_objective_schema_spec.rb +109 -0
  211. data/spec/models/runtime_schema_spec.rb +171 -0
  212. data/spec/models/score_schema_spec.rb +53 -0
  213. data/spec/models/setting_item_spec.rb +81 -0
  214. data/spec/models/setting_list_schema_spec.rb +53 -0
  215. data/spec/models/setting_metadata_spec.rb +99 -0
  216. data/spec/models/setting_metadata_valid_values_spec.rb +59 -0
  217. data/spec/models/settings_individual_schema_spec.rb +65 -0
  218. data/spec/models/settings_post_schema_spec.rb +53 -0
  219. data/spec/models/shared_data_entry_schema_spec.rb +59 -0
  220. data/spec/models/static_properties_schema_spec.rb +83 -0
  221. data/spec/models/string_result_schema_spec.rb +53 -0
  222. data/spec/models/title_schema_spec.rb +53 -0
  223. data/spec/models/token_request_schema_spec.rb +59 -0
  224. data/spec/spec_helper.rb +122 -0
  225. data/swagger-codegen.config +11 -0
  226. metadata +526 -0
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #SCORM Cloud Rest API
3
+
4
+ #REST API used for SCORM Cloud integrations.
5
+
6
+ OpenAPI spec version: 2.0 beta
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.3
10
+
11
+ =end
12
+
13
+ module RusticiSoftwareCloudV2
14
+ VERSION = '1.0.0beta'
15
+ end
@@ -0,0 +1,45 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #SCORM Cloud Rest API
5
+
6
+ #REST API used for SCORM Cloud integrations.
7
+
8
+ OpenAPI spec version: 2.0 beta
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ Swagger Codegen version: 2.4.3
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "rustici_software_cloud_v2/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "rustici_software_cloud_v2"
20
+ s.version = RusticiSoftwareCloudV2::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["Swagger-Codegen"]
23
+ s.email = [""]
24
+ s.homepage = "https://github.com/swagger-api/swagger-codegen"
25
+ s.summary = "A Ruby wrapper for the SCORM Cloud API V2"
26
+ s.description = "SCORM Cloud API V2 Client"
27
+ s.license = ''
28
+ s.required_ruby_version = ">= 1.9"
29
+
30
+ s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
31
+ s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
32
+
33
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
34
+ s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
35
+ s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
36
+ s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
37
+ s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
38
+ s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
39
+ s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
40
+
41
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
42
+ s.test_files = `find spec/*`.split("\n")
43
+ s.executables = []
44
+ s.require_paths = ["lib"]
45
+ end
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #SCORM Cloud Rest API
3
+
4
+ #REST API used for SCORM Cloud integrations.
5
+
6
+ OpenAPI spec version: 2.0 beta
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+
26
+ describe RusticiSoftwareCloudV2::ApiClient do
27
+ context 'initialization' do
28
+ context 'URL stuff' do
29
+ context 'host' do
30
+ it 'removes http from host' do
31
+ RusticiSoftwareCloudV2.configure { |c| c.host = 'http://example.com' }
32
+ expect(RusticiSoftwareCloudV2::Configuration.default.host).to eq('example.com')
33
+ end
34
+
35
+ it 'removes https from host' do
36
+ RusticiSoftwareCloudV2.configure { |c| c.host = 'https://wookiee.com' }
37
+ expect(RusticiSoftwareCloudV2::ApiClient.default.config.host).to eq('wookiee.com')
38
+ end
39
+
40
+ it 'removes trailing path from host' do
41
+ RusticiSoftwareCloudV2.configure { |c| c.host = 'hobo.com/v4' }
42
+ expect(RusticiSoftwareCloudV2::Configuration.default.host).to eq('hobo.com')
43
+ end
44
+ end
45
+
46
+ context 'base_path' do
47
+ it "prepends a slash to base_path" do
48
+ RusticiSoftwareCloudV2.configure { |c| c.base_path = 'v4/dog' }
49
+ expect(RusticiSoftwareCloudV2::Configuration.default.base_path).to eq('/v4/dog')
50
+ end
51
+
52
+ it "doesn't prepend a slash if one is already there" do
53
+ RusticiSoftwareCloudV2.configure { |c| c.base_path = '/v4/dog' }
54
+ expect(RusticiSoftwareCloudV2::Configuration.default.base_path).to eq('/v4/dog')
55
+ end
56
+
57
+ it "ends up as a blank string if nil" do
58
+ RusticiSoftwareCloudV2.configure { |c| c.base_path = nil }
59
+ expect(RusticiSoftwareCloudV2::Configuration.default.base_path).to eq('')
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ describe "params_encoding in #build_request" do
66
+ let(:config) { RusticiSoftwareCloudV2::Configuration.new }
67
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new(config) }
68
+
69
+ it "defaults to nil" do
70
+ expect(RusticiSoftwareCloudV2::Configuration.default.params_encoding).to eq(nil)
71
+ expect(config.params_encoding).to eq(nil)
72
+
73
+ request = api_client.build_request(:get, '/test')
74
+ expect(request.options[:params_encoding]).to eq(nil)
75
+ end
76
+
77
+ it "can be customized" do
78
+ config.params_encoding = :multi
79
+ request = api_client.build_request(:get, '/test')
80
+ expect(request.options[:params_encoding]).to eq(:multi)
81
+ end
82
+ end
83
+
84
+ describe "timeout in #build_request" do
85
+ let(:config) { RusticiSoftwareCloudV2::Configuration.new }
86
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new(config) }
87
+
88
+ it "defaults to 0" do
89
+ expect(RusticiSoftwareCloudV2::Configuration.default.timeout).to eq(0)
90
+ expect(config.timeout).to eq(0)
91
+
92
+ request = api_client.build_request(:get, '/test')
93
+ expect(request.options[:timeout]).to eq(0)
94
+ end
95
+
96
+ it "can be customized" do
97
+ config.timeout = 100
98
+ request = api_client.build_request(:get, '/test')
99
+ expect(request.options[:timeout]).to eq(100)
100
+ end
101
+ end
102
+
103
+ describe "#deserialize" do
104
+ it "handles Array<Integer>" do
105
+ api_client = RusticiSoftwareCloudV2::ApiClient.new
106
+ headers = {'Content-Type' => 'application/json'}
107
+ response = double('response', headers: headers, body: '[12, 34]')
108
+ data = api_client.deserialize(response, 'Array<Integer>')
109
+ expect(data).to be_instance_of(Array)
110
+ expect(data).to eq([12, 34])
111
+ end
112
+
113
+ it "handles Array<Array<Integer>>" do
114
+ api_client = RusticiSoftwareCloudV2::ApiClient.new
115
+ headers = {'Content-Type' => 'application/json'}
116
+ response = double('response', headers: headers, body: '[[12, 34], [56]]')
117
+ data = api_client.deserialize(response, 'Array<Array<Integer>>')
118
+ expect(data).to be_instance_of(Array)
119
+ expect(data).to eq([[12, 34], [56]])
120
+ end
121
+
122
+ it "handles Hash<String, String>" do
123
+ api_client = RusticiSoftwareCloudV2::ApiClient.new
124
+ headers = {'Content-Type' => 'application/json'}
125
+ response = double('response', headers: headers, body: '{"message": "Hello"}')
126
+ data = api_client.deserialize(response, 'Hash<String, String>')
127
+ expect(data).to be_instance_of(Hash)
128
+ expect(data).to eq({:message => 'Hello'})
129
+ end
130
+ end
131
+
132
+ describe "#object_to_hash" do
133
+ it "ignores nils and includes empty arrays" do
134
+ # uncomment below to test object_to_hash for model
135
+ #api_client = RusticiSoftwareCloudV2::ApiClient.new
136
+ #_model = RusticiSoftwareCloudV2::ModelName.new
137
+ # update the model attribute below
138
+ #_model.id = 1
139
+ # update the expected value (hash) below
140
+ #expected = {id: 1, name: '', tags: []}
141
+ #expect(api_client.object_to_hash(_model)).to eq(expected)
142
+ end
143
+ end
144
+
145
+ describe "#build_collection_param" do
146
+ let(:param) { ['aa', 'bb', 'cc'] }
147
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new }
148
+
149
+ it "works for csv" do
150
+ expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
151
+ end
152
+
153
+ it "works for ssv" do
154
+ expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
155
+ end
156
+
157
+ it "works for tsv" do
158
+ expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
159
+ end
160
+
161
+ it "works for pipes" do
162
+ expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
163
+ end
164
+
165
+ it "works for multi" do
166
+ expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
167
+ end
168
+
169
+ it "fails for invalid collection format" do
170
+ expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
171
+ end
172
+ end
173
+
174
+ describe "#json_mime?" do
175
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new }
176
+
177
+ it "works" do
178
+ expect(api_client.json_mime?(nil)).to eq false
179
+ expect(api_client.json_mime?('')).to eq false
180
+
181
+ expect(api_client.json_mime?('application/json')).to eq true
182
+ expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
183
+ expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
184
+
185
+ expect(api_client.json_mime?('application/xml')).to eq false
186
+ expect(api_client.json_mime?('text/plain')).to eq false
187
+ expect(api_client.json_mime?('application/jsonp')).to eq false
188
+ end
189
+ end
190
+
191
+ describe "#select_header_accept" do
192
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new }
193
+
194
+ it "works" do
195
+ expect(api_client.select_header_accept(nil)).to be_nil
196
+ expect(api_client.select_header_accept([])).to be_nil
197
+
198
+ expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
199
+ expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
200
+ expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
201
+
202
+ expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
203
+ expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
204
+ end
205
+ end
206
+
207
+ describe "#select_header_content_type" do
208
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new }
209
+
210
+ it "works" do
211
+ expect(api_client.select_header_content_type(nil)).to eq('application/json')
212
+ expect(api_client.select_header_content_type([])).to eq('application/json')
213
+
214
+ expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
215
+ expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
216
+ expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
217
+ expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
218
+ expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
219
+ end
220
+ end
221
+
222
+ describe "#sanitize_filename" do
223
+ let(:api_client) { RusticiSoftwareCloudV2::ApiClient.new }
224
+
225
+ it "works" do
226
+ expect(api_client.sanitize_filename('sun')).to eq('sun')
227
+ expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
228
+ expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
229
+ expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
230
+ expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
231
+ expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
232
+ expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
233
+ expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
234
+ expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,42 @@
1
+ =begin
2
+ #SCORM Cloud Rest API
3
+
4
+ #REST API used for SCORM Cloud integrations.
5
+
6
+ OpenAPI spec version: 2.0 beta
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.3
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+
15
+ describe RusticiSoftwareCloudV2::Configuration do
16
+ let(:config) { RusticiSoftwareCloudV2::Configuration.default }
17
+
18
+ before(:each) do
19
+ # uncomment below to setup host and base_path
20
+ # require 'URI'
21
+ # uri = URI.parse("https://cloud.scorm.com/api/v2/")
22
+ # RusticiSoftwareCloudV2.configure do |c|
23
+ # c.host = uri.host
24
+ # c.base_path = uri.path
25
+ # end
26
+ end
27
+
28
+ describe '#base_url' do
29
+ it 'should have the default value' do
30
+ # uncomment below to test default value of the base path
31
+ # expect(config.base_url).to eq("https://cloud.scorm.com/api/v2/")
32
+ end
33
+
34
+ it 'should remove trailing slashes' do
35
+ [nil, '', '/', '//'].each do |base_path|
36
+ config.base_path = base_path
37
+ # uncomment below to test trailing slashes
38
+ # expect(config.base_url).to eq("https://cloud.scorm.com/api/v2/")
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,133 @@
1
+ =begin
2
+ #SCORM Cloud Rest API
3
+
4
+ #REST API used for SCORM Cloud integrations.
5
+
6
+ OpenAPI spec version: 2.0 beta
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require 'spec_helper'
25
+ require 'json'
26
+ require 'date'
27
+
28
+ # Unit tests for RusticiSoftwareCloudV2::ActivityResultSchema
29
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
30
+ # Please update as you see appropriate
31
+ describe 'ActivityResultSchema' do
32
+ before do
33
+ # run before each test
34
+ @instance = RusticiSoftwareCloudV2::ActivityResultSchema.new
35
+ end
36
+
37
+ after do
38
+ # run after each test
39
+ end
40
+
41
+ describe 'test an instance of ActivityResultSchema' do
42
+ it 'should create an instact of ActivityResultSchema' do
43
+ expect(@instance).to be_instance_of(RusticiSoftwareCloudV2::ActivityResultSchema)
44
+ end
45
+ end
46
+ describe 'test attribute "id"' do
47
+ it 'should work' do
48
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
49
+ end
50
+ end
51
+
52
+ describe 'test attribute "title"' do
53
+ it 'should work' do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+
58
+ describe 'test attribute "attempts"' do
59
+ it 'should work' do
60
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
61
+ end
62
+ end
63
+
64
+ describe 'test attribute "activity_completion"' do
65
+ it 'should work' do
66
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
67
+ #validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UNKNOWN", "COMPLETED", "INCOMPLETE"])
68
+ #validator.allowable_values.each do |value|
69
+ # expect { @instance.activity_completion = value }.not_to raise_error
70
+ #end
71
+ end
72
+ end
73
+
74
+ describe 'test attribute "activity_success"' do
75
+ it 'should work' do
76
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
77
+ #validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["UNKNOWN", "PASSED", "FAILED"])
78
+ #validator.allowable_values.each do |value|
79
+ # expect { @instance.activity_success = value }.not_to raise_error
80
+ #end
81
+ end
82
+ end
83
+
84
+ describe 'test attribute "score"' do
85
+ it 'should work' do
86
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
87
+ end
88
+ end
89
+
90
+ describe 'test attribute "time_tracked"' do
91
+ it 'should work' do
92
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
93
+ end
94
+ end
95
+
96
+ describe 'test attribute "completion_amount"' do
97
+ it 'should work' do
98
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
99
+ end
100
+ end
101
+
102
+ describe 'test attribute "suspended"' do
103
+ it 'should work' do
104
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
105
+ end
106
+ end
107
+
108
+ describe 'test attribute "children"' do
109
+ it 'should work' do
110
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
111
+ end
112
+ end
113
+
114
+ describe 'test attribute "objectives"' do
115
+ it 'should work' do
116
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
117
+ end
118
+ end
119
+
120
+ describe 'test attribute "static_properties"' do
121
+ it 'should work' do
122
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
123
+ end
124
+ end
125
+
126
+ describe 'test attribute "runtime"' do
127
+ it 'should work' do
128
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
129
+ end
130
+ end
131
+
132
+ end
133
+