diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-05 00:08:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-05 00:08:41 +0300 |
commit | 9e19896fb55fe053414109dcfb6e4f3142918e08 (patch) | |
tree | ea488213c66a9adc11496e63cdb658e075af48d0 /spec/support | |
parent | b3555357704e2776fc0c960eaf931b0e9b0f0ddf (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared_examples/services/snippets_shared_examples.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/support/shared_examples/services/snippets_shared_examples.rb b/spec/support/shared_examples/services/snippets_shared_examples.rb index 51a4a8b1cd9..4a08c0d4365 100644 --- a/spec/support/shared_examples/services/snippets_shared_examples.rb +++ b/spec/support/shared_examples/services/snippets_shared_examples.rb @@ -40,3 +40,20 @@ RSpec.shared_examples 'snippets spam check is performed' do end end end + +shared_examples 'invalid params error response' do + before do + allow_next_instance_of(described_class) do |service| + allow(service).to receive(:valid_params?).and_return false + end + end + + it 'responds to errors appropriately' do + response = subject + + aggregate_failures do + expect(response).to be_error + expect(response.http_status).to eq 422 + end + end +end |