bridge_api 0.1.21 → 0.1.22

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
- SHA1:
3
- metadata.gz: 23e484eca3a30379d5ea34f5cad98d315a1ddb74
4
- data.tar.gz: bbd7dc872d31056ee05dc05c3f3c3642b27a260d
2
+ SHA256:
3
+ metadata.gz: '015874326c09a90bd78033b8960c07797da6c983eefbf41fb039d7dd187618cf'
4
+ data.tar.gz: eb8dc80183260096aa252c2efd771542e72cc27cde7339619c5aca35460305b5
5
5
  SHA512:
6
- metadata.gz: c3c1314b45b45f6c01d1b41ce790b9b11dc2feef7e192e759ff0a8352f7080328aee978cf388e729f1c1db2fa3543523ca8f3090f7d06a732217fa44e4a25f30
7
- data.tar.gz: 598319ec388b85afb5acbd47fb4790d6c659c3129c23706dd47e7a9fdd73f92d3d5326fa614a6da7ad68ce04e78789e29f25d53aee3ea21ff67c72bcd51d001d
6
+ metadata.gz: e043912c7200fe1805032ab8b7095e471f7886b5b0687253aa24394db7f676311d9cfed5f39c18a5f0f2a09c475bd54ce3199dd3b6bc7f7327c8a9dacd8d82af
7
+ data.tar.gz: 8559e3a7b584c9fb2c5da6cdaff7ac4ae06821afcef00a172abc4e796520afd0c360414e31f5209302523c7fe1bea5a0bb9eed57c9f7c8405cc9ee85461ebd57
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.1.20)
4
+ bridge_api (0.1.21)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -5,6 +5,14 @@ module BridgeAPI
5
5
  get("#{API_PATH}#{ADMIN_PATH}#{SUB_ACCOUNT_PATH}", params)
6
6
  end
7
7
 
8
+ def deactivate_sub_account(subaccount_id, params = {})
9
+ put("#{API_PATH}#{ADMIN_PATH}#{SUB_ACCOUNT_PATH}/#{subaccount_id}/disable", params)
10
+ end
11
+
12
+ def activate_sub_account(subaccount_id, params = {})
13
+ put("#{API_PATH}#{ADMIN_PATH}#{SUB_ACCOUNT_PATH}/#{subaccount_id}/enable", params)
14
+ end
15
+
8
16
  def update_subaccount(subaccount_id, params = {})
9
17
  put("#{API_PATH}#{ADMIN_PATH}#{SUB_ACCOUNT_PATH}/#{subaccount_id}", params)
10
18
  end
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.1.21'.freeze unless defined?(BridgeAPI::VERSION)
2
+ VERSION = '0.1.22'.freeze unless defined?(BridgeAPI::VERSION)
3
3
  end
@@ -2,11 +2,24 @@ require 'test_helper'
2
2
 
3
3
  describe BridgeAPI::Client::SubAccount do
4
4
  before do
5
- @client = BridgeAPI::Client.new(prefix: 'http://test.bridge.com', token: 'test_token')
5
+ @client = BridgeAPI::Client.new(
6
+ prefix: 'http://test.bridge.com',
7
+ token: 'test_token'
8
+ )
6
9
  end
7
10
 
8
11
  it 'should get all subaccounts' do
9
12
  response = @client.get_sub_accounts
10
13
  expect(response.first['id']).to(eq('141'))
11
14
  end
15
+
16
+ it 'should activate a subaccount' do
17
+ response = @client.activate_sub_account(1)
18
+ expect(response.first['id']).to(eq('141'))
19
+ end
20
+
21
+ it 'should deactivate a subaccount' do
22
+ response = @client.deactivate_sub_account(1)
23
+ expect(response.first['id']).to(eq('141'))
24
+ end
12
25
  end
@@ -158,11 +158,19 @@ class FakeBridge < Sinatra::Base
158
158
  end
159
159
 
160
160
  # Sub Accounts
161
- get %r{/api/admin/sub_accounts} do
161
+ get %r{/api/admin/sub_accounts$} do
162
162
  get_json_data 200, 'sub_accounts.json'
163
163
  end
164
164
 
165
- put %r{/api/admin/sub_accounts} do
165
+ put %r{/api/admin/sub_accounts$} do
166
+ get_json_data 200, 'sub_accounts.json'
167
+ end
168
+
169
+ put %r{/api/admin/sub_accounts/\d+/disable} do
170
+ get_json_data 200, 'sub_accounts.json'
171
+ end
172
+
173
+ put %r{/api/admin/sub_accounts/\d+/enable} do
166
174
  get_json_data 200, 'sub_accounts.json'
167
175
  end
168
176
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.21
4
+ version: 0.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2018-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -261,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
261
261
  version: '0'
262
262
  requirements: []
263
263
  rubyforge_project:
264
- rubygems_version: 2.6.14
264
+ rubygems_version: 2.7.3
265
265
  signing_key:
266
266
  specification_version: 4
267
267
  summary: Bridge API
@@ -299,4 +299,3 @@ test_files:
299
299
  - spec/fixtures/users.json
300
300
  - spec/support/fake_bridge.rb
301
301
  - spec/test_helper.rb
302
- has_rdoc: