aptible-auth 0.11.14 → 0.11.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aptible/auth/membership.rb +1 -1
- data/lib/aptible/auth/user.rb +3 -1
- data/lib/aptible/auth/version.rb +1 -1
- data/spec/aptible/auth/user_spec.rb +11 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 988f035b08404c743665c27fc943def97d1ef3ce
|
4
|
+
data.tar.gz: 1542ad296a37085507dbcfff254bb36914d7988f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecb2f54c418c34412ab0d154f931134698f92d49c3762f9fcfd2d565d65b1ff38d886d595c8c3f81f4f4d7e3b3d39ac1b528181196c5a4df374f371dde809edc
|
7
|
+
data.tar.gz: 750343384012634983eb521d2a2c0d53ed22036aaf3f9d08db2b3c94edff6109ca76575be183fd1a4360dc1fe5e38438cb3319ed6c49a7fb9f4f35122b978d59
|
data/lib/aptible/auth/user.rb
CHANGED
@@ -14,7 +14,9 @@ module Aptible
|
|
14
14
|
field :updated_at, type: Time
|
15
15
|
|
16
16
|
def organizations
|
17
|
-
|
17
|
+
# Establish uniqueness of requests before loading all organizations
|
18
|
+
# We can do this by reading the `organization` link for each role
|
19
|
+
roles.map(&:links).map(&:organization).uniq(&:href).map(&:get)
|
18
20
|
end
|
19
21
|
|
20
22
|
def operations
|
data/lib/aptible/auth/version.rb
CHANGED
@@ -2,14 +2,22 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Aptible::Auth::User do
|
4
4
|
describe '#organizations' do
|
5
|
+
let(:org_id) { 1 }
|
5
6
|
let(:so) { double 'Aptible::Auth::Role' }
|
6
7
|
let(:owner) { double 'Aptible::Auth::Role' }
|
7
8
|
let(:org) { double 'Aptible::Auth::Organization' }
|
9
|
+
let(:organization_link) do
|
10
|
+
double('Aptible::Auth::Organization::Link', href: '/organizations/1')
|
11
|
+
end
|
12
|
+
let(:role_link) { double('Aptible::Auth::Role::Link') }
|
8
13
|
|
9
14
|
before do
|
10
|
-
|
11
|
-
|
12
|
-
|
15
|
+
role_link.stub(:organization) { organization_link }
|
16
|
+
organization_link.stub(:get) { org }
|
17
|
+
|
18
|
+
org.stub(:id) { org_id }
|
19
|
+
so.stub(:links) { role_link }
|
20
|
+
owner.stub(:links) { role_link }
|
13
21
|
end
|
14
22
|
|
15
23
|
it 'should return empty if no organizations' do
|
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.11.
|
4
|
+
version: 0.11.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Macreery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aptible-billing
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
223
|
rubyforge_project:
|
224
|
-
rubygems_version: 2.4.
|
224
|
+
rubygems_version: 2.4.8
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Ruby client for auth.aptible.com
|