scorm_engine 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2323920f6cad4a17b64952bcedfc10cc2bf479ece620202fe9556e104c2d89fb
4
- data.tar.gz: 0f15942cf9e9f71d50d086ba98865295b2e18e3157961bae5698b2ccd3b57bd3
3
+ metadata.gz: 8427213f1d3146144b07e07c72bd197f8dede2d4c203c8ed15615a341c4535ef
4
+ data.tar.gz: 054c0d302e3a6def37a5fd37b5dfa26822caa719a9a7753be21925d9da1cc881
5
5
  SHA512:
6
- metadata.gz: 8ed8f4351b49ece62eb448c101c73f798c410345a6ec4e02a86404879320fe72cfc3e5d986f2bff2d3c04ea35b5d8321911133c2d354d4ba671c8853c3854ed7
7
- data.tar.gz: 623b7900eddf5b066158e1da192255ad46bc0564acff6b3773f394ab9f5ce173e82d757e3efa8422bb89e3ccc0e326c6c0b9dc026aa98ab92c9232a9725c2d71
6
+ metadata.gz: ffaf83eda0604e1a89aa11018f43e5908d0c77fcfcfa4bfabfc61e17d5d4bdee3ff2025226fad20d26a85595119d26b582ca182e72bbad9e8e0ab2f12e5b62ce
7
+ data.tar.gz: cbe6c17083dc17ea4de1e4e313e7117fa991e0a69cac69e7b7baa6cf0daba5838b42f37dbd60ccd0b7fc9e6bbc24a252d7465024a6da9055c18de7e6dde9e468
@@ -36,6 +36,11 @@ module ScormEngine
36
36
  # @return [Integer]
37
37
  attr_accessor :registration_cap
38
38
 
39
+ # @attr
40
+ # The number of registrations created for this dispatch.
41
+ # @return [Integer]
42
+ attr_accessor :registration_count
43
+
39
44
  # @attr
40
45
  # The date after which this dispatch will be disabled as an ISO 8601
41
46
  # string, or "none" for no expiration date.
@@ -62,6 +67,7 @@ module ScormEngine
62
67
  this.allow_new_registrations = data["allowNewRegistrations"]
63
68
  this.instanced = data["instanced"]
64
69
  this.registration_cap = data["registrationCap"]&.to_i
70
+ this.registration_count = data["registrationCount"]&.to_i
65
71
  this.expiration_date = get_expiration_date(data)
66
72
  this.external_config = data["externalConfig"]
67
73
 
@@ -1,3 +1,3 @@
1
1
  module ScormEngine
2
- VERSION = "0.6.7".freeze
2
+ VERSION = "0.6.8".freeze
3
3
  end
@@ -126,6 +126,8 @@ RSpec.describe ScormEngine::Api::Endpoints::Dispatches do
126
126
  expect(dispatch.id).to eq dispatch_options[:dispatch_id]
127
127
  expect(dispatch.destination_id).to eq dispatch_options[:destination_id]
128
128
  expect(dispatch.course_id).to eq dispatch_options[:course_id]
129
+ expect(dispatch.registration_cap).to be_a Integer
130
+ expect(dispatch.registration_count).to be_a Integer
129
131
  end
130
132
  end
131
133
  end
@@ -53,6 +53,35 @@ RSpec.describe ScormEngine::Models::Dispatch do
53
53
  )
54
54
  expect(dispatch.registration_cap).to eq 123
55
55
  end
56
+
57
+ it "is set to zero when not an integer" do
58
+ dispatch = described_class.new_from_api(
59
+ "data" => {
60
+ "registrationCap" => "oops"
61
+ }
62
+ )
63
+ expect(dispatch.registration_cap).to eq 0
64
+ end
65
+ end
66
+
67
+ describe ":registration_count" do
68
+ it "is set" do
69
+ dispatch = described_class.new_from_api(
70
+ "data" => {
71
+ "registrationCount" => "456"
72
+ }
73
+ )
74
+ expect(dispatch.registration_count).to eq 456
75
+ end
76
+
77
+ it "is set to zero when not an integer" do
78
+ dispatch = described_class.new_from_api(
79
+ "data" => {
80
+ "registrationCount" => "oops"
81
+ }
82
+ )
83
+ expect(dispatch.registration_count).to eq 0
84
+ end
56
85
  end
57
86
 
58
87
  describe ":expiration_date" do
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.6.7
4
+ version: 0.6.8
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-09-17 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday