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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88f17e825afd96df492d4be2c073dbe10eef3f97c6c835ffdcfaeb3d6819e82f
4
- data.tar.gz: 3b79209eea1c6b981b09d7601026b1f4c68452cd14b8fe7e76cdde0cc193d706
3
+ metadata.gz: 4162b5cdc4ae4af9f0c51f4bcdeb7d078a0094f297d91bf11d325119642922f9
4
+ data.tar.gz: 4af7c5d96b3e95df14ca20c1f2d60c678e5b3a90ad33c2fe86c9daa8eaadc758
5
5
  SHA512:
6
- metadata.gz: 66eb8df82ecce9bf89f0a087b7f15eb105793137e91edce41d0c68829610a006fba0dc666fff77bf588763508ee26efabf54d2522f84181110cf0eb11eda6946
7
- data.tar.gz: a418a116fd8ec3e290116e9ee16e0f63140159a65c278394d454a944e16e6e917275f7c51797c73ebf349cceca28dc547e9f516ef922cfa41ed415fb7860534e
6
+ metadata.gz: 1ba2625d2ef598d6e6a6ecd33ee4f2e69b13e896ed7588f520da817af9ccc543905d4f51d4c91b6598f7c0ac1023ca51c3b8827edc5b2c306ed6f91d8af05ce4
7
+ data.tar.gz: 2e70fc5fa2905cc3872b071f94306b628f52b0c8becbddf8085564ed5ec5efc1b70b199962cd7841101ebcff4818df85209f5efb03a004c9766385590f0dd27c
@@ -13,7 +13,7 @@ jobs:
13
13
  ruby-version: 2.7.0
14
14
  - name: Install bundle and gems # Step 4
15
15
  run: |
16
- gem install bundler
16
+ gem install bundler -v '2.3.26'
17
17
  bundle install --jobs 4 --retry 3
18
18
  - name: Run tests # Step 6
19
19
  run: COVERAGE=true bundle exec rspec
@@ -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
@@ -47,6 +47,7 @@ module BridgeAPI
47
47
  DUE_DATE_PATH = '/due_date'
48
48
  RESET_PATH = '/reset'
49
49
  NEW_TEMPORARY_USERS = '/new_temporary_users'
50
+ LEARNER_ENROLLMENTS = '/learner_enrollments'
50
51
  RESULT_MAPPING = {}
51
52
 
52
53
  Dir[File.dirname(__FILE__) + '/client/*.rb'].each do |file|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeAPI
4
- VERSION = '0.3.3' unless defined?(BridgeAPI::VERSION)
4
+ VERSION = '0.3.4' unless defined?(BridgeAPI::VERSION)
5
5
  end
@@ -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
+ }
@@ -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.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 00:00:00.000000000 Z
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