Commit 0ac15812 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'enable-cops-with-1-or-2-offenses' into 'master'

Fix Rubocop offenses for cops with 1 or 2 offenses

See merge request gitlab-org/gitlab!23506
parents c48e5552 f320219a
...@@ -52,14 +52,6 @@ Layout/ClosingParenthesisIndentation: ...@@ -52,14 +52,6 @@ Layout/ClosingParenthesisIndentation:
- 'spec/support/helpers/stub_object_storage.rb' - 'spec/support/helpers/stub_object_storage.rb'
- 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb' - 'spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Layout/DotPosition:
Exclude:
- 'app/models/concerns/relative_positioning.rb'
# Offense count: 69 # Offense count: 69
# Cop supports --auto-correct. # Cop supports --auto-correct.
Layout/EmptyLinesAroundArguments: Layout/EmptyLinesAroundArguments:
...@@ -100,12 +92,6 @@ Layout/IndentFirstParameter: ...@@ -100,12 +92,6 @@ Layout/IndentFirstParameter:
- 'spec/support/helpers/repo_helpers.rb' - 'spec/support/helpers/repo_helpers.rb'
- 'spec/support/helpers/stub_object_storage.rb' - 'spec/support/helpers/stub_object_storage.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/LeadingBlankLines:
Exclude:
- 'lib/tasks/yarn.rake'
# Offense count: 54 # Offense count: 54
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth. # Configuration parameters: EnforcedStyle, IndentationWidth.
...@@ -150,11 +136,6 @@ Layout/SpaceInsideBlockBraces: ...@@ -150,11 +136,6 @@ Layout/SpaceInsideBlockBraces:
Layout/SpaceInsideParens: Layout/SpaceInsideParens:
Enabled: false Enabled: false
# Offense count: 1
Lint/DisjunctiveAssignmentInConstructor:
Exclude:
- 'app/models/uploads/base.rb'
# Offense count: 19 # Offense count: 19
Lint/DuplicateMethods: Lint/DuplicateMethods:
Exclude: Exclude:
...@@ -177,21 +158,6 @@ Lint/DuplicateMethods: ...@@ -177,21 +158,6 @@ Lint/DuplicateMethods:
Lint/MissingCopEnableDirective: Lint/MissingCopEnableDirective:
Enabled: false Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
# Whitelist: present?, blank?, presence, try, try!
Lint/SafeNavigationConsistency:
Exclude:
- 'lib/gitlab/gpg/commit.rb'
# Offense count: 2
# Cop supports --auto-correct.
Lint/ToJSON:
Exclude:
- 'lib/gitlab/cycle_analytics/usage_data.rb'
- 'lib/gitlab/template/base_template.rb'
# Offense count: 6 # Offense count: 6
Lint/UriEscapeUnescape: Lint/UriEscapeUnescape:
Exclude: Exclude:
...@@ -200,12 +166,6 @@ Lint/UriEscapeUnescape: ...@@ -200,12 +166,6 @@ Lint/UriEscapeUnescape:
- 'spec/lib/google_api/auth_spec.rb' - 'spec/lib/google_api/auth_spec.rb'
- 'spec/requests/api/files_spec.rb' - 'spec/requests/api/files_spec.rb'
# Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
- 'lib/gitlab/git/diff_collection.rb'
# Offense count: 165 # Offense count: 165
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
...@@ -284,12 +244,6 @@ RSpec/LetBeforeExamples: ...@@ -284,12 +244,6 @@ RSpec/LetBeforeExamples:
- 'spec/rubocop/cop/migration/update_column_in_batches_spec.rb' - 'spec/rubocop/cop/migration/update_column_in_batches_spec.rb'
- 'spec/serializers/pipeline_details_entity_spec.rb' - 'spec/serializers/pipeline_details_entity_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
RSpec/MultipleSubjects:
Exclude:
- 'spec/services/merge_requests/create_from_issue_service_spec.rb'
# Offense count: 2018 # Offense count: 2018
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers. # Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
...@@ -319,12 +273,6 @@ RSpec/ScatteredSetup: ...@@ -319,12 +273,6 @@ RSpec/ScatteredSetup:
- 'spec/requests/api/jobs_spec.rb' - 'spec/requests/api/jobs_spec.rb'
- 'spec/services/projects/create_service_spec.rb' - 'spec/services/projects/create_service_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
RSpec/SharedContext:
Exclude:
- 'spec/features/admin/admin_groups_spec.rb'
# Offense count: 4 # Offense count: 4
RSpec/VoidExpect: RSpec/VoidExpect:
Exclude: Exclude:
...@@ -348,12 +296,6 @@ Rails/ApplicationController: ...@@ -348,12 +296,6 @@ Rails/ApplicationController:
- 'spec/controllers/concerns/continue_params_spec.rb' - 'spec/controllers/concerns/continue_params_spec.rb'
- 'spec/lib/marginalia_spec.rb' - 'spec/lib/marginalia_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/base_mailer.rb'
# Offense count: 8 # Offense count: 8
# Cop supports --auto-correct. # Cop supports --auto-correct.
Rails/BelongsTo: Rails/BelongsTo:
...@@ -414,14 +356,6 @@ Rails/LinkToBlank: ...@@ -414,14 +356,6 @@ Rails/LinkToBlank:
Rails/RakeEnvironment: Rails/RakeEnvironment:
Enabled: false Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/RedundantAllowNil:
Exclude:
- 'app/models/application_setting.rb'
# Offense count: 868 # Offense count: 868
# Configuration parameters: Blacklist, Whitelist. # Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
...@@ -457,12 +391,6 @@ Style/CommentedKeyword: ...@@ -457,12 +391,6 @@ Style/CommentedKeyword:
- 'lib/tasks/gitlab/backup.rake' - 'lib/tasks/gitlab/backup.rake'
- 'spec/tasks/gitlab/backup_rake_spec.rb' - 'spec/tasks/gitlab/backup_rake_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/Dir:
Exclude:
- 'qa/qa.rb'
# Offense count: 6 # Offense count: 6
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/EachWithObject: Style/EachWithObject:
...@@ -591,13 +519,6 @@ Style/NumericLiteralPrefix: ...@@ -591,13 +519,6 @@ Style/NumericLiteralPrefix:
Style/NumericPredicate: Style/NumericPredicate:
Enabled: false Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
Style/OrAssignment:
Exclude:
- 'lib/api/commit_statuses.rb'
- 'lib/gitlab/project_transfer.rb'
# Offense count: 106 # Offense count: 106
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/ParallelAssignment: Style/ParallelAssignment:
...@@ -632,12 +553,6 @@ Style/PerlBackrefs: ...@@ -632,12 +553,6 @@ Style/PerlBackrefs:
Style/RaiseArgs: Style/RaiseArgs:
Enabled: false Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantConditional:
Exclude:
- 'lib/system_check/helpers.rb'
# Offense count: 221 # Offense count: 221
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/RedundantFreeze: Style/RedundantFreeze:
...@@ -704,12 +619,6 @@ Style/SingleLineMethods: ...@@ -704,12 +619,6 @@ Style/SingleLineMethods:
Style/SpecialGlobalVars: Style/SpecialGlobalVars:
EnforcedStyle: use_perl_names EnforcedStyle: use_perl_names
# Offense count: 1
# Cop supports --auto-correct.
Style/StderrPuts:
Exclude:
- 'config/initializers/rspec_profiling.rb'
# Offense count: 75 # Offense count: 75
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.
...@@ -736,30 +645,6 @@ Style/TernaryParentheses: ...@@ -736,30 +645,6 @@ Style/TernaryParentheses:
- 'spec/requests/api/pipeline_schedules_spec.rb' - 'spec/requests/api/pipeline_schedules_spec.rb'
- 'spec/support/capybara.rb' - 'spec/support/capybara.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral:
Exclude:
- 'ee/spec/models/project_spec.rb'
- 'spec/lib/gitlab/metrics/dashboard/processor_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral:
Exclude:
- 'lib/gitlab/ci/ansi2html.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/UnlessElse:
Exclude:
- 'lib/backup/manager.rb'
- 'lib/gitlab/project_search_results.rb'
# Offense count: 8 # Offense count: 8
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/UnneededCondition: Style/UnneededCondition:
...@@ -776,13 +661,6 @@ Style/UnneededCondition: ...@@ -776,13 +661,6 @@ Style/UnneededCondition:
Style/UnneededInterpolation: Style/UnneededInterpolation:
Enabled: false Enabled: false
# Offense count: 2
# Cop supports --auto-correct.
Style/UnneededSort:
Exclude:
- 'app/models/concerns/resolvable_discussion.rb'
- 'lib/gitlab/highlight.rb'
RSpec/ReceiveCounts: RSpec/ReceiveCounts:
Exclude: Exclude:
- 'ee/spec/models/broadcast_message_spec.rb' - 'ee/spec/models/broadcast_message_spec.rb'
...@@ -907,4 +785,4 @@ RSpec/ContextMethod: ...@@ -907,4 +785,4 @@ RSpec/ContextMethod:
- 'spec/services/projects/open_issues_count_service_spec.rb' - 'spec/services/projects/open_issues_count_service_spec.rb'
- 'spec/services/quick_actions/interpret_service_spec.rb' - 'spec/services/quick_actions/interpret_service_spec.rb'
- 'spec/support/shared_examples/services/boards/issues_list_service_shared_examples.rb' - 'spec/support/shared_examples/services/boards/issues_list_service_shared_examples.rb'
- 'spec/uploaders/namespace_file_uploader_spec.rb' - 'spec/uploaders/namespace_file_uploader_spec.rb'
\ No newline at end of file
# frozen_string_literal: true # frozen_string_literal: true
class AbuseReportMailer < BaseMailer class AbuseReportMailer < ApplicationMailer
layout 'empty_mailer' layout 'empty_mailer'
helper EmailsHelper helper EmailsHelper
......
# frozen_string_literal: true # frozen_string_literal: true
class BaseMailer < ActionMailer::Base class ApplicationMailer < ActionMailer::Base
around_action :render_with_default_locale around_action :render_with_default_locale
helper ApplicationHelper helper ApplicationHelper
......
# frozen_string_literal: true # frozen_string_literal: true
class EmailRejectionMailer < BaseMailer class EmailRejectionMailer < ApplicationMailer
layout 'empty_mailer' layout 'empty_mailer'
helper EmailsHelper helper EmailsHelper
......
# frozen_string_literal: true # frozen_string_literal: true
class Notify < BaseMailer class Notify < ApplicationMailer
include ActionDispatch::Routing::PolymorphicRoutes include ActionDispatch::Routing::PolymorphicRoutes
include GitlabRoutingHelper include GitlabRoutingHelper
include EmailsHelper include EmailsHelper
......
# frozen_string_literal: true # frozen_string_literal: true
class RepositoryCheckMailer < BaseMailer class RepositoryCheckMailer < ApplicationMailer
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
layout 'empty_mailer' layout 'empty_mailer'
......
...@@ -142,7 +142,7 @@ class ApplicationSetting < ApplicationRecord ...@@ -142,7 +142,7 @@ class ApplicationSetting < ApplicationRecord
if: :auto_devops_enabled? if: :auto_devops_enabled?
validates :enabled_git_access_protocol, validates :enabled_git_access_protocol,
inclusion: { in: %w(ssh http), allow_blank: true, allow_nil: true } inclusion: { in: %w(ssh http), allow_blank: true }
validates :domain_blacklist, validates :domain_blacklist,
presence: { message: 'Domain blacklist cannot be empty if Blacklist is enabled.' }, presence: { message: 'Domain blacklist cannot be empty if Blacklist is enabled.' },
......
...@@ -237,8 +237,7 @@ module RelativePositioning ...@@ -237,8 +237,7 @@ module RelativePositioning
relation relation
.pluck(self.class.relative_positioning_parent_column, Arel.sql("#{calculation}(relative_position) AS position")) .pluck(self.class.relative_positioning_parent_column, Arel.sql("#{calculation}(relative_position) AS position"))
.first&. .first&.last
last
end end
def scoped_items def scoped_items
......
...@@ -63,7 +63,7 @@ module ResolvableDiscussion ...@@ -63,7 +63,7 @@ module ResolvableDiscussion
return unless resolved? return unless resolved?
strong_memoize(:last_resolved_note) do strong_memoize(:last_resolved_note) do
resolved_notes.sort_by(&:resolved_at).last resolved_notes.max_by(&:resolved_at)
end end
end end
......
...@@ -7,7 +7,7 @@ module Uploads ...@@ -7,7 +7,7 @@ module Uploads
attr_reader :logger attr_reader :logger
def initialize(logger: nil) def initialize(logger: nil)
@logger ||= Rails.logger # rubocop:disable Gitlab/RailsLogger @logger = Rails.logger # rubocop:disable Gitlab/RailsLogger
end end
def delete_keys_async(keys_to_delete) def delete_keys_async(keys_to_delete)
......
...@@ -46,7 +46,7 @@ module RspecProfilingExt ...@@ -46,7 +46,7 @@ module RspecProfilingExt
rescue => err rescue => err
return if @already_logged_example_finished_error # rubocop:disable Gitlab/ModuleWithInstanceVariables return if @already_logged_example_finished_error # rubocop:disable Gitlab/ModuleWithInstanceVariables
$stderr.puts "rspec_profiling couldn't collect an example: #{err}. Further warnings suppressed." warn "rspec_profiling couldn't collect an example: #{err}. Further warnings suppressed."
@already_logged_example_finished_error = true # rubocop:disable Gitlab/ModuleWithInstanceVariables @already_logged_example_finished_error = true # rubocop:disable Gitlab/ModuleWithInstanceVariables
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class CiMinutesUsageMailer < BaseMailer class CiMinutesUsageMailer < ApplicationMailer
def notify(namespace_name, recipients) def notify(namespace_name, recipients)
@namespace_name = namespace_name @namespace_name = namespace_name
......
...@@ -15,7 +15,7 @@ describe Emails::ServiceDesk do ...@@ -15,7 +15,7 @@ describe Emails::ServiceDesk do
let_it_be(:issue) { create(:issue, project: project) } let_it_be(:issue) { create(:issue, project: project) }
let(:template) { double(content: template_content) } let(:template) { double(content: template_content) }
class ServiceEmailClass < BaseMailer class ServiceEmailClass < ApplicationMailer
include GitlabRoutingHelper include GitlabRoutingHelper
include EmailsHelper include EmailsHelper
include Emails::ServiceDesk include Emails::ServiceDesk
......
...@@ -1282,7 +1282,7 @@ describe Project do ...@@ -1282,7 +1282,7 @@ describe Project do
:epics, # Gold only :epics, # Gold only
:service_desk, # Silver and up :service_desk, # Silver and up
:audit_events, # Bronze and up :audit_events, # Bronze and up
:geo, # Global feature, should not be checked at namespace level :geo # Global feature, should not be checked at namespace level
]) ])
end end
......
...@@ -76,14 +76,12 @@ module API ...@@ -76,14 +76,12 @@ module API
name = params[:name] || params[:context] || 'default' name = params[:name] || params[:context] || 'default'
unless pipeline pipeline ||= user_project.ci_pipelines.create!(
pipeline = user_project.ci_pipelines.create!( source: :external,
source: :external, sha: commit.sha,
sha: commit.sha, ref: ref,
ref: ref, user: current_user,
user: current_user, protected: user_project.protected_for?(ref))
protected: user_project.protected_for?(ref))
end
status = GenericCommitStatus.running_or_pending.find_or_initialize_by( status = GenericCommitStatus.running_or_pending.find_or_initialize_by(
project: user_project, project: user_project,
......
...@@ -135,11 +135,11 @@ module Backup ...@@ -135,11 +135,11 @@ module Backup
progress.print 'Unpacking backup ... ' progress.print 'Unpacking backup ... '
unless Kernel.system(*%W(tar -xf #{tar_file})) if Kernel.system(*%W(tar -xf #{tar_file}))
progress.puts 'done'.color(:green)
else
progress.puts 'unpacking backup failed'.color(:red) progress.puts 'unpacking backup failed'.color(:red)
exit 1 exit 1
else
progress.puts 'done'.color(:green)
end end
ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0 ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0
......
...@@ -15,7 +15,7 @@ module Gitlab ...@@ -15,7 +15,7 @@ module Gitlab
4 => 'blue', 4 => 'blue',
5 => 'magenta', 5 => 'magenta',
6 => 'cyan', 6 => 'cyan',
7 => 'white', # not that this is gray in the dark (aka default) color table 7 => 'white' # not that this is gray in the dark (aka default) color table
}.freeze }.freeze
STYLE_SWITCHES = { STYLE_SWITCHES = {
......
...@@ -12,7 +12,7 @@ module Gitlab ...@@ -12,7 +12,7 @@ module Gitlab
@options = { from: 7.days.ago } @options = { from: 7.days.ago }
end end
def to_json def to_json(*)
total = 0 total = 0
values = values =
......
...@@ -102,7 +102,7 @@ module Gitlab ...@@ -102,7 +102,7 @@ module Gitlab
def populate! def populate!
return if @populated return if @populated
each { nil } # force a loop through all diffs each {} # force a loop through all diffs
nil nil
end end
......
...@@ -16,13 +16,13 @@ module Gitlab ...@@ -16,13 +16,13 @@ module Gitlab
def signature_text def signature_text
strong_memoize(:signature_text) do strong_memoize(:signature_text) do
@signature_data&.itself && @signature_data[0] @signature_data&.itself && @signature_data[0] # rubocop:disable Lint/SafeNavigationConsistency
end end
end end
def signed_text def signed_text
strong_memoize(:signed_text) do strong_memoize(:signed_text) do
@signature_data&.itself && @signature_data[1] @signature_data&.itself && @signature_data[1] # rubocop:disable Lint/SafeNavigationConsistency
end end
end end
......
...@@ -32,7 +32,7 @@ module Gitlab ...@@ -32,7 +32,7 @@ module Gitlab
@lexer ||= custom_language || begin @lexer ||= custom_language || begin
Rouge::Lexer.guess(filename: @blob_name, source: @blob_content).new Rouge::Lexer.guess(filename: @blob_name, source: @blob_content).new
rescue Rouge::Guesser::Ambiguous => e rescue Rouge::Guesser::Ambiguous => e
e.alternatives.sort_by(&:tag).first e.alternatives.min_by(&:tag)
end end
end end
......
...@@ -106,10 +106,10 @@ module Gitlab ...@@ -106,10 +106,10 @@ module Gitlab
@wiki_blobs ||= begin @wiki_blobs ||= begin
if project.wiki_enabled? && query.present? if project.wiki_enabled? && query.present?
unless project.wiki.empty? if project.wiki.empty?
Gitlab::WikiFileFinder.new(project, repository_wiki_ref).find(query)
else
[] []
else
Gitlab::WikiFileFinder.new(project, repository_wiki_ref).find(query)
end end
else else
[] []
......
...@@ -32,7 +32,7 @@ module Gitlab ...@@ -32,7 +32,7 @@ module Gitlab
private private
def move(path_was, path, base_dir = nil) def move(path_was, path, base_dir = nil)
base_dir = root_dir unless base_dir base_dir ||= root_dir
from = File.join(base_dir, path_was) from = File.join(base_dir, path_was)
to = File.join(base_dir, path) to = File.join(base_dir, path)
FileUtils.mv(from, to) FileUtils.mv(from, to)
......
...@@ -33,7 +33,7 @@ module Gitlab ...@@ -33,7 +33,7 @@ module Gitlab
self self
end end
def to_json def to_json(*)
{ key: key, name: name, content: content } { key: key, name: name, content: content }
end end
......
...@@ -57,11 +57,7 @@ module SystemCheck ...@@ -57,11 +57,7 @@ module SystemCheck
end end
def should_sanitize? def should_sanitize?
if ENV['SANITIZE'] == 'true' ENV['SANITIZE'] == 'true'
true
else
false
end
end end
def omnibus_gitlab? def omnibus_gitlab?
......
# frozen_string_literal: true
namespace :yarn do namespace :yarn do
desc 'Ensure Yarn is installed' desc 'Ensure Yarn is installed'
......
# frozen_string_literal: true # frozen_string_literal: true
$: << File.expand_path(File.dirname(__FILE__)) $: << File.expand_path(__dir__)
Encoding.default_external = 'UTF-8' Encoding.default_external = 'UTF-8'
......
...@@ -134,7 +134,7 @@ describe 'Admin Groups' do ...@@ -134,7 +134,7 @@ describe 'Admin Groups' do
end end
describe 'add user into a group', :js do describe 'add user into a group', :js do
shared_context 'adds user into a group' do shared_examples 'adds user into a group' do
it do it do
visit admin_group_path(group) visit admin_group_path(group)
......
...@@ -62,7 +62,7 @@ describe Gitlab::Metrics::Dashboard::Processor do ...@@ -62,7 +62,7 @@ describe Gitlab::Metrics::Dashboard::Processor do
'metric_a1', # group priority 1, panel weight 1 'metric_a1', # group priority 1, panel weight 1
project_business_metric.id, # group priority 0, panel weight nil (0) project_business_metric.id, # group priority 0, panel weight nil (0)
project_response_metric.id, # group priority -5, panel weight nil (0) project_response_metric.id, # group priority -5, panel weight nil (0)
project_system_metric.id, # group priority -10, panel weight nil (0) project_system_metric.id # group priority -10, panel weight nil (0)
] ]
actual_metrics_order = all_metrics.map { |m| m[:id] || m[:metric_id] } actual_metrics_order = all_metrics.map { |m| m[:id] || m[:metric_id] }
......
...@@ -18,7 +18,7 @@ describe 'Marginalia spec' do ...@@ -18,7 +18,7 @@ describe 'Marginalia spec' do
end end
end end
class MarginaliaTestMailer < BaseMailer class MarginaliaTestMailer < ApplicationMailer
def first_user def first_user
User.first User.first
end end
......
...@@ -11,10 +11,8 @@ describe MergeRequests::CreateFromIssueService do ...@@ -11,10 +11,8 @@ describe MergeRequests::CreateFromIssueService do
let(:milestone_id) { create(:milestone, project: project).id } let(:milestone_id) { create(:milestone, project: project).id }
let(:issue) { create(:issue, project: project, milestone_id: milestone_id) } let(:issue) { create(:issue, project: project, milestone_id: milestone_id) }
let(:custom_source_branch) { 'custom-source-branch' } let(:custom_source_branch) { 'custom-source-branch' }
let(:service) { described_class.new(project, user, service_params) }
subject(:service) { described_class.new(project, user, service_params) } let(:service_with_custom_source_branch) { described_class.new(project, user, branch_name: custom_source_branch, **service_params) }
subject(:service_with_custom_source_branch) { described_class.new(project, user, branch_name: custom_source_branch, **service_params) }
before do before do
project.add_developer(user) project.add_developer(user)
......
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