diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-03 12:10:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-03 12:10:03 +0300 |
commit | 5b5ae71251a8810c98d6d46c4d48d364fecb985f (patch) | |
tree | 50bb52108cab4ec701291a2c0c2fa1e4c140d2c5 /spec | |
parent | e4fc1db411bca1a3a4e1c042c44d7eeb61be2941 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb | 18 | ||||
-rw-r--r-- | spec/requests/projects/incidents_controller_spec.rb (renamed from spec/controllers/projects/incidents_controller_spec.rb) | 12 |
2 files changed, 21 insertions, 9 deletions
diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb index a46275d90b6..993edcab87d 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb @@ -241,6 +241,24 @@ RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob, :clean_gi expect(cookie['offsets']).to eq({ 'c1' => 1, 'c2' => 2, 'c3' => 3 }) end end + + context 'when a WAL location is nil with existing offsets' do + let(:existing_cookie) do + { + 'offsets' => { 'main' => 8, 'ci' => 5 }, + 'wal_locations' => { 'main' => 'loc1old', 'ci' => 'loc2old' } + } + end + + let(:argv) { ['main', 9, 'loc1', 'ci', nil, 'loc2'] } + + it 'only updates the main connection' do + subject + + expect(cookie['wal_locations']).to eq({ 'main' => 'loc1', 'ci' => 'loc2old' }) + expect(cookie['offsets']).to eq({ 'main' => 9, 'ci' => 5 }) + end + end end end diff --git a/spec/controllers/projects/incidents_controller_spec.rb b/spec/requests/projects/incidents_controller_spec.rb index 460821634b0..9a0d6cdf8ce 100644 --- a/spec/controllers/projects/incidents_controller_spec.rb +++ b/spec/requests/projects/incidents_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Projects::IncidentsController do +RSpec.describe Projects::IncidentsController, feature_category: :incident_management do let_it_be_with_refind(:project) { create(:project) } let_it_be(:developer) { create(:user) } let_it_be(:guest) { create(:user) } @@ -33,7 +33,7 @@ RSpec.describe Projects::IncidentsController do describe 'GET #index' do def make_request - get :index, params: project_params + get project_incidents_path(project) end let(:user) { developer } @@ -65,7 +65,7 @@ RSpec.describe Projects::IncidentsController do describe 'GET #show' do def make_request - get :show, params: project_params(id: resource) + get incident_project_issues_path(project, resource) end let_it_be(:resource) { create(:incident, project: project) } @@ -113,10 +113,4 @@ RSpec.describe Projects::IncidentsController do it_behaves_like 'login required' end end - - private - - def project_params(opts = {}) - opts.reverse_merge(namespace_id: project.namespace, project_id: project) - end end |