bridge_api 0.0.13 → 0.0.14

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: aa247d0c90a1e78f78434ff7a13b768627956db8
4
- data.tar.gz: 7112201e71a64448ba46a366c77bd353a306df9a
3
+ metadata.gz: 4461f7ecab786b3b2ca3b1a769d0878306e29cb2
4
+ data.tar.gz: 165d25273ca8cebdcf14ec7c60331462d8b815e4
5
5
  SHA512:
6
- metadata.gz: b35e1515f91a563140e1c889e5346e9ef8886ba153d608f1f250c709ccba5a53600e50168c787ade26c93145aabd05c9adc6e6e86c189205400df19bbeb0b74f
7
- data.tar.gz: 0a5b2d4b7884c7d87ab342728b78d447b90fcd4c3e7e6db3ba88883f841eb4a935256d895740b1cac53dd380dcdd3d620e1d862ff9074a93447e6cb3e874da8e
6
+ metadata.gz: 0254b6676cac32f5ff64cc1c211a7059e5f91ddecac4d5cba3c4fee08585648e61257b633e5fbcf9964e7fd2decd71070122965650936561491c870ff6aaf984
7
+ data.tar.gz: a0668e249527635573b8b7b4afd6d17f082c1d28f52325c4c2775ee19db151ba650ba714b50764c82616d165ad58d173811c979a82d03523841409a01145b792
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_api (0.0.12)
4
+ bridge_api (0.0.14)
5
5
  faraday (~> 0.9.0)
6
6
  faraday_middleware (~> 0.9.0)
7
7
  footrest (>= 0.5.1)
@@ -9,16 +9,16 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (5.0.2)
13
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
+ activesupport (4.2.7.1)
14
13
  i18n (~> 0.7)
14
+ json (~> 1.7, >= 1.7.7)
15
15
  minitest (~> 5.1)
16
+ thread_safe (~> 0.3, >= 0.3.4)
16
17
  tzinfo (~> 1.1)
17
18
  addressable (2.5.1)
18
19
  public_suffix (~> 2.0, >= 2.0.2)
19
20
  byebug (8.2.5)
20
21
  coderay (1.1.1)
21
- concurrent-ruby (1.0.5)
22
22
  crack (0.4.3)
23
23
  safe_yaml (~> 1.0.0)
24
24
  diff-lcs (1.3)
@@ -31,10 +31,11 @@ GEM
31
31
  faraday (~> 0.9.0)
32
32
  link_header (>= 0.0.7)
33
33
  hashdiff (0.3.2)
34
- i18n (0.8.1)
34
+ i18n (0.8.6)
35
+ json (1.8.6)
35
36
  link_header (0.0.8)
36
37
  method_source (0.8.2)
37
- minitest (5.10.1)
38
+ minitest (5.10.2)
38
39
  multipart-post (2.0.0)
39
40
  pry (0.10.4)
40
41
  coderay (~> 1.1.0)
@@ -83,4 +84,4 @@ DEPENDENCIES
83
84
  webmock (~> 1.22.6)
84
85
 
85
86
  BUNDLED WITH
