Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-10 06:09:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-10 06:09:10 +0300
commit5d756f9966c2f91b96cef7e552693e5bd1f1fb21 (patch)
tree4edd5c50411c21c57867d57a776e6c8a67d6f247 /spec/support/services
parent23e66f03108f811dbb6f9aa4fc463f888666522d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/services')
-rw-r--r--spec/support/services/service_response_shared_examples.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/support/services/service_response_shared_examples.rb b/spec/support/services/service_response_shared_examples.rb
new file mode 100644
index 00000000000..186627347fb
--- /dev/null
+++ b/spec/support/services/service_response_shared_examples.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'returning an error service response' do |message: nil|
+ it 'returns an error service response' do
+ result = subject
+
+ expect(result).to be_error
+
+ if message
+ expect(result.message).to eq(message)
+ end
+ end
+end
+
+RSpec.shared_examples 'returning a success service response' do |message: nil|
+ it 'returns a success service response' do
+ result = subject
+
+ expect(result).to be_success
+
+ if message
+ expect(result.message).to eq(message)
+ end
+ end
+end