actv 1.3.5 → 1.3.6
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 +3 -7
- data/lib/actv/version.rb +1 -1
- data/spec/actv/asset_spec.rb +9 -86
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 879990899fd61e474d302742229f2f2e2ae6d616
|
4
|
+
data.tar.gz: 3a07bed8d672f1bd95ff01b3043363379c65a1fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 138f0fe37f39a4d09d8d3a5e780350b307f8c586744bbf938e8c4bd48115b78ba7676c3788609d059b7086b109a14e4af36ac58b2e4654e7d8f97e4ea4c765ff
|
7
|
+
data.tar.gz: 4a93eabc6959845b8d8c538b88becce1e7444d094f1f10594e06c4cd6ab11ea0d756fbaf90df2c8f5c6523243d4d3c57157e3e5b6e8dc14bb26f30cd36ee3fce
|
data/lib/actv/asset.rb
CHANGED
@@ -246,7 +246,7 @@ module ACTV
|
|
246
246
|
end
|
247
247
|
|
248
248
|
def kids?
|
249
|
-
|
249
|
+
kids_interest?
|
250
250
|
end
|
251
251
|
|
252
252
|
def registration_status
|
@@ -391,14 +391,10 @@ module ACTV
|
|
391
391
|
end
|
392
392
|
end
|
393
393
|
|
394
|
-
private
|
394
|
+
private
|
395
395
|
def kids_interest?
|
396
396
|
interests = meta_interests.to_a.map(&:downcase)
|
397
|
-
['kids', 'family'].any? { |tag| interests.include? tag }
|
398
|
-
end
|
399
|
-
|
400
|
-
def kids_friendly_source_system?
|
401
|
-
activenet? || awcamps? || awcamps30? || articles_source?
|
397
|
+
['kids', 'family'].any? { |tag| interests.include? tag }
|
402
398
|
end
|
403
399
|
|
404
400
|
def articles_source?
|
data/lib/actv/version.rb
CHANGED
data/spec/actv/asset_spec.rb
CHANGED
@@ -229,7 +229,7 @@ describe ACTV::Asset do
|
|
229
229
|
describe "#kids?" do
|
230
230
|
let(:asset) { ACTV::Asset.new assetGuid: 1 }
|
231
231
|
|
232
|
-
before do
|
232
|
+
before do
|
233
233
|
class Rails
|
234
234
|
def self.env
|
235
235
|
"development"
|
@@ -237,96 +237,19 @@ describe ACTV::Asset do
|
|
237
237
|
end
|
238
238
|
end
|
239
239
|
|
240
|
-
context
|
241
|
-
|
242
|
-
before { asset.stub kids_friendly_source_system?: true }
|
240
|
+
context 'when kids_interest? is true' do
|
241
|
+
before { asset.stub kids_interest?: true }
|
243
242
|
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
it 'evaluates to true' do
|
248
|
-
asset.kids?.should eq true
|
249
|
-
end
|
250
|
-
end
|
251
|
-
|
252
|
-
context 'when kids_interest? is false' do
|
253
|
-
before { asset.stub kids_interest?: false }
|
254
|
-
|
255
|
-
it 'evaluates to false' do
|
256
|
-
asset.kids?.should eq false
|
257
|
-
end
|
258
|
-
end
|
259
|
-
end
|
260
|
-
|
261
|
-
context "and activenet? returns true" do
|
262
|
-
let(:asset) { ACTV::Asset.new assetGuid: 1, sourceSystem: {legacyGuid: "FB27C928-54DB-4ECD-B42F-482FC3C8681F"} }
|
263
|
-
|
264
|
-
context 'and kids_interest? is true' do
|
265
|
-
before { asset.stub kids_interest?: true }
|
266
|
-
|
267
|
-
it 'evaluates to true' do
|
268
|
-
asset.kids?.should eq true
|
269
|
-
end
|
270
|
-
end
|
271
|
-
end
|
272
|
-
|
273
|
-
context "and awcamps? returns true" do
|
274
|
-
let(:asset) { ACTV::Asset.new assetGuid: 1, sourceSystem: {legacyGuid: "2B22B4E6-5AA4-44D7-BF06-F7A71F9FA8A6"} }
|
275
|
-
|
276
|
-
context 'and kids_interest? is true' do
|
277
|
-
before { asset.stub kids_interest?: true }
|
278
|
-
|
279
|
-
it 'evaluates to true' do
|
280
|
-
asset.kids?.should eq true
|
281
|
-
end
|
282
|
-
end
|
283
|
-
end
|
284
|
-
|
285
|
-
context "and awcamps30? returns true" do
|
286
|
-
let(:asset) { ACTV::Asset.new assetGuid: 1, sourceSystem: {legacyGuid: "89208DBA-F535-4950-880A-34A6888A184C"} }
|
287
|
-
|
288
|
-
context 'and kids_interest? is true' do
|
289
|
-
before { asset.stub kids_interest?: true }
|
290
|
-
|
291
|
-
it 'evaluates to true' do
|
292
|
-
asset.kids?.should eq true
|
293
|
-
end
|
294
|
-
end
|
295
|
-
end
|
296
|
-
|
297
|
-
context "and articles_source? returns true" do
|
298
|
-
let(:asset) { ACTV::Asset.new assetGuid: 1, sourceSystem: {legacyGuid: "CA4EA0B1-7377-470D-B20D-BF6BEA23F040"} }
|
299
|
-
|
300
|
-
context 'and kids_interest? is true' do
|
301
|
-
before { asset.stub kids_interest?: true }
|
302
|
-
|
303
|
-
it 'evaluates to true' do
|
304
|
-
asset.kids?.should eq true
|
305
|
-
end
|
306
|
-
end
|
243
|
+
it 'evaluates to true' do
|
244
|
+
asset.kids?.should eq true
|
307
245
|
end
|
308
246
|
end
|
309
247
|
|
310
|
-
context
|
311
|
-
|
312
|
-
before { asset.stub kids_friendly_source_system?: false }
|
313
|
-
|
314
|
-
it 'evaluates to false' do
|
315
|
-
asset.kids?.should eq false
|
316
|
-
end
|
317
|
-
end
|
248
|
+
context 'when kids_interest? is false' do
|
249
|
+
before { asset.stub kids_interest?: false }
|
318
250
|
|
319
|
-
|
320
|
-
|
321
|
-
asset.stub activenet?: false
|
322
|
-
asset.stub awcamps?: false
|
323
|
-
asset.stub awcamps30?: false
|
324
|
-
asset.stub articles_source?: false
|
325
|
-
end
|
326
|
-
|
327
|
-
it 'evaluates to false' do
|
328
|
-
asset.kids?.should eq false
|
329
|
-
end
|
251
|
+
it 'evaluates to false' do
|
252
|
+
asset.kids?.should eq false
|
330
253
|
end
|
331
254
|
end
|
332
255
|
end
|