86
- 1.13.6
87
+ 1.14.6
@@ -0,0 +1,11 @@
1
+ module BridgeAPI
2
+ class Client
3
+ module LiveCourse
4
+
5
+ def get_all_live_courses(params = {})
6
+ get("#{API_PATH}#{AUTHOR_PATH}/live_courses", params)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module BridgeAPI
2
+ class Client
3
+ module LiveCourseEnrollment
4
+
5
+ def get_all_live_course_enrollments(live_course, params = {})
6
+ get("#{API_PATH}#{AUTHOR_PATH}/live_courses/#{live_course}/learners", params)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module BridgeAPI
2
- VERSION = '0.0.13' unless defined?(BridgeAPI::VERSION)
3
- end
2
+ VERSION = '0.0.14' unless defined?(BridgeAPI::VERSION)
3
+ end
@@ -0,0 +1,15 @@
1
+ require 'test_helper'
2
+
3
+ describe BridgeAPI::Client::LiveCourseEnrollment do
4
+ before do
5
+ @client = BridgeAPI::Client.new(prefix: "http://test.bridge.com", token: "test_token")
6
+ end
7
+
8
+ it 'should get a list of live course enrollments' do
9
+ response = @client.get_all_live_course_enrollments(1)
10
+ expect(response.status).to eq(200)
11
+ expect(response.members.count).to eq(1)
12
+ expect(response.members.first['id']).to eq('3')
13
+ expect(response.members.first['name']).to eq('jshaffer@instructure.com')
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ require 'test_helper'
2
+
3
+ describe BridgeAPI::Client::LiveCourse do
4
+ before do
5
+ @client = BridgeAPI::Client.new(prefix: "http://test.bridge.com", token: "test_token")
6
+ end
7
+
8
+ it 'should get a list of live courses' do
9
+ response = @client.get_all_live_courses()
10
+ expect(response.status).to eq(200)
11
+ expect(response.members.count).to eq(2)
12
+ expect(response.members.first['id']).to eq('1')
13
+ expect(response.members.first['title']).to eq('New Rep Training')
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ {
2
+ "meta": {},
3
+ "enrollments": [
4
+ {
5
+ "id": "3",
6
+ "user_id": "13",
7
+ "name": "jshaffer@instructure.com",
8
+ "email": "jshaffer@instructure.com",
9
+ "avatar_url": null,
10
+ "start_at": "2017-04-03T00:00:00.000-06:00",
11
+ "state": "complete",
12
+ "expires_at": null,
13
+ "active": true,
14
+ "sources": [
15
+ {
16
+ "id": "2",
17
+ "type": "LiveCourseSession"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "meta": {},
3
+ "live_courses": [
4
+ {
5
+ "id": "1",
6
+ "title": "New Rep Training",
7
+ "author_id": "2",
8
+ "description": null,
9
+ "external_course_id": null,
10
+ "sessions_count": 1,
11
+ "enrollments_count": 18,
12
+ "is_published": true,
13
+ "meta": {
14
+ "domain_id": "1",
15
+ "sub_account_id": "1",
16
+ "is_library_item": false,
17
+ "id": "1",
18
+ "name": "Another Name",
19
+ "is_root": true,
20
+ "sub_accounts_exist": false,
21
+ "not_current": false,
22
+ "tac_type": "domestic",
23
+ "tac_custom_body_markup": null,
24
+ "tac_updated_at": "2017-05-05T19:53:36.376Z"
25
+ },
26
+ "has_shared_enrollments": false
27
+ },
28
+ {
29
+ "id": "2",
30
+ "title": "",
31
+ "author_id": "2",
32
+ "description": null,
33
+ "external_course_id": null,
34
+ "sessions_count": 0,
35
+ "enrollments_count": 0,
36
+ "is_published": true,
37
+ "meta": {
38
+ "domain_id": "1",
39
+ "is_library_item": true,
40
+ "id": "1",
41
+ "name": "Some Name",
42
+ "is_root": true,
43
+ "sub_accounts_exist": false,
44
+ "not_current": false,
45
+ "tac_type": "domestic",
46
+ "tac_custom_body_markup": null,
47
+ "tac_updated_at": "2017-05-05T19:53:36.376Z"
48
+ },
49
+ "has_shared_enrollments": false
50
+ }
51
+ ]
52
+ }
@@ -144,6 +144,17 @@ class FakeBridge < Sinatra::Base
144
144
  get_json_data 200, 'group.json'
145
145
  end
146
146
 
147
+ #Live Courses
148
+ get %r{/api/author/live_courses$} do
149
+ get_json_data 200, 'live_courses.json'
150
+ end
151
+
152
+ #Live Course Enrollments
153
+ get %r{/api/author/live_courses/\d+/learners} do
154
+ get_json_data 200, 'live_course_enrollments.json'
155
+ end
156
+
157
+
147
158
  private
148
159
 
149
160
  def get_json_data(response_code, file_name)
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.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2017-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -195,6 +195,8 @@ files:
195
195
  - lib/bridge_api/client/data_dump.rb
196
196
  - lib/bridge_api/client/enrollment.rb
197
197
  - lib/bridge_api/client/group.rb
198
+ - lib/bridge_api/client/live_course.rb
199
+ - lib/bridge_api/client/live_course_enrollment.rb
198
200
  - lib/bridge_api/client/manager.rb
199
201
  - lib/bridge_api/client/program_enrollment.rb
200
202
  - lib/bridge_api/client/user.rb
@@ -204,6 +206,8 @@ files:
204
206
  - spec/bridge_api/client/data_dump_spec.rb
205
207
  - spec/bridge_api/client/enrollment_spec.rb
206
208
  - spec/bridge_api/client/group_spec.rb
209
+ - spec/bridge_api/client/live_course_enrollments_spec.rb
210
+ - spec/bridge_api/client/live_course_spec.rb
207
211
  - spec/bridge_api/client/manager_spec.rb
208
212
  - spec/bridge_api/client/program_enrollment_spec.rb
209
213
  - spec/bridge_api/client/user_spec.rb
@@ -217,6 +221,8 @@ files:
217
221
  - spec/fixtures/enrollment.json
218
222
  - spec/fixtures/enrollments.json
219
223
  - spec/fixtures/group.json
224
+ - spec/fixtures/live_course_enrollments.json
225
+ - spec/fixtures/live_courses.json
220
226
  - spec/fixtures/managers.json
221
227
  - spec/fixtures/program_enrollments.json
222
228
  - spec/fixtures/programs.json
@@ -254,6 +260,8 @@ test_files:
254
260
  - spec/bridge_api/client/data_dump_spec.rb
255
261
  - spec/bridge_api/client/enrollment_spec.rb
256
262
  - spec/bridge_api/client/group_spec.rb
263
+ - spec/bridge_api/client/live_course_enrollments_spec.rb
264
+ - spec/bridge_api/client/live_course_spec.rb
257
265
  - spec/bridge_api/client/manager_spec.rb
258
266
  - spec/bridge_api/client/program_enrollment_spec.rb
259
267
  - spec/bridge_api/client/user_spec.rb
@@ -267,6 +275,8 @@ test_files:
267
275
  - spec/fixtures/enrollment.json
268
276
  - spec/fixtures/enrollments.json
269
277
  - spec/fixtures/group.json
278
+ - spec/fixtures/live_course_enrollments.json
279
+ - spec/fixtures/live_courses.json
270
280
  - spec/fixtures/managers.json
271
281
  - spec/fixtures/program_enrollments.json
272
282
  - spec/fixtures/programs.json