quiz_api_client 4.13.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b00457ab08c111b3cbed96f2581a0491cfbc1aaa8444228bb171754db5d302a6
4
- data.tar.gz: da4deb0cb2166b04d3c293eb7ab10891ece8efab5c12485e2c14b4802767435e
3
+ metadata.gz: 9ba12e6decb1a28b9587740a754e454a58c5345d28cf72632b267484bc82eab0
4
+ data.tar.gz: 7f7773f75f5f586abf61542bb32b013cba0c25e70feb498d709b6682b6f65f2a
5
5
  SHA512:
6
- metadata.gz: 1b0fe620b198f56743e58a19414906d1b42d9b1b26181824a4d3ffa5df8d4ba9cdd5f9f69ffb116b72dfe1efbbace4919781c87608f9801cfa368b5de4cb24ee
7
- data.tar.gz: ac18907b4a8454d2d9c0309b61ab2aff3439358678b04ad8754555d0c6c3caba2e4437eede06f5d51345e7b044af63deb5cdad8205bfdb789e3a1923cd656219
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:)
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '4.13.0'.freeze
2
+ VERSION = '4.13.1'.freeze
3
3
  end
@@ -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.0
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-07-17 00:00:00.000000000 Z
18
+ date: 2023-08-23 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: httparty