Commit c961c8e6 authored by Huzaifa Iftikhar's avatar Huzaifa Iftikhar

Fix EmptyLineAfterFinalLetItBe offenses in spec/presenters

Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/325836
parent 3c2c533b
......@@ -857,18 +857,6 @@ RSpec/EmptyLineAfterFinalLetItBe:
- spec/models/user_spec.rb
- spec/models/wiki_page/meta_spec.rb
- spec/models/wiki_page_spec.rb
- spec/presenters/alert_management/alert_presenter_spec.rb
- spec/presenters/ci/pipeline_presenter_spec.rb
- spec/presenters/label_presenter_spec.rb
- spec/presenters/packages/composer/packages_presenter_spec.rb
- spec/presenters/packages/conan/package_presenter_spec.rb
- spec/presenters/packages/detail/package_presenter_spec.rb
- spec/presenters/packages/npm/package_presenter_spec.rb
- spec/presenters/packages/nuget/search_results_presenter_spec.rb
- spec/presenters/project_presenter_spec.rb
- spec/presenters/prometheus_alert_presenter_spec.rb
- spec/presenters/release_presenter_spec.rb
- spec/presenters/user_presenter_spec.rb
- spec/requests/api/api_spec.rb
- spec/requests/api/award_emoji_spec.rb
- spec/requests/api/branches_spec.rb
......
......@@ -20,6 +20,7 @@ RSpec.describe AlertManagement::AlertPresenter do
end
let_it_be(:alert) { create(:alert_management_alert, project: project, payload: payload) }
let(:alert_url) { "http://localhost/#{project.full_path}/-/alert_management/#{alert.iid}/details" }
subject(:presenter) { described_class.new(alert) }
......
......@@ -8,6 +8,7 @@ RSpec.describe Ci::PipelinePresenter do
let_it_be(:user) { create(:user) }
let_it_be_with_reload(:project) { create(:project, :test_repo) }
let_it_be_with_reload(:pipeline) { create(:ci_pipeline, project: project) }
let(:current_user) { user }
subject(:presenter) do
......@@ -246,6 +247,7 @@ RSpec.describe Ci::PipelinePresenter do
context 'permissions' do
let_it_be_with_refind(:merge_request) { create(:merge_request, :with_detached_merge_request_pipeline, source_project: project) }
let(:pipeline) { merge_request.all_pipelines.take }
shared_examples 'private merge requests' do
......
......@@ -7,6 +7,7 @@ RSpec.describe LabelPresenter do
let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, group: group) }
let(:label) { build_stubbed(:label, project: project).present(issuable_subject: project) }
let(:group_label) { build_stubbed(:group_label, group: group).present(issuable_subject: project) }
......
......@@ -9,6 +9,7 @@ RSpec.describe ::Packages::Composer::PackagesPresenter 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!(:package1) { create(:composer_package, :with_metadatum, project: project, name: package_name, version: '1.0.0', json: json) }
let!(:package2) { create(:composer_package, :with_metadatum, project: project, name: package_name, version: '2.0.0', json: json) }
......
......@@ -7,6 +7,7 @@ RSpec.describe ::Packages::Conan::PackagePresenter do
let_it_be(:package) { create(:conan_package) }
let_it_be(:project) { package.project }
let_it_be(:conan_package_reference) { '123456789'}
let(:params) { { package_scope: :instance } }
shared_examples 'no existing package' do
......
......@@ -125,6 +125,7 @@ RSpec.describe ::Packages::Detail::PackagePresenter do
context 'with nuget_metadatum' do
let_it_be(:package) { create(:nuget_package, project: project) }
let_it_be(:nuget_metadatum) { create(:nuget_metadatum, package: package) }
let(:expected_package_details) { super().merge(nuget_metadatum: nuget_metadatum) }
it 'returns nuget_metadatum' do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec.describe ::Packages::Npm::PackagePresenter do
let_it_be(:project) { create(:project) }
let_it_be(:package_name) { "@#{project.root_namespace.path}/test" }
let!(:package1) { create(:npm_package, version: '1.0.4', project: project, name: package_name) }
let!(:package2) { create(:npm_package, version: '1.0.6', project: project, name: package_name) }
let!(:latest_package) { create(:npm_package, version: '1.0.11', project: project, name: package_name) }
......
......@@ -11,6 +11,7 @@ RSpec.describe Packages::Nuget::SearchResultsPresenter do
let_it_be(:packages_c) { create_list(:nuget_package, 5, project: project, name: 'DummyPackageC') }
let_it_be(:search_results) { OpenStruct.new(total_count: 3, results: [package_a, packages_b, packages_c].flatten) }
let_it_be(:presenter) { described_class.new(search_results) }
let(:total_count) { presenter.total_count }
let(:data) { presenter.data }
......
......@@ -72,6 +72,7 @@ RSpec.describe ProjectPresenter do
context 'when repository is not empty' do
let_it_be(:project) { create(:project, :public, :repository) }
let(:release) { create(:release, project: project, author: user) }
it 'returns files and readme if user has repository access' do
......@@ -271,6 +272,7 @@ RSpec.describe ProjectPresenter do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) }
let_it_be(:release) { create(:release, project: project, author: user) }
let(:presenter) { described_class.new(project, current_user: user) }
describe '#files_anchor_data' do
......
......@@ -12,6 +12,7 @@ RSpec.describe PrometheusAlertPresenter do
subject { presenter.humanized_text }
let_it_be(:prometheus_metric) { create(:prometheus_metric, project: project) }
let(:prometheus_alert) { create(:prometheus_alert, operator: operator, project: project, environment: environment, prometheus_metric: prometheus_metric) }
let(:operator) { :gt }
......
......@@ -6,6 +6,7 @@ RSpec.describe ReleasePresenter do
include Gitlab::Routing.url_helpers
let_it_be(:project) { create(:project, :repository) }
let(:developer) { create(:user) }
let(:guest) { create(:user) }
let(:user) { developer }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe UserPresenter do
let_it_be(:user) { create(:user) }
subject(:presenter) { described_class.new(user) }
describe '#web_path' 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