quiz_api_client 4.5.4 → 4.6.0

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: c34fb90e53a33d8f34b3ed7c71d6df191b0affd3508ea08bb9484952e280c58d
4
- data.tar.gz: f65f55cdc0a8596399c08b36f3cb14c5eb5e5c25dd6f3769f8c1f6f06dc94584
3
+ metadata.gz: fbda532d39d3bc76cb64465b5e393d150a469448b9747f5556a0e09f0ccb70cd
4
+ data.tar.gz: dc2b0545c2b6b7b031fdec7e9fcf084cb69ab897444521fabd62944cfd38e70a
5
5
  SHA512:
6
- metadata.gz: bcac6b8e778f3e404612e5bdda4cd48475f624001004901403a6f5549586a9f93c80bdf51bddcd2aeebad78d3410a0d010a56128e540355f8f7cf334f209b4b2
7
- data.tar.gz: 9f6fa6e356e4702bee44a3dded1bbff9ddfb2f223cbe0727b5bdbfa3bafce62c0c748edc7f1b36ddc722032cb70850abc975cd387c45c03143b7f812a4dac735
6
+ metadata.gz: b12c35f7e25194b3e9aa20ecbdd4f9bdc835ba4f948f6659cc62dd360b0288629d4ccda99c65c8b0ba155573c26f0516f1395c5b5151dbc1da4cd30504136695
7
+ data.tar.gz: 5547cc8b2d32ec019868f88e346285b6fb03b5ebe68bd1c1018aa278a658c38a4f7f76dd1f26aaa8cbb10767731210d94984850dd80077c48cfc6af08a4f41f6
@@ -1,6 +1,6 @@
1
1
  module QuizApiClient::Services
2
2
  class QuizCloneJobsService < BaseApiService
3
- def create(body: nil, params:, token: nil)
3
+ def create(body: {}, params:, token: nil)
4
4
  post_to_quiz_api(body: body, params: params, token: token)
5
5
  end
6
6
 
@@ -8,6 +8,10 @@ module QuizApiClient::Services
8
8
  get_from_quiz_api(params: params, token: token)
9
9
  end
10
10
 
11
+ def destroy(params:, token: nil)
12
+ delete_from_quiz_api(params: params, token: token)
13
+ end
14
+
11
15
  private
12
16
 
13
17
  def patch_to_quiz_api(params:, token:)
@@ -22,5 +26,11 @@ module QuizApiClient::Services
22
26
  "/api/quizzes/#{params[:id]}"
23
27
  )
24
28
  end
29
+
30
+ def delete_from_quiz_api(params:, token:)
31
+ client(token: token).delete(
32
+ "/api/quizzes/#{params[:id]}"
33
+ )
34
+ end
25
35
  end
26
36
  end
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '4.5.4'.freeze
2
+ VERSION = '4.6.0'.freeze
3
3
  end
@@ -26,6 +26,26 @@ describe QuizApiClient::Services::QuizService do
26
26
  end
27
27
  end
28
28
 
29
+ describe '#delete' do
30
+ let(:params) { { id: 1 } }
31
+ let(:stubbed_response) { { 'id' => 1, 'title' => 'some title' } }
32
+ let(:expected_url) { "https://#{host}/api/quizzes/#{params[:id]}" }
33
+
34
+ before do
35
+ stub_request(:delete, expected_url)
36
+ .to_return(
37
+ status: 200,
38
+ body: stubbed_response.to_json,
39
+ headers: { 'Content-Type' => 'application/json' }
40
+ )
41
+ end
42
+
43
+ it 'deletes in quiz_api/api/quizzes and returns the response' do
44
+ result = subject.destroy(params: params, token: 'token')
45
+ expect(result.parsed_response).to eql(stubbed_response)
46
+ end
47
+ end
48
+
29
49
  describe '#show' do
30
50
  let(:params) { { id: 1 } }
31
51
  let(:stubbed_response) { { 'id' => 1, 'title' => 'some title' } }
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.4
4
+ version: 4.6.0
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: 2022-12-14 00:00:00.000000000 Z
18
+ date: 2023-02-08 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: httparty