Skip to content

Commit 1607fe2

Browse files
Copilotsneha-krip
andcommitted
Update test to use actual GitHub API response format
Co-authored-by: sneha-krip <110618720+sneha-krip@users.noreply.github.com>
1 parent 56781a2 commit 1607fe2

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

spec/octokit/client/actions_workflows_spec.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@
5858
context 'with return_run_details option' do
5959
it 'gets run details from API response' do
6060
wf_file = 'simple_workflow.yml'
61-
api_response_body = { id: 123, status: 'queued' }.to_json
61+
api_response_body = {
62+
workflow_run_id: 22_103_568_458,
63+
run_url: "https://api.github.com/repos/#{@test_repo}/actions/runs/22103568458",
64+
html_url: "https://github.com/#{@test_repo}/actions/runs/22103568458"
65+
}.to_json
6266

6367
http_stub = stub_post("/repos/#{@test_repo}/actions/workflows/#{wf_file}/dispatches")
6468
.to_return(
@@ -70,8 +74,9 @@
7074
output = @client.workflow_dispatch(@test_repo, wf_file, 'main', return_run_details: true)
7175

7276
expect(output.class.name).to eq('Sawyer::Resource')
73-
expect(output.id).to be(123)
74-
expect(output.status).to match('queued')
77+
expect(output.workflow_run_id).to be(22_103_568_458)
78+
expect(output.run_url).to match('actions/runs/22103568458')
79+
expect(output.html_url).to match("github.com/#{@test_repo}/actions/runs/22103568458")
7580
assert_requested http_stub
7681
end
7782
end

0 commit comments

Comments
 (0)