Commit cb171937 authored by Abdul Wadood's avatar Abdul Wadood Committed by Mayra Cabrera

Fix RSpec/EmptyLineAfterFinalLetItBe for ee/spec/models

parent 1834ff50
......@@ -544,29 +544,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- ee/spec/lib/gitlab/graphql/aggregations/vulnerability_statistics/lazy_aggregate_spec.rb
- ee/spec/lib/gitlab/insights/project_insights_config_spec.rb
- ee/spec/lib/gitlab/sitemaps/url_extractor_spec.rb
- ee/spec/models/analytics/cycle_analytics/group_level_spec.rb
- ee/spec/models/burndown_spec.rb
- ee/spec/models/ci/build_spec.rb
- ee/spec/models/ci/daily_build_group_report_result_spec.rb
- ee/spec/models/ci/minutes/notification_spec.rb
- ee/spec/models/concerns/epic_tree_sorting_spec.rb
- ee/spec/models/dora/daily_metrics_spec.rb
- ee/spec/models/ee/ci/build_dependencies_spec.rb
- ee/spec/models/ee/iteration_spec.rb
- ee/spec/models/ee/namespace/root_storage_size_spec.rb
- ee/spec/models/ee/namespace_spec.rb
- ee/spec/models/ee/personal_access_token_spec.rb
- ee/spec/models/epic_spec.rb
- ee/spec/models/geo/lfs_object_registry_spec.rb
- ee/spec/models/gitlab_subscription_spec.rb
- ee/spec/models/group_member_spec.rb
- ee/spec/models/instance_security_dashboard_spec.rb
- ee/spec/models/issue_spec.rb
- ee/spec/models/label_note_spec.rb
- ee/spec/models/merge_request_spec.rb
- ee/spec/models/project_spec.rb
- ee/spec/models/requirements_management/test_report_spec.rb
- ee/spec/models/vulnerabilities/finding_spec.rb
- ee/spec/policies/clusters/agent_token_policy_spec.rb
- ee/spec/policies/compliance_management/framework_policy_spec.rb
- ee/spec/policies/group_policy_spec.rb
......
---
title: Fix RSpec/EmptyLineAfterFinalLetItBe rubocop offenses in ee/spec/models
merge_request: 58376
author: Abdul Wadood @abdulwd
type: fixed
......@@ -9,6 +9,7 @@ RSpec.describe Analytics::CycleAnalytics::GroupLevel do
let_it_be(:user) { create(:user) }
let(:issue) { create(:issue, project: project, created_at: 2.days.ago) }
let_it_be(:milestone) { create(:milestone, project: project) }
let(:mr) { create_merge_request_closing_issue(user, project, issue, commit_message: "References #{issue.to_reference}") }
let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: mr.source_branch, sha: mr.source_branch_sha, head_pipeline_of: mr) }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Burndown do
let_it_be(:user) { create(:user) }
let(:start_date) { "2017-03-01" }
let(:due_date) { "2017-03-03" }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Ci::Build do
let_it_be(:group) { create(:group_with_plan, plan: :bronze_plan) }
let(:project) { create(:project, :repository, group: group) }
let(:pipeline) do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Ci::DailyBuildGroupReportResult do
let_it_be(:project) { create(:project) }
let_it_be(:group) { create(:group, projects: [project]) }
let(:recent_build_group_report_result) { create(:ci_daily_build_group_report_result, project: project) }
let(:old_build_group_report_result) do
create(:ci_daily_build_group_report_result, date: 1.week.ago, project: project)
......
......@@ -7,6 +7,7 @@ RSpec.describe Ci::Minutes::Notification do
let(:shared_runners_enabled) { true }
let!(:project) { create(:project, :repository, namespace: group, shared_runners_enabled: shared_runners_enabled) }
let_it_be(:group, refind: true) { create(:group) }
let(:injected_group) { group }
let(:injected_project) { project }
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe EpicTreeSorting do
let_it_be(:group) { create(:group) }
let_it_be(:base_epic) { create(:epic, group: group) }
let!(:epic_issue1) { create(:epic_issue, epic: base_epic, relative_position: 10) }
let!(:epic_issue2) { create(:epic_issue, epic: base_epic, relative_position: 500) }
let!(:epic_issue3) { create(:epic_issue, epic: base_epic, relative_position: 1002) }
......
......@@ -66,6 +66,7 @@ RSpec.describe Dora::DailyMetrics, type: :model do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:environment) { create(:environment, project: project) }
let(:date) { 1.day.ago.to_date }
context 'with finished deployments' do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe Ci::BuildDependencies do
let_it_be(:user) { create(:user) }
let_it_be(:project, refind: true) { create(:project, :repository) }
let(:dependencies) { }
let(:pipeline) do
......
......@@ -36,6 +36,7 @@ RSpec.describe Iteration do
describe 'setting iteration cadence' do
let_it_be(:iterations_cadence) { create(:iterations_cadence, group: group, start_date: 10.days.ago) }
let(:iteration) { create(:iteration, group: group, iterations_cadence: set_cadence, start_date: 2.days.from_now) }
context 'when iterations_cadence is set correctly' do
......@@ -56,6 +57,7 @@ RSpec.describe Iteration do
context 'when iterations_cadence does not exists for the group' do
let_it_be(:group) { create(:group, name: 'Test group')}
let(:iteration) { build(:iteration, group: group, iterations_cadence: set_cadence) }
it 'creates a default iterations_cadence and uses it for the iteration' do
......
......@@ -9,6 +9,7 @@ RSpec.describe EE::Namespace::RootStorageSize do
let(:create_statistics) { create(:namespace_root_storage_statistics, namespace: namespace, storage_size: current_size)}
let_it_be(:ultimate_plan, reload: true) { create(:ultimate_plan) }
let_it_be(:plan_limits, reload: true) { create(:plan_limits, plan: ultimate_plan, storage_size_limit: 100) }
let!(:subscription) { create(:gitlab_subscription, namespace: namespace, hosted_plan: ultimate_plan) }
before do
......
......@@ -314,6 +314,7 @@ RSpec.describe Namespace do
context 'when running on a primary node' do
let_it_be(:primary) { create(:geo_node, :primary) }
let_it_be(:secondary) { create(:geo_node) }
let(:gitlab_shell) { Gitlab::Shell.new }
let(:parent_group) { create(:group) }
let(:child_group) { create(:group, name: 'child', path: 'child', parent: parent_group) }
......
......@@ -7,6 +7,7 @@ RSpec.describe PersonalAccessToken do
let_it_be(:expired_token) { create(:personal_access_token, expires_at: 1.day.ago) }
let_it_be(:valid_token) { create(:personal_access_token, expires_at: 1.day.from_now) }
let_it_be(:long_expiry_token) { create(:personal_access_token, expires_at: '999999-12-31'.to_date) }
let!(:pat) { create(:personal_access_token, expires_at: expiration_date) }
describe 'with_expires_at_after' do
......
......@@ -228,6 +228,7 @@ RSpec.describe Epic do
context 'when adding an Epic that has existing children' do
let_it_be(:parent_epic) { create(:epic, group: group) }
let(:epic) { build(:epic, group: group) }
it 'returns true when total depth after adding will not exceed limit' do
......@@ -250,6 +251,7 @@ RSpec.describe Epic do
context 'when parent has ancestors and epic has children' do
let_it_be(:root_epic) { create(:epic, group: group) }
let_it_be(:parent_epic) { create(:epic, group: group, parent: root_epic) }
let(:epic) { build(:epic, group: group) }
let(:child_epic1) { create(:epic, group: group, parent: epic)}
......
......@@ -34,6 +34,7 @@ RSpec.describe Geo::LfsObjectRegistry, :geo do
let_it_be(:lfs_object_3) { create(:lfs_object) }
let_it_be(:lfs_object_4) { create(:lfs_object) }
let_it_be(:lfs_object_5) { create(:lfs_object) }
let!(:lfs_object_remote_1) { create(:lfs_object, :object_storage) }
let!(:lfs_object_remote_2) { create(:lfs_object, :object_storage) }
let!(:lfs_object_remote_3) { create(:lfs_object, :object_storage) }
......
......@@ -601,6 +601,7 @@ RSpec.describe GitlabSubscription do
describe '#legacy?' do
let_it_be(:eoa_rollout_date) { GitlabSubscription::EOA_ROLLOUT_DATE.to_date }
let!(:gitlab_subscription) { create(:gitlab_subscription, start_date: start_date) }
subject { gitlab_subscription.legacy? }
......
......@@ -370,6 +370,7 @@ RSpec.describe GroupMember do
context 'group member welcome email', :sidekiq_inline do
let_it_be(:group) { create(:group_with_plan, plan: :ultimate_plan) }
let(:user) { create(:user) }
context 'when user is provisioned by group' do
......
......@@ -9,6 +9,7 @@ RSpec.describe InstanceSecurityDashboard do
let_it_be(:pipeline1) { create(:ci_pipeline, project: project1) }
let_it_be(:pipeline2) { create(:ci_pipeline, project: project2) }
let_it_be(:pipeline3) { create(:ci_pipeline, project: project3) }
let(:project_ids) { [project1.id] }
let(:user) { create(:user) }
......
......@@ -541,6 +541,7 @@ RSpec.describe Issue do
let_it_be(:project1) { create(:project, group: group) }
let_it_be_with_reload(:issue) { create(:issue, project: project) }
let_it_be_with_reload(:issue1) { create(:issue, project: project1, relative_position: issue.relative_position + RelativePositioning::IDEAL_DISTANCE) }
let(:new_issue) { build(:issue, project: project1, relative_position: nil) }
describe '.relative_positioning_query_base' do
......@@ -896,6 +897,7 @@ RSpec.describe Issue do
end
let_it_be(:user) { create(:user) }
let(:group) { nil }
subject { issue.can_be_promoted_to_epic?(user, group) }
......
......@@ -11,6 +11,7 @@ RSpec.describe LabelNote do
let_it_be(:label2) { create(:group_label, group: group) }
let(:resource_parent) { group }
let_it_be(:resource) { create(:epic, group: group) }
let(:project) { nil }
let(:resource_key) { resource.class.name.underscore.to_s }
let(:events) { [create(:resource_label_event, label: label, resource_key => resource)] }
......
......@@ -908,6 +908,7 @@ RSpec.describe MergeRequest do
subject { merge_request.compare_coverage_fuzzing_reports(current_user) }
let_it_be(:project) { create(:project, :repository) }
let(:current_user) { project.users.first }
let(:merge_request) { create(:merge_request, source_project: project) }
......@@ -968,6 +969,7 @@ RSpec.describe MergeRequest do
subject { merge_request.compare_api_fuzzing_reports(current_user) }
let_it_be(:project) { create(:project, :repository) }
let(:current_user) { project.users.first }
let(:merge_request) { create(:merge_request, source_project: project) }
......
......@@ -167,6 +167,7 @@ RSpec.describe Project do
describe 'approval_rules association' do
let_it_be(:rule, reload: true) { create(:approval_project_rule) }
let(:project) { rule.project }
let(:branch) { 'stable' }
......@@ -399,6 +400,7 @@ RSpec.describe Project do
let_it_be(:project_1) { create(:project_statistics, lfs_objects_size: 10, repository_size: 10).project }
let_it_be(:project_2) { create(:project_statistics, lfs_objects_size: 5, repository_size: 55).project }
let_it_be(:project_3) { create(:project, repository_size_limit: 30, statistics: create(:project_statistics, lfs_objects_size: 8, repository_size: 32)) }
let(:limit) { 20 }
subject { described_class.order_by_total_repository_size_excess_desc(limit) }
......@@ -1175,6 +1177,7 @@ RSpec.describe Project do
describe '#shared_runners_limit_namespace' do
let_it_be(:root_ancestor) { create(:group) }
let_it_be(:group) { create(:group, parent: root_ancestor) }
let(:project) { create(:project, namespace: group) }
subject { project.shared_runners_limit_namespace }
......@@ -1337,6 +1340,7 @@ RSpec.describe Project do
describe '#visible_user_defined_inapplicable_rules' do
let_it_be(:project) { create(:project) }
let!(:rule) { create(:approval_project_rule, project: project) }
let!(:another_rule) { create(:approval_project_rule, project: project) }
......@@ -1926,6 +1930,7 @@ RSpec.describe Project do
context 'Geo repository update events' do
let_it_be(:import_state) { create(:import_state, :started, project: project) }
let(:repository_updated_service) { instance_double('::Geo::RepositoryUpdatedService') }
let(:wiki_updated_service) { instance_double('::Geo::RepositoryUpdatedService') }
let(:design_updated_service) { instance_double('::Geo::RepositoryUpdatedService') }
......
......@@ -115,6 +115,7 @@ RSpec.describe RequirementsManagement::TestReport do
let_it_be(:build_author) { create(:user) }
let_it_be(:build) { create(:ci_build, author: build_author) }
let_it_be(:requirement) { create(:requirement, state: :opened) }
let(:now) { Time.current }
context 'when build is passed as argument' do
......
......@@ -272,6 +272,7 @@ RSpec.describe Vulnerabilities::Finding do
describe '.undismissed' do
let_it_be(:project) { create(:project) }
let_it_be(:project2) { create(:project) }
let!(:finding1) { create(:vulnerabilities_finding, project: project) }
let!(:finding2) { create(:vulnerabilities_finding, project: project, report_type: :dast) }
let!(:finding3) { create(:vulnerabilities_finding, project: project2) }
......@@ -310,6 +311,7 @@ RSpec.describe Vulnerabilities::Finding do
describe '.dismissed' do
let_it_be(:project) { create(:project) }
let_it_be(:project2) { create(:project) }
let!(:finding1) { create(:vulnerabilities_finding, project: project) }
let!(:finding2) { create(:vulnerabilities_finding, project: project, report_type: :dast) }
let!(:finding3) { create(:vulnerabilities_finding, project: project2) }
......@@ -509,6 +511,7 @@ RSpec.describe Vulnerabilities::Finding do
describe 'feedback' do
let_it_be(:project) { create(:project) }
let(:finding) do
create(
:vulnerabilities_finding,
......
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