actv 1.3.2 → 1.3.3

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
  SHA1:
3
- metadata.gz: 8da78447dff9dd1a83e2e9c300f12e28efb5d88c
4
- data.tar.gz: dd9d52506820874bc1748868c73383d1a71e2c58
3
+ metadata.gz: bea8e81657f851a02c8909c1bec72f811998f196
4
+ data.tar.gz: 9fb73bfed66596a6f38434ce0d231cc8afed1ec5
5
5
  SHA512:
6
- metadata.gz: 38b243b62e5acf54a92b3084b90ba3ae0fee935713836a259a01f00b3d6d38f4dc03d95720d4d8bc06e4682ee740c09eb3096248137f8cd71eedea0b46a44326
7
- data.tar.gz: 333af51210a8500a3415e2917e2189a603b63c3037e0a955d037fc2fb78aeed55485be47eaaff8d77b3ec4a7295425ebe910e0bffb657f6a6190ddd6bc10b1c4
6
+ metadata.gz: fb7c55eb6b2a41a31b8eaf5ab95f6a7e8ad3849a3e5b6fcd22a876ba0ae4a2a170cd1e0f43822eeb721f60e367b108b6d6d9f67627f9467dbe131781c707c57f
7
+ data.tar.gz: 56ffac050c676d12ecad79fee324b96f1205fa65fe0d4b544882b222537a85e3977b5f095a294ed7d6099b008dce1c4cd33bcf54b85eabe96a2c838dc7c78900
data/lib/actv/asset.rb CHANGED
@@ -45,7 +45,9 @@ module ACTV
45
45
 
46
46
  def endurance_id
47
47
  if self.awendurance?
48
- Addressable::URI.parse(registrationUrlAdr.to_s).query_values.to_h.fetch 'e', nil
48
+ query_values = Addressable::URI.parse(registrationUrlAdr.to_s).query_values
49
+ query_values ||= {}
50
+ query_values.fetch 'e', nil
49
51
  end
50
52
  end
51
53
 
@@ -295,7 +297,7 @@ module ACTV
295
297
  end
296
298
 
297
299
  def first_topic_name
298
- topics.first.topic.name
300
+ topics.first.topic.name unless topics.empty?
299
301
  end
300
302
 
301
303
  def sub_topic
data/lib/actv/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ACTV
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
@@ -357,8 +357,17 @@ describe ACTV::Asset do
357
357
 
358
358
 
359
359
  describe '#first_topic_name' do
360
- it "returns the first topics name" do
361
- asset.first_topic_name.should == "Running"
360
+ context 'when asset has topics' do
361
+ it "returns the first topics name" do
362
+ asset.first_topic_name.should == "Running"
363
+ end
364
+ end
365
+
366
+ context 'when asset has empty topics' do
367
+ let(:assetTopics) {[]}
368
+ it 'returns nil' do
369
+ expect(asset.first_topic_name).to be_nil
370
+ end
362
371
  end
363
372
  end
364
373
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Barnes