Commit 64f11b19 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Merge branch 'rspec-empty-line-after-letitbe-spec-workers' into 'master'

Fix RSpec/EmptyLineAfterFinalLetItBe for spec/workers

See merge request gitlab-org/gitlab!58421
parents aa9b65c6 96740273
......@@ -890,27 +890,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- spec/views/search/_results.html.haml_spec.rb
- spec/views/shared/_label_row.html.haml_spec.rb
- spec/views/shared/milestones/_top.html.haml_spec.rb
- spec/workers/ci/create_cross_project_pipeline_worker_spec.rb
- spec/workers/cluster_update_app_worker_spec.rb
- spec/workers/environments/canary_ingress/update_worker_spec.rb
- spec/workers/expire_job_cache_worker_spec.rb
- spec/workers/gitlab/jira_import/import_issue_worker_spec.rb
- spec/workers/gitlab/jira_import/stage/start_import_worker_spec.rb
- spec/workers/gitlab/jira_import/stuck_jira_import_jobs_worker_spec.rb
- spec/workers/import_issues_csv_worker_spec.rb
- spec/workers/incident_management/add_severity_system_note_worker_spec.rb
- spec/workers/incident_management/process_alert_worker_spec.rb
- spec/workers/incident_management/process_prometheus_alert_worker_spec.rb
- spec/workers/jira_connect/sync_project_worker_spec.rb
- spec/workers/namespaces/onboarding_issue_created_worker_spec.rb
- spec/workers/packages/composer/cache_update_worker_spec.rb
- spec/workers/pages_domain_ssl_renewal_cron_worker_spec.rb
- spec/workers/projects/git_garbage_collect_worker_spec.rb
- spec/workers/prometheus/create_default_alerts_worker_spec.rb
- spec/workers/propagate_integration_group_worker_spec.rb
- spec/workers/propagate_integration_project_worker_spec.rb
- spec/workers/run_pipeline_schedule_worker_spec.rb
- spec/workers/update_external_pull_requests_worker_spec.rb
RSpec/TimecopFreeze:
Exclude:
......
---
title: Fix RSpec/EmptyLineAfterFinalLetItBe rubocop offenses in spec/workers
merge_request: 58421
author: Abdul Wadood @abdulwd
type: fixed
......@@ -6,6 +6,7 @@ RSpec.describe Ci::CreateCrossProjectPipelineWorker do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
let(:bridge) { create(:ci_bridge, user: user, pipeline: pipeline) }
let(:service) { double('pipeline creation service') }
......
......@@ -48,6 +48,7 @@ RSpec.describe ClusterUpdateAppWorker do
context 'with exclusive lease' do
let_it_be(:user) { create(:user) }
let(:application) { create(:clusters_applications_prometheus, :installed) }
let(:lease_key) { "#{described_class.name.underscore}-#{application.id}" }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Environments::CanaryIngress::UpdateWorker do
let_it_be(:environment) { create(:environment) }
let(:worker) { described_class.new }
describe '#perform' do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe ExpireJobCacheWorker do
let_it_be(:pipeline) { create(:ci_empty_pipeline) }
let(:project) { pipeline.project }
describe '#perform' do
......
......@@ -7,6 +7,7 @@ RSpec.describe Gitlab::JiraImport::ImportIssueWorker do
let_it_be(:project) { create(:project) }
let_it_be(:jira_issue_label_1) { create(:label, project: project) }
let_it_be(:jira_issue_label_2) { create(:label, project: project) }
let(:some_key) { 'some-key' }
describe 'modules' do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Gitlab::JiraImport::Stage::StartImportWorker do
let_it_be(:project) { create(:project, import_type: 'jira') }
let_it_be(:jid) { '12345678' }
let(:worker) { described_class.new }
describe 'modules' do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe ::Gitlab::JiraImport::StuckJiraImportJobsWorker do
let_it_be(:current_user) { create(:user) }
let_it_be(:project) { create(:project) }
let(:worker) { described_class.new }
describe 'with scheduled Jira import' do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe ImportIssuesCsvWorker do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let(:upload) { create(:upload, :with_file) }
let(:worker) { described_class.new }
......
......@@ -40,6 +40,7 @@ RSpec.describe IncidentManagement::AddSeveritySystemNoteWorker do
context 'when issue is not an incident' do
let_it_be(:issue) { create(:issue, project: project) }
let(:incident_id) { issue.id }
it_behaves_like 'does not add a system note'
......
......@@ -10,6 +10,7 @@ RSpec.describe IncidentManagement::ProcessAlertWorker do
let_it_be(:started_at) { Time.now.rfc3339 }
let_it_be(:payload) { { 'title' => 'title', 'start_time' => started_at } }
let_it_be(:alert) { create(:alert_management_alert, project: project, payload: payload, started_at: started_at) }
let(:created_issue) { Issue.last! }
subject { described_class.new.perform(nil, nil, alert.id) }
......
......@@ -6,6 +6,7 @@ RSpec.describe IncidentManagement::ProcessPrometheusAlertWorker do
describe '#perform' do
let_it_be(:project) { create(:project) }
let_it_be(:prometheus_alert) { create(:prometheus_alert, project: project) }
let(:payload_key) { Gitlab::AlertManagement::Payload::Prometheus.new(project: project, payload: alert_params).gitlab_fingerprint }
let!(:prometheus_alert_event) { create(:prometheus_alert_event, prometheus_alert: prometheus_alert, payload_key: payload_key) }
let!(:settings) { create(:project_incident_management_setting, project: project, create_issue: true) }
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe JiraConnect::SyncProjectWorker, factory_default: :keep do
describe '#perform' do
let_it_be(:project) { create_default(:project).freeze }
let!(:mr_with_jira_title) { create(:merge_request, :unique_branches, title: 'TEST-123') }
let!(:mr_with_jira_description) { create(:merge_request, :unique_branches, description: 'TEST-323') }
let!(:mr_with_other_title) { create(:merge_request, :unique_branches) }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Namespaces::OnboardingIssueCreatedWorker, '#perform' do
let_it_be(:issue) { create(:issue) }
let(:namespace) { issue.namespace }
it_behaves_like 'records an onboarding progress action', :issue_created do
......
......@@ -8,6 +8,7 @@ RSpec.describe Packages::Composer::CacheUpdateWorker, type: :worker do
let_it_be(:json) { { 'name' => package_name } }
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, :custom_repo, files: { 'composer.json' => json.to_json }, group: group) }
let(:last_sha) { nil }
let!(:package) { create(:composer_package, :with_metadatum, project: project, name: package_name, version: '1.0.0', json: json) }
let(:job_args) { [project.id, package_name, last_sha] }
......
......@@ -13,6 +13,7 @@ RSpec.describe PagesDomainSslRenewalCronWorker do
describe '#perform' do
let_it_be(:project) { create :project }
let!(:domain) { create(:pages_domain, project: project, auto_ssl_enabled: false) }
let!(:domain_with_enabled_auto_ssl) { create(:pages_domain, project: project, auto_ssl_enabled: true) }
let!(:domain_with_obtained_letsencrypt) do
......
......@@ -36,6 +36,7 @@ RSpec.describe Projects::GitGarbageCollectWorker do
context 'LFS object garbage collection' do
let_it_be(:lfs_reference) { create(:lfs_objects_project, project: project) }
let(:lfs_object) { lfs_reference.lfs_object }
before do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Prometheus::CreateDefaultAlertsWorker do
let_it_be(:project) { create(:project) }
let(:worker) { described_class.new }
let(:logger) { worker.send(:logger) }
let(:service) { instance_double(Prometheus::CreateDefaultAlertsService) }
......
......@@ -9,6 +9,7 @@ RSpec.describe PropagateIntegrationGroupWorker do
let_it_be(:subgroup1) { create(:group, parent: group) }
let_it_be(:subgroup2) { create(:group, parent: group) }
let_it_be(:integration) { create(:redmine_service, :instance) }
let(:job_args) { [integration.id, group.id, subgroup2.id] }
it_behaves_like 'an idempotent worker' do
......
......@@ -9,6 +9,7 @@ RSpec.describe PropagateIntegrationProjectWorker do
let_it_be(:project2) { create(:project, group: group) }
let_it_be(:project3) { create(:project, group: group) }
let_it_be(:integration) { create(:redmine_service, :instance) }
let(:job_args) { [integration.id, project1.id, project3.id] }
it_behaves_like 'an idempotent worker' do
......
......@@ -7,6 +7,7 @@ RSpec.describe RunPipelineScheduleWorker do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:pipeline_schedule) { create(:ci_pipeline_schedule, :nightly, project: project ) }
let(:worker) { described_class.new }
context 'when a project not found' do
......
......@@ -6,6 +6,7 @@ RSpec.describe UpdateExternalPullRequestsWorker do
describe '#perform' do
let_it_be(:project) { create(:project, import_source: 'tanuki/repository') }
let_it_be(:user) { create(:user) }
let(:worker) { described_class.new }
before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment