Skip to content

Commit

Permalink
add error to specs
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Mar 22, 2021
1 parent 312954c commit 06e1a59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/workers/external_service_worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@

it "should respond error message if a 400 or 500 response is received" do
expect(Faraday).to receive(:post).and_return(response_400)
expect(@worker).to receive(:respond).with("Error. The tests service is currently unavailable")
expect(@worker).to receive(:respond).with("Error (400). The tests service is currently unavailable")
@worker.perform(@service_params, @locals)

expect(Faraday).to receive(:post).and_return(OpenStruct.new(status: 500))
expect(@worker).to receive(:respond).with("Error (500). The tests service is currently unavailable")
@worker.perform(@service_params, @locals)
end

Expand Down

0 comments on commit 06e1a59

Please sign in to comment.