diff options
Diffstat (limited to 'spec/services/service_response_spec.rb')
-rw-r--r-- | spec/services/service_response_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/service_response_spec.rb b/spec/services/service_response_spec.rb index e790d272e61..a6567f52c6f 100644 --- a/spec/services/service_response_spec.rb +++ b/spec/services/service_response_spec.rb @@ -23,6 +23,20 @@ describe ServiceResponse do expect(response).to be_success expect(response.payload).to eq(good: 'orange') end + + it 'creates a successful response with default HTTP status' do + response = described_class.success + + expect(response).to be_success + expect(response.http_status).to eq(:ok) + end + + it 'creates a successful response with custom HTTP status' do + response = described_class.success(http_status: 204) + + expect(response).to be_success + expect(response.http_status).to eq(204) + end end describe '.error' do |