Skip to content

Commit

Permalink
Update specs after refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwr18 authored and roschaefer committed Sep 15, 2023
1 parent adb3a16 commit 60dc5fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions spec/adapters/signal_adapter/outbound/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
end

describe 'on error' do
before(:each) { stub_request(:post, 'http://signal:8080/v2/send').to_return(status: 400) }
let(:error_message) { 'User is not registered' }
before(:each) { stub_request(:post, 'http://signal:8080/v2/send').to_return(status: 400, body: { error: error_message }.to_json) }

it 'reports the error' do
expect(Sentry).to receive(:capture_exception).with(Net::HTTPClientException)
expect(Sentry).to receive(:capture_exception).with(SignalAdapter::BadRequestError.new(error_code: 400, message: error_message))

subject.call
end
Expand Down
5 changes: 3 additions & 2 deletions spec/adapters/signal_adapter/outbound/text_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
end

describe 'on error' do
before(:each) { stub_request(:post, 'http://signal:8080/v2/send').to_return(status: 400) }
let(:error_message) { 'User is not registered' }
before(:each) { stub_request(:post, 'http://signal:8080/v2/send').to_return(status: 400, body: { error: error_message }.to_json) }

it 'reports the error' do
expect(Sentry).to receive(:capture_exception).with(Net::HTTPClientException)
expect(Sentry).to receive(:capture_exception).with(SignalAdapter::BadRequestError.new(error_code: 400, message: error_message))

subject.call
end
Expand Down

0 comments on commit 60dc5fc

Please sign in to comment.