summaryrefslogtreecommitdiff
path: root/spec/services/service_response_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/service_response_spec.rb')
-rw-r--r--spec/services/service_response_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/service_response_spec.rb b/spec/services/service_response_spec.rb
index a6567f52c6f..2c944a63ebb 100644
--- a/spec/services/service_response_spec.rb
+++ b/spec/services/service_response_spec.rb
@@ -84,4 +84,14 @@ describe ServiceResponse do
expect(described_class.error(message: 'Bad apple').error?).to eq(true)
end
end
+
+ describe '#errors' do
+ it 'returns an empty array for a successful response' do
+ expect(described_class.success.errors).to be_empty
+ end
+
+ it 'returns an array with a correct message for an error response' do
+ expect(described_class.error(message: 'error message').errors).to eq(['error message'])
+ end
+ end
end