bridge_api 0.1.30 → 0.1.31
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/bridge_api/client/account.rb +5 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/account_spec.rb +13 -0
- data/spec/support/fake_bridge.rb +4 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 747af705d2184ac6225cfe842f5168ab8597cd76
|
4
|
+
data.tar.gz: 84a8b962fbfb3d9c74e5be5f78bdc222c6da2547
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d0fe8a219696e711ffa1c2456c0e40e411e259bf1004cf536e62b91fcfc7233bb1a3c8af41eb0f058a3243bf3796fd0f25340864774d0275a14c61306e8f2e7
|
7
|
+
data.tar.gz: 48a6c528e92d505e16fb093d050e790fb96b980cc463f7ec873088fc97898e4e6fbdbe1125aae8a4946103883ecd68e8db526c3b3303f6329fffa44d65b7075f
|
@@ -1,6 +1,11 @@
|
|
1
1
|
module BridgeAPI
|
2
2
|
class Client
|
3
3
|
module Account
|
4
|
+
|
5
|
+
def create_account(params = {})
|
6
|
+
post("#{API_PATH}#{ADMIN_PATH}/sub_accounts", params)
|
7
|
+
end
|
8
|
+
|
4
9
|
def update_account(account_id, params = {})
|
5
10
|
put("#{API_PATH}#{SUPPORT_PATH}#{ACCOUNT_PATH}/#{account_id}", params)
|
6
11
|
end
|
data/lib/bridge_api/version.rb
CHANGED
@@ -7,6 +7,19 @@ describe BridgeAPI::Client::CourseTemplate do
|
|
7
7
|
)
|
8
8
|
end
|
9
9
|
|
10
|
+
it 'should create an account' do
|
11
|
+
templates = @client.create_account(
|
12
|
+
{
|
13
|
+
sub_account: {
|
14
|
+
locale: "en",
|
15
|
+
subdomain: 'subdomain',
|
16
|
+
name: 'subdomain'
|
17
|
+
}
|
18
|
+
}
|
19
|
+
)
|
20
|
+
expect(templates.status).to(eq(200))
|
21
|
+
end
|
22
|
+
|
10
23
|
it 'should update an account' do
|
11
24
|
templates = @client.update_account(1)
|
12
25
|
expect(templates.status).to(eq(200))
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -168,6 +168,10 @@ class FakeBridge < Sinatra::Base
|
|
168
168
|
end
|
169
169
|
|
170
170
|
# Sub Accounts
|
171
|
+
post %r{/api/admin/sub_accounts$} do
|
172
|
+
get_json_data 200, 'sub_accounts.json'
|
173
|
+
end
|
174
|
+
|
171
175
|
get %r{/api/admin/sub_accounts$} do
|
172
176
|
get_json_data 200, 'sub_accounts.json'
|
173
177
|
end
|
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.31
|
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-07-
|
11
|
+
date: 2018-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -319,4 +319,3 @@ test_files:
|
|
319
319
|
- spec/fixtures/users.json
|
320
320
|
- spec/support/fake_bridge.rb
|
321
321
|
- spec/test_helper.rb
|
322
|
-
has_rdoc:
|