quiz_api_client 4.5.1 → 4.5.2

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: 316ba7a8bde533e2ef09e6e0a5e2c443a597ae3bfda7c00cf5280c2ab5e75bb0
4
- data.tar.gz: ec869a63880d44c2fb7920f95dd80b042671c954bb4a5a972d6ebbc00261f5b1
3
+ metadata.gz: 70b15efbfcbaa839cb8926bd79a9e59ff4fac43d23fb9d9006b018660c57c208
4
+ data.tar.gz: 660cbf7a8ed8a218609c048412353c49144b27cbaad8ed7c2f7358fade2741f5
5
5
  SHA512:
6
- metadata.gz: 3611bb4fb2775b6a96669bd276cfa513cd47f1177dd98b76757fea5311241e4066184228dce6c9aa78b9f70a004ae908b56981870301f21527ae87068e7a29a0
7
- data.tar.gz: 4f9988a4c3791f69c25b53eb9db65194643d2d1639c8327f942a71e4264e7662c17f24a6094d6dfd58fd4168a6e53e78da613ba8f268f745d209b615838d62ac
6
+ metadata.gz: 957d26373a0ede105dd0cf541282101b33fd356cc1ad35458983f3bcb687fa0ff6d65bedb4cc1ff9bb64fa1d603d315845cb61e6b5d05949a294e6412e248b97
7
+ data.tar.gz: e5e1211e0a2d0556ab4ccf4b1273ea1ff0b179bc074bdc00e9f8cf11fdc2bd38b96c61c3ebdc81c6df7c64092adfae83817ae7b73557c62a46afbd2088757720
@@ -12,6 +12,13 @@ module QuizApiClient::Services
12
12
  delete_from_quiz_api(params: params, token: token)
13
13
  end
14
14
 
15
+ def sync_blueprint_restrictions(params:, token: nil)
16
+ client(token: token).post(
17
+ "/api/courses/#{params[:canvas_id]}/sync_blueprint_restrictions",
18
+ lock_quizzes: params[:lock_quizzes]
19
+ )
20
+ end
21
+
15
22
  private
16
23
 
17
24
  def post_to_quiz_api(params:, token:)
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '4.5.1'.freeze
2
+ VERSION = '4.5.2'.freeze
3
3
  end
@@ -100,4 +100,43 @@ describe QuizApiClient::Services::CoursesService do
100
100
  expect(response.body).to be_nil
101
101
  end
102
102
  end
103
+
104
+ describe '#sync_blueprint_restrictions' do
105
+ let(:params) { { canvas_id: 1, lock_quizzes: true } }
106
+ let(:response) do
107
+ {
108
+ 'course' => {
109
+ 'id' => '1',
110
+ 'title' => 'course one',
111
+ 'canvas_id' => '1',
112
+ 'is_blueprint' => true,
113
+ 'parent_course_id' => '',
114
+ 'created_at' => '2022-09-13T18:53:21.303Z',
115
+ 'updated_at' => '2022-09-13T18:53:21.367Z'
116
+ },
117
+ 'quizzes_synced' => [
118
+ 1,
119
+ 2
120
+ ]
121
+ }
122
+ end
123
+
124
+ let(:expected_url) { "https://#{host}/api/courses/1/sync_blueprint_restrictions" }
125
+
126
+ before do
127
+ stub_request(:post, expected_url)
128
+ .with(body: { lock_quizzes: true }.to_json)
129
+ .to_return(
130
+ status: 200,
131
+ body: response.to_json,
132
+ headers: { 'Content-Type' => 'application/json' }
133
+ )
134
+ end
135
+
136
+ it 'posts to the correct endpoint and returns the response' do
137
+ expect(
138
+ subject.sync_blueprint_restrictions(params: params, token: 'token').parsed_response
139
+ ).to eq(response)
140
+ end
141
+ end
103
142
  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.5.1
4
+ version: 4.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Slaughter
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2022-08-08 00:00:00.000000000 Z
17
+ date: 2022-09-27 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: httparty
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  - !ruby/object:Gem::Version
247
247
  version: '0'
248
248
  requirements: []
249
- rubygems_version: 3.1.6
249
+ rubygems_version: 3.3.7
250
250
  signing_key:
251
251
  specification_version: 4
252
252
  summary: Ruby client for quiz_api