actv 2.1.1 → 2.2.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/actv/asset.rb +6 -3
- data/lib/actv/quiz.rb +6 -0
- data/lib/actv/version.rb +1 -1
- data/spec/actv/quiz_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb543c20c467def2a700962992915afcc00671ca
|
4
|
+
data.tar.gz: a89b79de6924b3c7eec04a9f27fa8d7320dffc50
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bbb2425e15b8d4d86c2e8d419167b1c772cc80f6fada11375df44214194da978e557e4db52895c5a9ea7822cfbd8cc96dbaf999b9733af060f158ba322d0eb6
|
7
|
+
data.tar.gz: b01a74be14c4f506b4533b39dc8ae4a17b2c5bef9a08b499e2b52ace3c3cd87e4b32e776bb436ce282525025deafac4b92b027e932380df22c7a1cfaeda096d5
|
data/lib/actv/asset.rb
CHANGED
@@ -382,12 +382,15 @@ module ACTV
|
|
382
382
|
private
|
383
383
|
|
384
384
|
def child_assets_filtered_by_category category
|
385
|
-
|
386
|
-
@children.select { |child| child.category_is? category }
|
385
|
+
child_assets.select { |child| child.category_is? category }
|
387
386
|
end
|
388
387
|
|
389
388
|
def child_assets
|
390
|
-
|
389
|
+
@child_assets ||= if components.any?
|
390
|
+
ACTV.asset components.map(&:assetGuid)
|
391
|
+
else
|
392
|
+
[]
|
393
|
+
end
|
391
394
|
end
|
392
395
|
|
393
396
|
def image_without_placeholder
|
data/lib/actv/quiz.rb
CHANGED
data/lib/actv/version.rb
CHANGED
data/spec/actv/quiz_spec.rb
CHANGED
@@ -48,4 +48,22 @@ describe ACTV::Quiz do
|
|
48
48
|
it { should be_empty }
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
describe '#find_outcome_by_id' do
|
53
|
+
subject(:outcome) { quiz.find_outcome_by_id "123" }
|
54
|
+
|
55
|
+
context 'when the outcome exists' do
|
56
|
+
it 'returns an outcome' do
|
57
|
+
outcome_a = double(:outcome_a, assetGuid: "123")
|
58
|
+
outcome_b = double(:outcome_b, assetGuid: "234")
|
59
|
+
outcomes = [outcome_a, outcome_b]
|
60
|
+
allow(quiz).to receive(:outcomes) { outcomes }
|
61
|
+
|
62
|
+
expect(outcome).to eq outcome_a
|
63
|
+
end
|
64
|
+
end
|
65
|
+
context 'when the outcome does not exist' do
|
66
|
+
it { should be_nil }
|
67
|
+
end
|
68
|
+
end
|
51
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathaniel Barnes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|