quiz_api_client 4.13.3 → 4.13.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9c4a3c5a1a9c2363d383f497b8aaccfc1ba1fbde99e6481e911b46f69ff6972
|
4
|
+
data.tar.gz: 4edb45c0ced2efcb9f32c3d7ec1b0376f891dc8d5b9ec336ef61b5a992e30cc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 637eb311b402f08c22e4109be5e092366b08ae0fb9d5db049b8e186ad92bb965bb0ef0bff73e97b88096976e2d28148eb94d107d9c8ca9e5cdf1aed17f9bb3c5
|
7
|
+
data.tar.gz: 4bc454f39df1137b2f289bfd7e99217c0c2eff58c43981b26be2bf3802f2d3a1e03ebd0da015ba48a4b8f6858e3a52f450c3b28d8ef255df1686c5965fc0fbae
|
@@ -7,7 +7,10 @@ module QuizApiClient::Services
|
|
7
7
|
def show(params:, token: nil)
|
8
8
|
raise 'Quiz Session Id Required' unless params && params[:id]
|
9
9
|
|
10
|
-
|
10
|
+
access_code_params = {
|
11
|
+
disable_ac_invalidation: params.delete(:disable_ac_invalidation)
|
12
|
+
}.compact
|
13
|
+
get_from_quiz_api(params: params, token: token, access_code_params: access_code_params)
|
11
14
|
end
|
12
15
|
|
13
16
|
private
|
@@ -19,9 +22,10 @@ module QuizApiClient::Services
|
|
19
22
|
)
|
20
23
|
end
|
21
24
|
|
22
|
-
def get_from_quiz_api(params:, token:)
|
25
|
+
def get_from_quiz_api(params:, token:, access_code_params:)
|
23
26
|
client(token: token).get(
|
24
|
-
"/api/quiz_sessions/#{params[:id]}"
|
27
|
+
"/api/quiz_sessions/#{params[:id]}",
|
28
|
+
query: access_code_params
|
25
29
|
)
|
26
30
|
end
|
27
31
|
end
|
@@ -45,5 +45,26 @@ describe QuizApiClient::Services::QuizSessionService do
|
|
45
45
|
response = subject.show(params: params, token: 'token')
|
46
46
|
expect(response.parsed_response).to eql(stubbed_response)
|
47
47
|
end
|
48
|
+
|
49
|
+
context 'when the query param "disable_ac_invalidation" is given' do
|
50
|
+
let(:params) { { id: 1, disable_ac_invalidation: true } }
|
51
|
+
let(:stubbed_response) { { 'id' => 1, 'time_limit_seconds' => 10 } }
|
52
|
+
let(:expected_url) { "https://#{host}/api/quiz_sessions/#{params[:id]}?disable_ac_invalidation=true" }
|
53
|
+
let(:status_code) { 200 }
|
54
|
+
|
55
|
+
before do
|
56
|
+
stub_request(:get, expected_url)
|
57
|
+
.to_return(
|
58
|
+
status: status_code,
|
59
|
+
body: stubbed_response.to_json,
|
60
|
+
headers: { 'Content-Type' => 'application/json' }
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'gets from quiz_api/api/quiz_sessions and returns the response' do
|
65
|
+
response = subject.show(params: params, token: 'token')
|
66
|
+
expect(response.parsed_response).to eql(stubbed_response)
|
67
|
+
end
|
68
|
+
end
|
48
69
|
end
|
49
70
|
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.4
|
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-09-
|
18
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httparty
|