quiz_api_client 4.22.0 → 4.23.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: 530745dd8b2114222d9d503cd841439525f7679384290a71d9313f4fa6fe94a2
|
4
|
+
data.tar.gz: 6e6b594abea72e7f49947a70dd45229ba2948fcba301a8e90ed9be1fa05716ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a603aaaa981cf20b625656fda29046a726cd36132b21e872e3dc9616aaeb3220c58b60fa43ad20ea9b9a015b2a6cc46625e83623f404ab8c59c71aa75b07b0e1
|
7
|
+
data.tar.gz: 132bef5130d34e4005845e8af45805de26f882f4b46f6515f61b5f57bdd4a0f47f07d731a99b34a510c59ecec4979d7a54e1200eefca66e4f3cce93bd8afdd49
|
@@ -4,6 +4,13 @@ module QuizApiClient::Services
|
|
4
4
|
post_to_quiz_api(params: params, token: token)
|
5
5
|
end
|
6
6
|
|
7
|
+
def convert_link(params:, token: nil)
|
8
|
+
client(token: token).post(
|
9
|
+
'/api/youtube/convert_youtube_link',
|
10
|
+
params
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
7
14
|
def post_to_quiz_api(params:, token:)
|
8
15
|
client(token: token).post(
|
9
16
|
'/api/youtube/start_youtube_migration_scan',
|
@@ -30,4 +30,42 @@ describe QuizApiClient::Services::YoutubeService do
|
|
30
30
|
).to eq(stubbed_response)
|
31
31
|
end
|
32
32
|
end
|
33
|
+
|
34
|
+
describe '#convert_link' do
|
35
|
+
let(:params) do
|
36
|
+
{
|
37
|
+
resource_id: 123,
|
38
|
+
resource_type: 'QuizzesNext:Quiz',
|
39
|
+
field: 'instructions',
|
40
|
+
src: 'http://youtube.com/watch?v=example',
|
41
|
+
new_html: '<p>Updated youtube link</p>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
let(:expected_url) { "https://#{host}/api/youtube/convert_youtube_link" }
|
46
|
+
let(:convert_response) do
|
47
|
+
{
|
48
|
+
'id' => 123,
|
49
|
+
'resource_type' => 'QuizzesNext:Quiz',
|
50
|
+
'field' => 'instructions',
|
51
|
+
'new_html' => '<p>Updated youtube link</p>'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
before do
|
56
|
+
stub_request(:post, expected_url)
|
57
|
+
.with(body: params.to_json)
|
58
|
+
.to_return(
|
59
|
+
status: 202,
|
60
|
+
body: convert_response.to_json,
|
61
|
+
headers: { 'Content-Type' => 'application/json' }
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'posts to the correct endpoint and returns the response' do
|
66
|
+
expect(
|
67
|
+
subject.convert_link(params: params, token: 'token').parsed_response
|
68
|
+
).to eq(convert_response)
|
69
|
+
end
|
70
|
+
end
|
33
71
|
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.23.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: 2025-09-
|
18
|
+
date: 2025-09-30 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httparty
|