diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-04 03:12:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-04 03:12:36 +0300 |
commit | 4e86ca506d67f27cb4ca93b47efc53adc1c237a6 (patch) | |
tree | 8a3babe70df855216f3a9f184e3767fdd26aec57 /spec/requests | |
parent | 16f41a5b04934bb7a7a26ac2d6516cb44b7932e3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/error_tracking/collector_spec.rb | 15 | ||||
-rw-r--r-- | spec/requests/api/users_spec.rb | 6 | ||||
-rw-r--r-- | spec/requests/users_controller_spec.rb | 2 |
3 files changed, 20 insertions, 3 deletions
diff --git a/spec/requests/api/error_tracking/collector_spec.rb b/spec/requests/api/error_tracking/collector_spec.rb index 57c87811c9e..21e2849fef0 100644 --- a/spec/requests/api/error_tracking/collector_spec.rb +++ b/spec/requests/api/error_tracking/collector_spec.rb @@ -136,6 +136,21 @@ RSpec.describe API::ErrorTracking::Collector do it_behaves_like 'bad request' end + context 'body with string instead of json' do + let(:params) { '"********"' } + + it_behaves_like 'bad request' + end + + context 'collector fails with validation error' do + before do + allow(::ErrorTracking::CollectErrorService) + .to receive(:new).and_raise(ActiveRecord::RecordInvalid) + end + + it_behaves_like 'bad request' + end + context 'gzip body' do let(:headers) do { diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 50e5025fd47..b93df2f3bae 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -1906,7 +1906,8 @@ RSpec.describe API::Users do expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(json_response).to be_an Array - expect(json_response.first['email']).to eq(email.email) + expect(json_response.first['email']).to eq(user.email) + expect(json_response.second['email']).to eq(email.email) end it "returns a 404 for invalid ID" do @@ -2488,7 +2489,8 @@ RSpec.describe API::Users do expect(response).to have_gitlab_http_status(:ok) expect(response).to include_pagination_headers expect(json_response).to be_an Array - expect(json_response.first["email"]).to eq(email.email) + expect(json_response.first['email']).to eq(user.email) + expect(json_response.second['email']).to eq(email.email) end context "scopes" do diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb index accacd705e7..701a73761fd 100644 --- a/spec/requests/users_controller_spec.rb +++ b/spec/requests/users_controller_spec.rb @@ -305,7 +305,7 @@ RSpec.describe UsersController do context 'user with keys' do let!(:gpg_key) { create(:gpg_key, user: user) } - let!(:another_gpg_key) { create(:another_gpg_key, user: user) } + let!(:another_gpg_key) { create(:another_gpg_key, user: user.reload) } shared_examples_for 'renders all verified GPG keys' do it 'renders all verified keys separated with a new line with text/plain content type' do |