Skip to content

Commit

Permalink
Merge branch 'master' into revert-1214-revert-1210-change_local_path_…
Browse files Browse the repository at this point in the history
…type
  • Loading branch information
digitaltom authored Nov 5, 2024
2 parents 9a617a0 + 1500238 commit bf14329
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@

context 'when verification provider returns false' do
before do
expect(InstanceVerification::Providers::Example).to receive(:new)
.with(be_a(ActiveSupport::Logger), be_a(ActionDispatch::Request), payload, instance_data).and_return(plugin_double)
expect(plugin_double).to receive(:instance_valid?).and_return(false)
stub_request(:post, scc_activate_url)
.to_return(
status: 200,
body: { error: 'Unexpected instance verification error has occurred' }.to_json,
headers: {}
)
post url, params: payload, headers: headers
end

Expand All @@ -86,9 +89,13 @@

context 'when verification provider raises an unhandled exception' do
before do
expect(InstanceVerification::Providers::Example).to receive(:new)
.with(be_a(ActiveSupport::Logger), be_a(ActionDispatch::Request), payload, instance_data).and_return(plugin_double)
expect(plugin_double).to receive(:instance_valid?).and_raise('Custom plugin error')
stub_request(:post, scc_activate_url)
.to_return(
status: 422,
body: { error: 'Unexpected instance verification error has occurred' }.to_json,
headers: {}
)

post url, params: payload, headers: headers
end

Expand Down Expand Up @@ -623,7 +630,7 @@
.with({ headers: scc_headers, body: payload.merge({ byos_mode: 'byos' }) })
.and_return(
status: 401,
body: { error: 'error_message' }.to_json,
body: 'Migration target not allowed on this instance type',
headers: {}
)
request
Expand Down

0 comments on commit bf14329

Please sign in to comment.