enlighten 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 853d4aed6f03416190e8fb7a5146654425360057
4
- data.tar.gz: 6cb042cc5cd7128de44097027fe025399335ef26
3
+ metadata.gz: 83f221af7eb33a9e75b4022f7dee270df8c4e0d0
4
+ data.tar.gz: d18885eef8b7517838f6d5abb9bb1ebcc9748b5f
5
5
  SHA512:
6
- metadata.gz: 1b5a179e2bbe224f85c579c978dd6ca8900786f51ee51e28eeae75815ea6a490c11044a0608b32dfcc3ae631d7f06f8d1a79f55ba0cb25cb9cca60c61beeca1e
7
- data.tar.gz: 41a1ecd37841d1d46fc82ca62ac84fceffb4e61f0ebc13225c488fdf8ff9d3c6ade700f7c83acbd5461c883f58a9cbaaa8b1fd78a2201f4bef6133777f8cd6ac
6
+ metadata.gz: 957a494b4259b7c9736c19a7ad8963b645cb3bbc3931583ebab852ad97104bbf9226d8a060607922c8340bef4e13d192577bfc15bd150cb429a2cb1081021567
7
+ data.tar.gz: 327de1533f573193dd9f13d1a99abd3f10451ae2980b98004b7791b82af30a5d4b5481ecbc5790bbdc02cca364bb6cd29a61db22fb3a1b01ec79f05b9f823d57
@@ -47,7 +47,7 @@ module Enlighten
47
47
  #overide the default config with parameters passed in, like (user_id)
48
48
  @params=self.class.default_params.merge(params)
49
49
  @systems = fetch(nil).systems
50
- @attributes = @systems.map{|system| system if system['system_id'] == @id }[0] rescue {}
50
+ @attributes = @systems.select{|system| system['system_id'] == @id }[0] rescue {}
51
51
  end
52
52
 
53
53
  def self.find(id)
@@ -1,3 +1,3 @@
1
1
  module Enlighten
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -113,6 +113,20 @@ describe Enlighten::System do
113
113
  end
114
114
  end
115
115
 
116
+ describe "attributes for different id" do
117
+ let(:system){
118
+ Enlighten::System.stub_any_instance(:api_response,load_fixture(:index)) do
119
+ Enlighten::System.new(:id=>283776)
120
+ end
121
+ }
122
+ it "should set a system_id" do
123
+ system.system_id.must_equal 283776
124
+ end
125
+ it "should set a system_name" do
126
+ system.system_name.must_equal "Brown/Pontoriero Residence"
127
+ end
128
+ end
129
+
116
130
  describe 'REST end points' do
117
131
  it "should return a system summary upon creation" do
118
132
  system.stub(:api_response, load_fixture(:summary)) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enlighten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Martin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler