Commit 01c16569 authored by Alex Kalderimis's avatar Alex Kalderimis

Merge branch 'issue#325836-fix-empty-line-after-let-it-be-models-project' into 'master'

Fix EmptyLineAfterFinalLetItBe offenses in spec/models/project

See merge request gitlab-org/gitlab!58372
parents 221964ab b85ce5f9
...@@ -863,11 +863,6 @@ RSpec/EmptyLineAfterFinalLetItBe: ...@@ -863,11 +863,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- spec/models/packages/package_spec.rb - spec/models/packages/package_spec.rb
- spec/models/packages/tag_spec.rb - spec/models/packages/tag_spec.rb
- spec/models/plan_limits_spec.rb - spec/models/plan_limits_spec.rb
- spec/models/project_services/chat_message/alert_message_spec.rb
- spec/models/project_services/jira_service_spec.rb
- spec/models/project_services/prometheus_service_spec.rb
- spec/models/project_services/slack_service_spec.rb
- spec/models/project_spec.rb
- spec/models/prometheus_alert_spec.rb - spec/models/prometheus_alert_spec.rb
- spec/models/protected_branch/push_access_level_spec.rb - spec/models/protected_branch/push_access_level_spec.rb
- spec/models/release_spec.rb - spec/models/release_spec.rb
......
---
title: Fix EmptyLineAfterFinalLetItBe offenses in spec/models/project
merge_request: 58372
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed
...@@ -6,6 +6,7 @@ RSpec.describe ChatMessage::AlertMessage do ...@@ -6,6 +6,7 @@ RSpec.describe ChatMessage::AlertMessage do
subject { described_class.new(args) } subject { described_class.new(args) }
let_it_be(:start_time) { Time.current } let_it_be(:start_time) { Time.current }
let(:alert) { create(:alert_management_alert, started_at: start_time) } let(:alert) { create(:alert_management_alert, started_at: start_time) }
let(:args) do let(:args) do
......
...@@ -790,6 +790,7 @@ RSpec.describe JiraService do ...@@ -790,6 +790,7 @@ RSpec.describe JiraService do
describe '#create_cross_reference_note' do describe '#create_cross_reference_note' do
let_it_be(:user) { build_stubbed(:user) } let_it_be(:user) { build_stubbed(:user) }
let(:jira_issue) { ExternalIssue.new('JIRA-123', project) } let(:jira_issue) { ExternalIssue.new('JIRA-123', project) }
subject { jira_service.create_cross_reference_note(jira_issue, resource, user) } subject { jira_service.create_cross_reference_note(jira_issue, resource, user) }
......
...@@ -9,6 +9,7 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching, :snowpl ...@@ -9,6 +9,7 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching, :snowpl
include ReactiveCachingHelpers include ReactiveCachingHelpers
let_it_be_with_reload(:project) { create(:prometheus_project) } let_it_be_with_reload(:project) { create(:prometheus_project) }
let(:service) { project.prometheus_service } let(:service) { project.prometheus_service }
describe "Associations" do describe "Associations" do
...@@ -337,6 +338,7 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching, :snowpl ...@@ -337,6 +338,7 @@ RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching, :snowpl
context 'cluster belongs to projects group' do context 'cluster belongs to projects group' do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let(:project) { create(:prometheus_project, group: group) } let(:project) { create(:prometheus_project, group: group) }
let(:cluster) { create(:cluster_for_group, :with_installed_helm, groups: [group]) } let(:cluster) { create(:cluster_for_group, :with_installed_helm, groups: [group]) }
......
...@@ -32,6 +32,7 @@ RSpec.describe SlackService do ...@@ -32,6 +32,7 @@ RSpec.describe SlackService do
context 'event is not supported for usage log' do context 'event is not supported for usage log' do
let_it_be(:pipeline) { create(:ci_pipeline) } let_it_be(:pipeline) { create(:ci_pipeline) }
let(:data) { Gitlab::DataBuilder::Pipeline.build(pipeline) } let(:data) { Gitlab::DataBuilder::Pipeline.build(pipeline) }
it 'does not increase the usage data counter' do it 'does not increase the usage data counter' do
...@@ -43,6 +44,7 @@ RSpec.describe SlackService do ...@@ -43,6 +44,7 @@ RSpec.describe SlackService do
context 'issue notification' do context 'issue notification' do
let_it_be(:issue) { create(:issue) } let_it_be(:issue) { create(:issue) }
let(:data) { issue.to_hook_data(user) } let(:data) { issue.to_hook_data(user) }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_issue_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_issue_notification'
...@@ -56,6 +58,7 @@ RSpec.describe SlackService do ...@@ -56,6 +58,7 @@ RSpec.describe SlackService do
context 'deployment notification' do context 'deployment notification' do
let_it_be(:deployment) { create(:deployment, user: user) } let_it_be(:deployment) { create(:deployment, user: user) }
let(:data) { Gitlab::DataBuilder::Deployment.build(deployment) } let(:data) { Gitlab::DataBuilder::Deployment.build(deployment) }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_deployment_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_deployment_notification'
...@@ -63,6 +66,7 @@ RSpec.describe SlackService do ...@@ -63,6 +66,7 @@ RSpec.describe SlackService do
context 'wiki_page notification' do context 'wiki_page notification' do
let_it_be(:wiki_page) { create(:wiki_page, wiki: project.wiki, message: 'user created page: Awesome wiki_page') } let_it_be(:wiki_page) { create(:wiki_page, wiki: project.wiki, message: 'user created page: Awesome wiki_page') }
let(:data) { Gitlab::DataBuilder::WikiPage.build(wiki_page, user, 'create') } let(:data) { Gitlab::DataBuilder::WikiPage.build(wiki_page, user, 'create') }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_wiki_page_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_wiki_page_notification'
...@@ -70,6 +74,7 @@ RSpec.describe SlackService do ...@@ -70,6 +74,7 @@ RSpec.describe SlackService do
context 'merge_request notification' do context 'merge_request notification' do
let_it_be(:merge_request) { create(:merge_request) } let_it_be(:merge_request) { create(:merge_request) }
let(:data) { merge_request.to_hook_data(user) } let(:data) { merge_request.to_hook_data(user) }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_merge_request_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_merge_request_notification'
...@@ -77,6 +82,7 @@ RSpec.describe SlackService do ...@@ -77,6 +82,7 @@ RSpec.describe SlackService do
context 'note notification' do context 'note notification' do
let_it_be(:issue_note) { create(:note_on_issue, note: 'issue note') } let_it_be(:issue_note) { create(:note_on_issue, note: 'issue note') }
let(:data) { Gitlab::DataBuilder::Note.build(issue_note, user) } let(:data) { Gitlab::DataBuilder::Note.build(issue_note, user) }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_note_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_note_notification'
...@@ -93,6 +99,7 @@ RSpec.describe SlackService do ...@@ -93,6 +99,7 @@ RSpec.describe SlackService do
context 'confidential note notification' do context 'confidential note notification' do
let_it_be(:confidential_issue_note) { create(:note_on_issue, note: 'issue note', confidential: true) } let_it_be(:confidential_issue_note) { create(:note_on_issue, note: 'issue note', confidential: true) }
let(:data) { Gitlab::DataBuilder::Note.build(confidential_issue_note, user) } let(:data) { Gitlab::DataBuilder::Note.build(confidential_issue_note, user) }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_confidential_note_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_confidential_note_notification'
...@@ -100,6 +107,7 @@ RSpec.describe SlackService do ...@@ -100,6 +107,7 @@ RSpec.describe SlackService do
context 'confidential issue notification' do context 'confidential issue notification' do
let_it_be(:issue) { create(:issue, confidential: true) } let_it_be(:issue) { create(:issue, confidential: true) }
let(:data) { issue.to_hook_data(user) } let(:data) { issue.to_hook_data(user) }
it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_confidential_issue_notification' it_behaves_like 'increases the usage data counter', 'i_ecosystem_slack_service_confidential_issue_notification'
......
...@@ -891,6 +891,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -891,6 +891,7 @@ RSpec.describe Project, factory_default: :keep do
describe '#get_issue' do describe '#get_issue' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let!(:issue) { create(:issue, project: project) } let!(:issue) { create(:issue, project: project) }
before_all do before_all do
...@@ -2406,6 +2407,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -2406,6 +2407,7 @@ RSpec.describe Project, factory_default: :keep do
describe '#latest_pipeline' do describe '#latest_pipeline' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:second_branch) { project.repository.branches[2] } let(:second_branch) { project.repository.branches[2] }
let!(:pipeline_for_default_branch) do let!(:pipeline_for_default_branch) do
...@@ -2870,6 +2872,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -2870,6 +2872,7 @@ RSpec.describe Project, factory_default: :keep do
describe '#emails_disabled?' do describe '#emails_disabled?' do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let(:project) { build(:project, namespace: namespace, emails_disabled: false) } let(:project) { build(:project, namespace: namespace, emails_disabled: false) }
context 'emails disabled in group' do context 'emails disabled in group' do
...@@ -3190,6 +3193,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -3190,6 +3193,7 @@ RSpec.describe Project, factory_default: :keep do
describe '#ci_variables_for' do describe '#ci_variables_for' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:environment_scope) { '*' } let(:environment_scope) { '*' }
let!(:ci_variable) do let!(:ci_variable) do
...@@ -4035,6 +4039,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -4035,6 +4039,7 @@ RSpec.describe Project, factory_default: :keep do
include ProjectHelpers include ProjectHelpers
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let!(:project) { create(:project, project_level, namespace: group ) } let!(:project) { create(:project, project_level, namespace: group ) }
let(:user) { create_user_from_membership(project, membership) } let(:user) { create_user_from_membership(project, membership) }
...@@ -4300,6 +4305,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -4300,6 +4305,7 @@ RSpec.describe Project, factory_default: :keep do
context 'legacy storage' do context 'legacy storage' do
let_it_be(:project) { create(:project, :repository, :legacy_storage) } let_it_be(:project) { create(:project, :repository, :legacy_storage) }
let(:gitlab_shell) { Gitlab::Shell.new } let(:gitlab_shell) { Gitlab::Shell.new }
let(:project_storage) { project.send(:storage) } let(:project_storage) { project.send(:storage) }
...@@ -4399,6 +4405,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -4399,6 +4405,7 @@ RSpec.describe Project, factory_default: :keep do
context 'hashed storage' do context 'hashed storage' do
let_it_be(:project) { create(:project, :repository, skip_disk_validation: true) } let_it_be(:project) { create(:project, :repository, skip_disk_validation: true) }
let(:gitlab_shell) { Gitlab::Shell.new } let(:gitlab_shell) { Gitlab::Shell.new }
let(:hash) { Digest::SHA2.hexdigest(project.id.to_s) } let(:hash) { Digest::SHA2.hexdigest(project.id.to_s) }
let(:hashed_prefix) { File.join('@hashed', hash[0..1], hash[2..3]) } let(:hashed_prefix) { File.join('@hashed', hash[0..1], hash[2..3]) }
...@@ -4489,6 +4496,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -4489,6 +4496,7 @@ RSpec.describe Project, factory_default: :keep do
describe '#has_ci?' do describe '#has_ci?' do
let_it_be(:project, reload: true) { create(:project) } let_it_be(:project, reload: true) { create(:project) }
let(:repository) { double } let(:repository) { double }
before do before do
...@@ -4985,6 +4993,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -4985,6 +4993,7 @@ RSpec.describe Project, factory_default: :keep do
context 'branch protection' do context 'branch protection' do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let(:project) { create(:project, :repository, namespace: namespace) } let(:project) { create(:project, :repository, namespace: namespace) }
before do before do
...@@ -6597,6 +6606,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -6597,6 +6606,7 @@ RSpec.describe Project, factory_default: :keep do
describe '#latest_jira_import' do describe '#latest_jira_import' do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
context 'when no jira imports' do context 'when no jira imports' do
it 'returns nil' do it 'returns nil' do
expect(project.latest_jira_import).to be nil expect(project.latest_jira_import).to be nil
......
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