Skip to content

Commit

Permalink
Add headers test for SCC activations query
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbv committed Jan 14, 2025
1 parent fff4b85 commit 1c9a51e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@
let(:scc_systems_activations_url) { 'https://scc.suse.com/connect/systems/activations' }

before do
stub_request(:get, scc_systems_activations_url).to_return(status: 401, body: "{\"error\": \"Error\'\"}", headers: {})
stub_request(:get, scc_systems_activations_url).to_return(status: 401, body: "{\"error\": \"Error\'\"}", headers: headers)
allow(SccProxy).to receive(:headers)
delete url, params: payload, headers: headers
end

it 'reports an error' do
data = JSON.parse(response.body)
expect(data['error']).to eq("{\"error\": \"Error'\"}")
expect(SccProxy).to have_received(:headers).with(headers['HTTP_AUTHORIZATION'], nil)
end
end

Expand Down

0 comments on commit 1c9a51e

Please sign in to comment.