bridge_api 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/lib/bridge_api/client/enrollment.rb +5 -0
- data/lib/bridge_api/client.rb +1 -0
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/enrollment_spec.rb +5 -0
- data/spec/fixtures/learner_enrollments.json +18 -0
- data/spec/support/fake_bridge.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4162b5cdc4ae4af9f0c51f4bcdeb7d078a0094f297d91bf11d325119642922f9
|
4
|
+
data.tar.gz: 4af7c5d96b3e95df14ca20c1f2d60c678e5b3a90ad33c2fe86c9daa8eaadc758
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ba2625d2ef598d6e6a6ecd33ee4f2e69b13e896ed7588f520da817af9ccc543905d4f51d4c91b6598f7c0ac1023ca51c3b8827edc5b2c306ed6f91d8af05ce4
|
7
|
+
data.tar.gz: 2e70fc5fa2905cc3872b071f94306b628f52b0c8becbddf8085564ed5ec5efc1b70b199962cd7841101ebcff4818df85209f5efb03a004c9766385590f0dd27c
|
data/.github/workflows/ci.yml
CHANGED
@@ -26,6 +26,11 @@ module BridgeAPI
|
|
26
26
|
def reset_enrollment(enrollment_id, params = {})
|
27
27
|
post("#{API_PATH}#{ADMIN_PATH}#{ENROLLMENT_PATH}/#{enrollment_id}#{RESET_PATH}", params)
|
28
28
|
end
|
29
|
+
|
30
|
+
# Get all current enrollments for the learner.
|
31
|
+
def get_learner_enrollments(learner_id, params = {})
|
32
|
+
get("#{API_PATH}#{AUTHOR_PATH}#{LEARNERS_PATH}/#{learner_id}#{LEARNER_ENROLLMENTS}", params)
|
33
|
+
end
|
29
34
|
end
|
30
35
|
end
|
31
36
|
end
|
data/lib/bridge_api/client.rb
CHANGED
data/lib/bridge_api/version.rb
CHANGED
@@ -31,4 +31,9 @@ describe BridgeAPI::Client::Enrollment do
|
|
31
31
|
response = @client.reset_enrollment(1)
|
32
32
|
expect(response.status).to(eq(204))
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'should get all current learner enrollments' do
|
36
|
+
learner_enrollments = @client.get_learner_enrollments(1)
|
37
|
+
expect(learner_enrollments.length).to(eq(2))
|
38
|
+
end
|
34
39
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"learner_enrollments": [
|
3
|
+
{
|
4
|
+
"id": "1",
|
5
|
+
"learnable_id": 1,
|
6
|
+
"learnable_type": "CourseTemplate",
|
7
|
+
"state": "created",
|
8
|
+
"inactive": null
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"id": "2",
|
12
|
+
"learnable_id": 2,
|
13
|
+
"learnable_type": "CourseTemplate",
|
14
|
+
"state": "created",
|
15
|
+
"inactive": null
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -130,6 +130,10 @@ class FakeBridge < Sinatra::Base
|
|
130
130
|
get_json_data 204, 'enrollment.json'
|
131
131
|
end
|
132
132
|
|
133
|
+
get %r{/api/author/learners/\d+/learner_enrollments$} do
|
134
|
+
get_json_data 200, 'learner_enrollments.json'
|
135
|
+
end
|
136
|
+
|
133
137
|
# Custom Fields
|
134
138
|
|
135
139
|
get %r{/api/author/custom_fields} do
|
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.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jay Shaffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -279,6 +279,7 @@ files:
|
|
279
279
|
- spec/fixtures/enrollment.json
|
280
280
|
- spec/fixtures/enrollments.json
|
281
281
|
- spec/fixtures/group.json
|
282
|
+
- spec/fixtures/learner_enrollments.json
|
282
283
|
- spec/fixtures/learner_items.json
|
283
284
|
- spec/fixtures/live_course.json
|
284
285
|
- spec/fixtures/live_course_enrollments.json
|
@@ -354,6 +355,7 @@ test_files:
|
|
354
355
|
- spec/fixtures/enrollment.json
|
355
356
|
- spec/fixtures/enrollments.json
|
356
357
|
- spec/fixtures/group.json
|
358
|
+
- spec/fixtures/learner_enrollments.json
|
357
359
|
- spec/fixtures/learner_items.json
|
358
360
|
- spec/fixtures/live_course.json
|
359
361
|
- spec/fixtures/live_course_enrollments.json
|