aptible-auth 0.5.2 → 0.5.3
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/aptible/auth/user.rb +1 -1
- data/lib/aptible/auth/version.rb +1 -1
- data/spec/aptible/auth/user_spec.rb +26 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca4a9d2b5c68eb6a3bc594cf68004a13c3843b61
|
4
|
+
data.tar.gz: f0d1cb3b938429bdb1b6205c50fc29213e99cfd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366eb12cc1b762232a46f846bf85f2aa5c8d4f38dd8462c0a3552e82876ab74c4cfef3f0f1e01f8f630866287640de4e6013c8742cc1e42411446c261209e764
|
7
|
+
data.tar.gz: c26709fb7730c6c2f195a5a82412111ad35ceffeb28212d429bc5b1e962efb640354f0a0d7d301ed37f694e8e967951b230f2dfcc7c8cc20800df599c1f69714
|
data/lib/aptible/auth/user.rb
CHANGED
data/lib/aptible/auth/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Aptible::Auth::User do
|
4
|
+
describe '#organizations' do
|
5
|
+
let(:so) { double 'Aptible::Auth::Role' }
|
6
|
+
let(:owner) { double 'Aptible::Auth::Role' }
|
7
|
+
let(:org) { double 'Aptible::Auth::Organization' }
|
8
|
+
|
9
|
+
before do
|
10
|
+
org.stub(:id) { 1 }
|
11
|
+
so.stub(:organization) { org }
|
12
|
+
owner.stub(:organization) { org }
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should return empty if no organizations' do
|
16
|
+
subject.stub(:roles) { [] }
|
17
|
+
expect(subject.organizations.count).to eq 0
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should return unique organizations only' do
|
21
|
+
subject.stub(:roles) { [so, owner] }
|
22
|
+
expect(subject.organizations.count).to eq 1
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptible-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aptible-resource
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- spec/aptible/auth/organization_spec.rb
|
154
154
|
- spec/aptible/auth/resource_spec.rb
|
155
155
|
- spec/aptible/auth/token_spec.rb
|
156
|
+
- spec/aptible/auth/user_spec.rb
|
156
157
|
- spec/aptible/auth_spec.rb
|
157
158
|
- spec/shared/set_env.rb
|
158
159
|
- spec/spec_helper.rb
|
@@ -185,6 +186,7 @@ test_files:
|
|
185
186
|
- spec/aptible/auth/organization_spec.rb
|
186
187
|
- spec/aptible/auth/resource_spec.rb
|
187
188
|
- spec/aptible/auth/token_spec.rb
|
189
|
+
- spec/aptible/auth/user_spec.rb
|
188
190
|
- spec/aptible/auth_spec.rb
|
189
191
|
- spec/shared/set_env.rb
|
190
192
|
- spec/spec_helper.rb
|