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 +5 -5
- data/Gemfile.lock +1 -1
- data/lib/bridge_api/client/sub_account.rb +8 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/sub_account_spec.rb +14 -1
- data/spec/support/fake_bridge.rb +10 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: '015874326c09a90bd78033b8960c07797da6c983eefbf41fb039d7dd187618cf'
|
4
|
+
data.tar.gz: eb8dc80183260096aa252c2efd771542e72cc27cde7339619c5aca35460305b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e043912c7200fe1805032ab8b7095e471f7886b5b0687253aa24394db7f676311d9cfed5f39c18a5f0f2a09c475bd54ce3199dd3b6bc7f7327c8a9dacd8d82af
|
7
|
+
data.tar.gz: 8559e3a7b584c9fb2c5da6cdaff7ac4ae06821afcef00a172abc4e796520afd0c360414e31f5209302523c7fe1bea5a0bb9eed57c9f7c8405cc9ee85461ebd57
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/bridge_api/version.rb
CHANGED
@@ -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(
|
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
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -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.
|
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
|
+
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.
|
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:
|