Commit f3faf32e authored by Robert Speicher's avatar Robert Speicher

Auto-correct EE-only offenses for Layout/TrailingWhitespace

parent 1ce6142c
class Projects::PushRulesController < Projects::ApplicationController
include RepositorySettingsRedirect
# Authorize
before_action :authorize_admin_project!
before_action :check_push_rules_available!
......
......@@ -3,7 +3,7 @@ if Rails.env.test?
def pid
render plain: Process.pid.to_s
end
def kill
Process.kill(params[:signal], Process.pid)
render plain: 'Bye!'
......
......@@ -3,7 +3,7 @@ class AdminEmailsWorker
include DedicatedSidekiqQueue
def perform(recipient_id, subject, body)
recipient_list(recipient_id).pluck(:id).uniq.each do |user_id|
recipient_list(recipient_id).pluck(:id).uniq.each do |user_id|
Notify.send_admin_notification(user_id, subject, body).deliver_later
end
end
......
......@@ -56,7 +56,7 @@ class Spinach::Features::AdminLicense < Spinach::FeatureSteps
license = build(:gitlab_license)
File.write(path, license.export)
attach_file 'license_data_file', path
click_button "Upload license"
end
......
module Audit
class Details
ACTIONS = %i[add remove failed_login change].freeze
def self.humanize(*args)
new(*args).humanize
end
def initialize(details)
@details = details
end
def humanize
if @details[:with]
"Signed in with #{@details[:with].upcase} authentication"
......@@ -17,9 +17,9 @@ module Audit
action_text
end
end
private
def action_text
action = @details.slice(*ACTIONS)
value = @details.values.first.tr('_', ' ')
......
......@@ -127,7 +127,7 @@ module Gitlab
def send_artifacts_entry(build, entry)
file = build.artifacts_file
archive =
archive =
if file.file_storage?
file.path
else
......
......@@ -122,7 +122,7 @@ describe Projects::IssuesController do
_ = issue2
perform :get, :index, weight: 1
expect(response).to have_http_status(200)
expect(assigns(:issues)).to eq([issue2])
end
......
......@@ -9,7 +9,7 @@ describe Projects::PushRulesController do
sign_in(user)
end
describe '#update' do
def do_update
patch :update, namespace_id: project.namespace, project_id: project, id: 1, push_rule: { prevent_secrets: true }
......
......@@ -39,7 +39,7 @@ describe Gitlab::OAuth::User do
{ provider: 'ldapmain', extern_uid: "uid=#{uid},#{base_dn}" },
{ provider: 'kerberos', extern_uid: uid + '@' + realm }
)
expect(gl_user.email).to eq(real_email)
end
end
......
......@@ -55,7 +55,7 @@ describe SshHostKey do
expected = [key1, key2]
.map { |data| Gitlab::KeyFingerprint.new(data) }
.each_with_index
.map { |key, i| { bits: key.bits, fingerprint: key.fingerprint, type: key.type, index: i } }
.map { |key, i| { bits: key.bits, fingerprint: key.fingerprint, type: key.type, index: i } }
expect(ssh_host_key.fingerprints.as_json).to eq(expected)
end
......
......@@ -7,7 +7,7 @@ FactoryGirl.define do
end
source_job factory: :ci_build
pipeline factory: :ci_empty_pipeline
end
end
......@@ -171,7 +171,7 @@ feature 'Project mirror', js: true do
click_without_sidekiq 'Save changes'
expect(page).to have_content(key.fingerprint)
expect(page).to have_content("Verified by #{h(user.name)} less than a minute ago")
expect(page).to have_content("Verified by #{h(user.name)} less than a minute ago")
end
end
end
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Audit::Details do
let(:user) { create(:user) }
describe '.humanize' do
context 'user' do
let(:login_action) do
......@@ -13,12 +13,12 @@ describe Audit::Details do
target_details: user.name
}
end
it 'humanizes user login action' do
expect(described_class.humanize(login_action)).to eq('Signed in with LDAP authentication')
end
end
context 'project' do
let(:user_member) { create(:user) }
let(:project) { create(:project) }
......@@ -33,12 +33,12 @@ describe Audit::Details do
target_details: member.user.name
}
end
it 'humanizes add project member access action' do
expect(described_class.humanize(member_access_action)).to eq('Added user access as Developer')
end
end
context 'group' do
let(:user_member) { create(:user) }
let(:group) { create(:group) }
......@@ -54,12 +54,12 @@ describe Audit::Details do
target_details: member.user.name
}
end
it 'humanizes add group member access action' do
expect(described_class.humanize(member_access_action)).to eq('Changed access level from Guest to Owner')
end
end
context 'deploy key' do
let(:removal_action) do
{
......
......@@ -2,10 +2,10 @@ require 'spec_helper'
describe Gitlab::PaginationDelegate do
context 'no data' do
let(:delegate) do
let(:delegate) do
described_class.new(page: 1,
per_page: 10,
count: 0)
count: 0)
end
it 'shows the correct total count' do
......@@ -46,10 +46,10 @@ describe Gitlab::PaginationDelegate do
end
context 'with data' do
let(:delegate) do
let(:delegate) do
described_class.new(page: 5,
per_page: 100,
count: 1000)
count: 1000)
end
it 'shows the correct total count' do
......@@ -90,10 +90,10 @@ describe Gitlab::PaginationDelegate do
end
context 'last page' do
let(:delegate) do
let(:delegate) do
described_class.new(page: 10,
per_page: 100,
count: 1000)
count: 1000)
end
it 'shows the correct total count' do
......
......@@ -7,7 +7,7 @@ describe Ci::Sources::Pipeline do
it { is_expected.to belong_to(:source_project) }
it { is_expected.to belong_to(:source_job) }
it { is_expected.to belong_to(:source_pipeline) }
it { is_expected.to validate_presence_of(:project) }
it { is_expected.to validate_presence_of(:pipeline) }
......
......@@ -32,7 +32,7 @@ describe 'gitlab:artifacts namespace rake task' do
stub_artifacts_object_storage
job
end
it "migrates file to remote storage" do
subject
......
......@@ -18,7 +18,7 @@ describe ArtifactUploader do
describe '.artifacts_upload_path' do
subject { described_class.artifacts_upload_path }
it { is_expected.to start_with(local_path) }
it { is_expected.to end_with('tmp/uploads/') }
end
......@@ -35,7 +35,7 @@ describe ArtifactUploader do
context 'when using remote storage' do
let(:store) { described_class::REMOTE_STORE }
before do
stub_artifacts_object_storage
end
......
......@@ -133,7 +133,7 @@ describe ObjectStoreUploader do
let(:job) { create(:ci_build, :artifacts, artifacts_file_store: store) }
let(:uploader) { job.artifacts_file }
let(:store) { described_class::LOCAL_STORE }
subject { uploader.migrate!(new_store) }
context 'when using the same storage' do
......@@ -149,7 +149,7 @@ describe ObjectStoreUploader do
context 'when migrating to local storage' do
let(:store) { described_class::REMOTE_STORE }
let(:new_store) { described_class::LOCAL_STORE }
before do
stub_artifacts_object_storage
end
......@@ -173,10 +173,10 @@ describe ObjectStoreUploader do
it "file does exist" do
expect(File.exist?(current_path)).to eq(true)
end
context 'when storage is disabled' do
before do
stub_artifacts_object_storage(enabled: false)
stub_artifacts_object_storage(enabled: false)
end
it "to raise an error" do
......@@ -198,7 +198,7 @@ describe ObjectStoreUploader do
it "does delete original file" do
subject
expect(File.exist?(current_path)).to eq(false)
end
......
......@@ -74,7 +74,7 @@ describe UpdateAllMirrorsWorker do
def schedule_mirrors!(capacity:)
allow(Gitlab::Mirror).to receive_messages(available_capacity: capacity)
Sidekiq::Testing.fake! do
Sidekiq::Testing.fake! do
worker.schedule_mirrors!
end
end
......
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