quiz_api_client 4.13.0 → 4.13.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ba12e6decb1a28b9587740a754e454a58c5345d28cf72632b267484bc82eab0
|
4
|
+
data.tar.gz: 7f7773f75f5f586abf61542bb32b013cba0c25e70feb498d709b6682b6f65f2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3820e1479d10ed16e76f278a741b359334af9c494fd06d3d4db93f597f7209201a4a43b7492d7c90e5d84187e12f69ca56fb0deff1e404dac91bb95a15c5ef82
|
7
|
+
data.tar.gz: fdc87d815718c2a0585cbe1bcc50b93c9aadcf0b18e384ab0dd000f9e619e83e89a881b70db478732e1f44d949eabcfbb5f4b4b99d9de4e9462caa36b699b6ac
|
@@ -26,6 +26,13 @@ module QuizApiClient::Services
|
|
26
26
|
)
|
27
27
|
end
|
28
28
|
|
29
|
+
def associate_courses(params:, token: nil)
|
30
|
+
client(token: token).patch(
|
31
|
+
"/api/courses/#{params[:canvas_id]}/associate_courses",
|
32
|
+
course_canvas_ids: params[:course_canvas_ids]
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
29
36
|
private
|
30
37
|
|
31
38
|
def post_to_quiz_api(params:, token:)
|
@@ -174,4 +174,39 @@ describe QuizApiClient::Services::CoursesService do
|
|
174
174
|
).to eq(response)
|
175
175
|
end
|
176
176
|
end
|
177
|
+
|
178
|
+
describe '#associate_courses' do
|
179
|
+
let(:params) { { canvas_id: 1, course_canvas_ids: [2, 3, 4] } }
|
180
|
+
let(:response) do
|
181
|
+
{
|
182
|
+
'course' => {
|
183
|
+
'id' => '4',
|
184
|
+
'title' => 'foo',
|
185
|
+
'canvas_id' => '2',
|
186
|
+
'is_blueprint' => true,
|
187
|
+
'created_at' => '2022-06-22T18:59:27.577Z',
|
188
|
+
'updated_at' => '2022-06-22T18:59:27.577Z'
|
189
|
+
},
|
190
|
+
'courses_synced' => params[:course_canvas_ids]
|
191
|
+
}
|
192
|
+
end
|
193
|
+
|
194
|
+
let(:expected_url) { "https://#{host}/api/courses/1/associate_courses" }
|
195
|
+
|
196
|
+
before do
|
197
|
+
stub_request(:patch, expected_url)
|
198
|
+
.with(body: { course_canvas_ids: params[:course_canvas_ids] }.to_json)
|
199
|
+
.to_return(
|
200
|
+
status: 200,
|
201
|
+
body: response.to_json,
|
202
|
+
headers: { 'Content-Type' => 'application/json' }
|
203
|
+
)
|
204
|
+
end
|
205
|
+
|
206
|
+
it 'patches to the correct endpoint and returns the response' do
|
207
|
+
expect(
|
208
|
+
subject.associate_courses(params: params, token: 'token').parsed_response
|
209
|
+
).to eq(response)
|
210
|
+
end
|
211
|
+
end
|
177
212
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quiz_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.13.
|
4
|
+
version: 4.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Slaughter
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: exe
|
17
17
|
cert_chain: []
|
18
|
-
date: 2023-
|
18
|
+
date: 2023-08-23 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httparty
|