quiz_api_client 4.8.1 → 4.9.0
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: 505c41cc94d0ac7bb263ce3951d11de97c6c614b424de4db4f9f6ab54c35ff60
|
|
4
|
+
data.tar.gz: 1b444571e9db200d6dd3ddeb2d34531b1823e3ddb16fbced3c31121c00a8c6ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91cc0b90020b44e09f16051de5e39dbf7c5c2e95ebaa5e5afec64b7061a495c04c64c912f8eb6cb78c4d52df8038ed3e8446d255239569921aa88ccf4294b69c
|
|
7
|
+
data.tar.gz: 34e1785c1e890cb4c13c1988f03254c98242f8419cc3ce7a48f48036e756d8117266891d7837bcbc75818638bdc177ad11570c3ecb063a8f9cbbad5f61a1be51
|
|
@@ -19,6 +19,12 @@ module QuizApiClient::Services
|
|
|
19
19
|
put_to_quiz_api(params: params, token: token)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def media_upload_url(params:, token: nil)
|
|
23
|
+
raise 'Quiz Id Required' unless params && params[:quiz_id]
|
|
24
|
+
|
|
25
|
+
get_media_upload_url_from_quiz_api(params: params, token: token)
|
|
26
|
+
end
|
|
27
|
+
|
|
22
28
|
private
|
|
23
29
|
|
|
24
30
|
def list_from_quiz_api(params:, token:)
|
|
@@ -44,5 +50,10 @@ module QuizApiClient::Services
|
|
|
44
50
|
item: params
|
|
45
51
|
)
|
|
46
52
|
end
|
|
53
|
+
|
|
54
|
+
def get_media_upload_url_from_quiz_api(params:, token:)
|
|
55
|
+
quiz_id = params.delete(:quiz_id)
|
|
56
|
+
client(token: token).get("/api/quizzes/#{quiz_id}/items/media_upload_url")
|
|
57
|
+
end
|
|
47
58
|
end
|
|
48
59
|
end
|
|
@@ -79,4 +79,25 @@ describe QuizApiClient::Services::ItemsService do
|
|
|
79
79
|
expect { subject.update(params: { quiz_id: 1 }, token: 'token') }.to raise_error('Item Id Required')
|
|
80
80
|
end
|
|
81
81
|
end
|
|
82
|
+
|
|
83
|
+
describe '#media_upload_url' do
|
|
84
|
+
let(:params) { { quiz_id: 1 } }
|
|
85
|
+
let(:stubbed_response) { { 'url' => 'awsuploadurl' } }
|
|
86
|
+
let(:expected_url) { "https://#{host}/api/quizzes/#{params[:quiz_id]}/items/media_upload_url" }
|
|
87
|
+
let(:status_code) { 200 }
|
|
88
|
+
|
|
89
|
+
before do
|
|
90
|
+
stub_request(:get, expected_url)
|
|
91
|
+
.to_return(
|
|
92
|
+
status: status_code,
|
|
93
|
+
body: stubbed_response.to_json,
|
|
94
|
+
headers: { 'Content-Type' => 'application/json' }
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it 'gets from quiz_api/api/quizzes/{id}/items/media_upload_url and returns the response' do
|
|
99
|
+
result = subject.media_upload_url(params: params, token: 'token')
|
|
100
|
+
expect(result.parsed_response).to eql(stubbed_response)
|
|
101
|
+
end
|
|
102
|
+
end
|
|
82
103
|
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.
|
|
4
|
+
version: 4.9.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: 2023-03-
|
|
18
|
+
date: 2023-03-15 00:00:00.000000000 Z
|
|
19
19
|
dependencies:
|
|
20
20
|
- !ruby/object:Gem::Dependency
|
|
21
21
|
name: httparty
|