bridge_api 0.1.48 → 0.1.49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/lib/bridge_api/client.rb +2 -0
- data/lib/bridge_api/client/enrollment.rb +5 -1
- data/lib/bridge_api/version.rb +1 -1
- data/spec/bridge_api/client/enrollment_spec.rb +6 -1
- data/spec/support/fake_bridge.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b27b51312f62d92a1d419e64d8bb10ec4f992e53324c2457532667df42cdebe
|
4
|
+
data.tar.gz: aca732c96ce3a4bbdf95909e390d7697be30603888228dfb992a4ac60342bfee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90451393ad730daab429e5fa239ffa56773f69f8de24380318c05ee080b98354432a0d7527af5a27c30b23f872905cbe06f91ede9bd43dc521811a6632c03196
|
7
|
+
data.tar.gz: e763cd9abcac17a4f0fca1155c385f38d5e20d8b4a93fd177cf2c3557022ab57110bfc14f3362bab0003266884499cc55bb929dc123f4ec482aca975fbf334a7
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bridge_api (0.1.
|
4
|
+
bridge_api (0.1.48)
|
5
5
|
faraday (~> 0.9.0)
|
6
6
|
faraday_middleware (>= 0.12.2)
|
7
7
|
footrest (>= 0.5.1)
|
@@ -11,7 +11,7 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
activesupport (5.2.
|
14
|
+
activesupport (5.2.2)
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
16
|
i18n (>= 0.7, < 2)
|
17
17
|
minitest (~> 5.1)
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
public_suffix (>= 2.0.2, < 4.0)
|
21
21
|
byebug (8.2.5)
|
22
22
|
coderay (1.1.2)
|
23
|
-
concurrent-ruby (1.1.
|
23
|
+
concurrent-ruby (1.1.3)
|
24
24
|
crack (0.4.3)
|
25
25
|
safe_yaml (~> 1.0.0)
|
26
26
|
diff-lcs (1.3)
|
@@ -92,4 +92,4 @@ DEPENDENCIES
|
|
92
92
|
webmock (~> 1.22.6)
|
93
93
|
|
94
94
|
BUNDLED WITH
|
95
|
-
1.
|
95
|
+
1.17.1
|
data/lib/bridge_api/client.rb
CHANGED
@@ -40,6 +40,8 @@ module BridgeAPI
|
|
40
40
|
PUBLISH_PATH = '/publish'.freeze
|
41
41
|
WEB_CONFERENCE_PATH = '/web_conference'.freeze
|
42
42
|
RESTORE_PATH = '/restore'.freeze
|
43
|
+
DUE_DATE_PATH = '/due_date'.freeze
|
44
|
+
RESET_PATH = '/reset'.freeze
|
43
45
|
RESULT_MAPPING = {}
|
44
46
|
|
45
47
|
Dir[File.dirname(__FILE__) + '/client/*.rb'].each do |file|
|
@@ -18,7 +18,11 @@ module BridgeAPI
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def update_enrollment_due_date(enrollment_id, params = {})
|
21
|
-
post("#{API_PATH}#{AUTHOR_PATH}#{ENROLLMENT_PATH}/#{enrollment_id}
|
21
|
+
post("#{API_PATH}#{AUTHOR_PATH}#{ENROLLMENT_PATH}/#{enrollment_id}#{DUE_DATE_PATH}", params)
|
22
|
+
end
|
23
|
+
|
24
|
+
def reset_enrollment(enrollment_id, params = {})
|
25
|
+
post("#{API_PATH}#{ADMIN_PATH}#{ENROLLMENT_PATH}/#{enrollment_id}#{RESET_PATH}", params)
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
data/lib/bridge_api/version.rb
CHANGED
@@ -28,6 +28,11 @@ describe BridgeAPI::Client::Enrollment do
|
|
28
28
|
it 'should update due date for enrollments' do
|
29
29
|
enrollment = [{ end_at: nil }]
|
30
30
|
response = @client.update_enrollment_due_date(1, enrollment)
|
31
|
-
expect(response.status).to(eq
|
31
|
+
expect(response.status).to(eq(200))
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should reset an enrollment for a course template' do
|
35
|
+
response = @client.reset_enrollment(1)
|
36
|
+
expect(response.status).to(eq(204))
|
32
37
|
end
|
33
38
|
end
|
data/spec/support/fake_bridge.rb
CHANGED
@@ -112,6 +112,10 @@ class FakeBridge < Sinatra::Base
|
|
112
112
|
get_json_data 200, 'enrollment.json'
|
113
113
|
end
|
114
114
|
|
115
|
+
post %r{/api/admin/enrollments/\d+/reset} do
|
116
|
+
get_json_data 204, 'enrollment.json'
|
117
|
+
end
|
118
|
+
|
115
119
|
# Custom Fields
|
116
120
|
|
117
121
|
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.1.
|
4
|
+
version: 0.1.49
|
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-
|
11
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|