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: 0326a0567d52565a328e8baeef1121dd071fd3a6cc33d4f36a472d394c353382
4
- data.tar.gz: d93ac7d560e617f2156ce313701826640791b78d5581f9c6a0298978d3281e67
3
+ metadata.gz: 530745dd8b2114222d9d503cd841439525f7679384290a71d9313f4fa6fe94a2
4
+ data.tar.gz: 6e6b594abea72e7f49947a70dd45229ba2948fcba301a8e90ed9be1fa05716ec
5
5
  SHA512:
6
- metadata.gz: 48d7c949f232d01e3cc6cd9a5408fd2ac921893154af5ea4ad244d0783d8950f966c0faab371a1d17f7a2265d64590b4061b18a33eaf3e3d4c2e98c8639e907a
7
- data.tar.gz: 7aa68e7db93d0943492d7851b73a1f2b99c16d8cb7b7275bcbbc0001a956410bb45dc83a0e5e60c75c448169d57c9a186875e5044b7bde9ffaa13d18e2f04eec
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',
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '4.22.0'.freeze
2
+ VERSION = '4.23.0'.freeze
3
3
  end
@@ -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.22.0
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-12 00:00:00.000000000 Z
18
+ date: 2025-09-30 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: httparty