aptible-auth 0.11.0 → 0.11.1

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: 460acf8deaa097c6d63e450d74111102823115b4
4
- data.tar.gz: c74f51acad4612ea3447c9713436586e34b1c5a4
3
+ metadata.gz: 5e4f0de847d45813da39ecd56360515cf2c3e912
4
+ data.tar.gz: 447e42672717fd9e2302fa80a07c3f8d13a21cf5
5
5
  SHA512:
6
- metadata.gz: a33c6799467ac8d74678e4c186212ccb6415e5720edb69c69ec9eedf355ca24d635538f0e9d8bb674c8a855940171b68bbef74cbe7e4959e3ab2eb5f057d4386
7
- data.tar.gz: 27a7dc99ecf30a04d1fd95a80134153f27d88d3be0ce7c669c2273fbc9564c3887257087e28f622e5bdd146bcbb2e23770b61eb936abebca6270224873864fc8
6
+ metadata.gz: afa807cc4efd327be1d168b0c6311339ab28de386f14f5776ca11095d6f132eeca34e52edfff26839baf63a82576141b328319c58279829dc988738878fcd48b
7
+ data.tar.gz: b70cbe5569b929daadaa474d7c282964827488bd892236544cc5875b9541b088d359de8611c8d1ef173f869d82db68d6b5621d33d81f7c8f38b680f1adcbfd0c
data/aptible-auth.gemspec CHANGED
@@ -29,5 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency 'aptible-tasks', '>= 0.2.0'
30
30
  spec.add_development_dependency 'rake'
31
31
  spec.add_development_dependency 'rspec', '~> 2.0'
32
+ spec.add_development_dependency 'rspec-its'
32
33
  spec.add_development_dependency 'pry'
33
34
  end
@@ -30,6 +30,11 @@ module Aptible
30
30
  )
31
31
  end
32
32
 
33
+ def can_manage_compliance?
34
+ return false unless billing_detail
35
+ %w(production pilot).include?(billing_detail.plan)
36
+ end
37
+
33
38
  def privileged_roles
34
39
  roles.select(&:privileged?)
35
40
  end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Auth
3
- VERSION = '0.11.0'
3
+ VERSION = '0.11.1'
4
4
  end
5
5
  end
@@ -1,6 +1,36 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Aptible::Auth::Organization do
4
+ describe '#can_manage_compliance?' do
5
+ before { subject.stub(:billing_detail) { billing_detail } }
6
+
7
+ context 'without a billing detail' do
8
+ let(:billing_detail) { nil }
9
+ it 'should return false' do
10
+ expect(subject.can_manage_compliance?).to eq false
11
+ end
12
+ end
13
+
14
+ context 'with a billing detail' do
15
+ let(:billing_detail) { double Aptible::Billing::BillingDetail }
16
+
17
+ it 'should return true with production plan' do
18
+ billing_detail.stub(:plan) { 'production' }
19
+ expect(subject.can_manage_compliance?).to eq true
20
+ end
21
+
22
+ it 'should return false with development plan' do
23
+ billing_detail.stub(:plan) { 'development' }
24
+ expect(subject.can_manage_compliance?).to eq false
25
+ end
26
+
27
+ it 'should return false with platform plan' do
28
+ billing_detail.stub(:plan) { 'platform' }
29
+ expect(subject.can_manage_compliance?).to eq false
30
+ end
31
+ end
32
+ end
33
+
4
34
  describe '#security_officer' do
5
35
  let(:user) { double 'Aptible::Auth::User' }
6
36
 
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.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-21 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aptible-billing
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: '2.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rspec-its
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: pry
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -207,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
221
  version: '0'
208
222
  requirements: []
209
223
  rubyforge_project:
210
- rubygems_version: 2.4.5
224
+ rubygems_version: 2.4.6
211
225
  signing_key:
212
226
  specification_version: 4
213
227
  summary: Ruby client for auth.aptible.com