Commit 8cc3be68 authored by Matthias Käppler's avatar Matthias Käppler

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

Fix EmptyLineAfterFinalLetItBe offenses in spec/serializers

See merge request gitlab-org/gitlab!58406
parents d308d767 10fd73c4
......@@ -900,28 +900,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- spec/requests/lfs_http_spec.rb
- spec/requests/product_analytics/collector_app_spec.rb
- spec/requests/rack_attack_global_spec.rb
- spec/serializers/admin/user_entity_spec.rb
- spec/serializers/ci/lint/result_serializer_spec.rb
- spec/serializers/ci/pipeline_entity_spec.rb
- spec/serializers/container_repository_entity_spec.rb
- spec/serializers/container_tag_entity_spec.rb
- spec/serializers/deployment_serializer_spec.rb
- spec/serializers/diff_file_entity_spec.rb
- spec/serializers/evidences/evidence_entity_spec.rb
- spec/serializers/fork_namespace_entity_spec.rb
- spec/serializers/group_link/group_group_link_entity_spec.rb
- spec/serializers/group_link/project_group_link_entity_spec.rb
- spec/serializers/issue_board_entity_spec.rb
- spec/serializers/member_entity_spec.rb
- spec/serializers/member_user_entity_spec.rb
- spec/serializers/merge_request_diff_entity_spec.rb
- spec/serializers/merge_request_poll_cached_widget_entity_spec.rb
- spec/serializers/merge_request_user_entity_spec.rb
- spec/serializers/namespace_basic_entity_spec.rb
- spec/serializers/pipeline_details_entity_spec.rb
- spec/serializers/project_import_entity_spec.rb
- spec/serializers/project_serializer_spec.rb
- spec/serializers/review_app_setup_entity_spec.rb
- spec/services/admin/propagate_service_template_spec.rb
- spec/services/alert_management/create_alert_issue_service_spec.rb
- spec/services/audit_event_service_spec.rb
......
---
title: Fix EmptyLineAfterFinalLetItBe offenses in spec/serializers
merge_request: 58406
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed
......@@ -4,6 +4,7 @@ require "spec_helper"
RSpec.describe Admin::UserEntity do
let_it_be(:user) { build_stubbed(:user) }
let(:request) { double('request') }
let(:entity) do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Ci::Lint::ResultSerializer, :aggregate_failures do
let_it_be(:project) { create(:project, :repository) }
let(:result) do
Gitlab::Ci::Lint
.new(project: project, current_user: project.owner)
......
......@@ -7,6 +7,7 @@ RSpec.describe Ci::PipelineEntity do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let(:request) { double('request', current_user: user) }
let(:entity) { described_class.represent(pipeline, request: request) }
......@@ -165,6 +166,7 @@ RSpec.describe Ci::PipelineEntity do
context 'when pipeline is detached merge request pipeline' do
let_it_be(:merge_request) { create(:merge_request, :with_detached_merge_request_pipeline) }
let(:project) { merge_request.target_project }
let(:pipeline) { merge_request.pipelines_for_merge_request.first }
......@@ -213,6 +215,7 @@ RSpec.describe Ci::PipelineEntity do
context 'when pipeline is merge request pipeline' do
let_it_be(:merge_request) { create(:merge_request, :with_merge_request_pipeline, merge_sha: 'abc') }
let(:project) { merge_request.target_project }
let(:pipeline) { merge_request.pipelines_for_merge_request.first }
......
......@@ -6,6 +6,7 @@ RSpec.describe ContainerRepositoryEntity do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:repository) { create(:container_repository, project: project) }
let(:entity) { described_class.new(repository, request: request) }
let(:request) { double('request') }
......
......@@ -6,6 +6,7 @@ RSpec.describe ContainerTagEntity do
let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) }
let_it_be(:repository) { create(:container_repository, name: 'image', project: project) }
let(:entity) { described_class.new(tag, request: request) }
let(:request) { double('request') }
let(:tag) { repository.tag('test') }
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe DeploymentSerializer do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user, email: project.commit.author_email) }
let(:resource) { create(:deployment, project: project, sha: project.commit.id) }
let(:serializer) { described_class.new(request) }
......
......@@ -6,6 +6,7 @@ RSpec.describe DiffFileEntity do
include RepoHelpers
let_it_be(:project) { create(:project, :repository) }
let(:repository) { project.repository }
let(:commit) { project.commit(sample_commit.id) }
let(:diff_refs) { commit.diff_refs }
......@@ -22,6 +23,7 @@ RSpec.describe DiffFileEntity do
context 'when there is a merge request' do
let_it_be(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
let(:user) { create(:user) }
let(:code_navigation_path) { Gitlab::CodeNavigationPath.new(project, project.commit.sha) }
let(:request) { EntityRequest.new(project: project, current_user: user) }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe Evidences::EvidenceEntity do
let_it_be(:project) { create(:project) }
let(:release) { create(:release, project: project) }
let(:evidence) { build(:evidence, release: release) }
let(:schema_file) { 'evidences/evidence' }
......
......@@ -9,6 +9,7 @@ RSpec.describe ForkNamespaceEntity do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:namespace) { create(:group, :with_avatar, description: 'test') }
let(:memberships) do
user.members.index_by(&:source_id)
end
......
......@@ -6,6 +6,7 @@ RSpec.describe GroupLink::GroupGroupLinkEntity do
include_context 'group_group_link'
let_it_be(:current_user) { create(:user) }
let(:entity) { described_class.new(group_group_link) }
before do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe GroupLink::ProjectGroupLinkEntity do
let_it_be(:current_user) { create(:user) }
let_it_be(:project_group_link) { create(:project_group_link) }
let(:entity) { described_class.new(project_group_link) }
before do
......
......@@ -8,6 +8,7 @@ RSpec.describe IssueBoardEntity do
let_it_be(:user) { create(:user) }
let_it_be(:milestone) { create(:milestone, project: project) }
let_it_be(:label) { create(:label, project: project, title: 'Test Label') }
let(:request) { double('request', current_user: user) }
subject { described_class.new(resource, request: request).as_json }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe MemberEntity do
let_it_be(:current_user) { create(:user) }
let(:entity) { described_class.new(member, { current_user: current_user, group: group, source: source }) }
let(:entity_hash) { entity.as_json }
......
......@@ -6,6 +6,7 @@ RSpec.describe MemberUserEntity do
let_it_be(:user) { create(:user) }
let_it_be(:emoji) { 'slight_smile' }
let_it_be(:user_status) { create(:user_status, user: user, emoji: emoji) }
let(:entity) { described_class.new(user) }
let(:entity_hash) { entity.as_json }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe MergeRequestDiffEntity do
let_it_be(:project) { create(:project, :repository) }
let(:request) { EntityRequest.new(project: project) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
let(:merge_request_diffs) { merge_request.merge_request_diffs }
......
......@@ -8,6 +8,7 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
let_it_be(:project, refind: true) { create :project, :repository }
let_it_be(:resource, refind: true) { create(:merge_request, source_project: project, target_project: project) }
let_it_be(:user) { create(:user) }
let(:pipeline) { create(:ci_empty_pipeline, project: project) }
let(:request) { double('request', current_user: user, project: project) }
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe MergeRequestUserEntity do
let_it_be(:user) { create(:user) }
let_it_be(:merge_request) { create(:merge_request) }
let(:request) { EntityRequest.new(project: merge_request.target_project, current_user: user) }
let(:entity) do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe NamespaceBasicEntity do
let_it_be(:group) { create(:group) }
let(:entity) do
described_class.represent(group)
end
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe PipelineDetailsEntity do
let_it_be(:user) { create(:user) }
let(:request) { double('request') }
let(:entity) do
......
......@@ -6,6 +6,7 @@ RSpec.describe ProjectImportEntity do
include ImportHelper
let_it_be(:project) { create(:project, import_status: :started, import_source: 'namespace/project') }
let(:provider_url) { 'https://provider.com' }
let(:entity) { described_class.represent(project, provider_url: provider_url) }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe ProjectSerializer do
let_it_be(:project) { create(:project) }
let(:provider_url) { 'http://provider.com' }
context 'when serializer option is :import' do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe ReviewAppSetupEntity do
let_it_be(:user) { create(:admin) }
let(:project) { create(:project) }
let(:presenter) { ProjectPresenter.new(project, current_user: user) }
let(:entity) { described_class.new(presenter) }
......
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