Commit cebfe79a authored by Rémy Coutable's avatar Rémy Coutable

[EE] Address offenses to the Layout/ExtraSpacing cop

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a7dfb619
......@@ -6,7 +6,7 @@
= render "layouts/init_client_detection_flags"
= render 'peek/bar'
= header_message
= render partial: "layouts/header/default", locals: { project: @project, group: @group }
= render partial: "layouts/header/default", locals: { project: @project, group: @group }
= render 'layouts/page', sidebar: sidebar, nav: nav
= footer_message
......
......@@ -7,7 +7,7 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
Settings.ldap['sync_time'] = 3600 if Settings.ldap['sync_time'].nil?
Settings.ldap['schedule_sync_daily'] = 1 if Settings.ldap['schedule_sync_daily'].nil?
Settings.ldap['schedule_sync_hour'] = 1 if Settings.ldap['schedule_sync_hour'].nil?
Settings.ldap['schedule_sync_minute'] = 30 if Settings.ldap['schedule_sync_minute'].nil?
Settings.ldap['schedule_sync_minute'] = 30 if Settings.ldap['schedule_sync_minute'].nil?
# backwards compatibility, we only have one host
if Settings.ldap['enabled'] || Rails.env.test?
......
......@@ -49,7 +49,7 @@ module EE
url_helper :user_group_saml_omniauth_metadata
def user_group_saml_omniauth_metadata_path(group)
params = { group_path: group.path, token: group.saml_discovery_token }
params = { group_path: group.path, token: group.saml_discovery_token }
path = '/users/auth/group_saml/metadata'
ActionDispatch::Http::URL.path_for(path: path, params: params)
......
# frozen_string_literal: true
class Approver < ActiveRecord::Base
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :user
include ApproverMigrateHook
......
# frozen_string_literal: true
class ApproverGroup < ActiveRecord::Base
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :target, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :group
include ApproverMigrateHook
......
......@@ -59,7 +59,7 @@ class DraftNote < ActiveRecord::Base
end
def type
return 'DiffNote' if on_diff?
return 'DiffNote' if on_diff?
return 'DiscussionNote' if discussion_id.present?
'Note'
......
......@@ -9,10 +9,10 @@ module EE
cache_markdown_field :footer_message, pipeline: :broadcast_message
validates :message_background_color, allow_blank: true, color: true
validates :message_font_color, allow_blank: true, color: true
validates :message_font_color, allow_blank: true, color: true
default_value_for :message_background_color, '#E75E40'
default_value_for :message_font_color, '#FFFFFF'
default_value_for :message_font_color, '#FFFFFF'
end
def show_header?
......
......@@ -248,7 +248,7 @@ module EE
def to_reference(from = nil, full: false)
reference = "#{self.class.reference_prefix}#{iid}"
return reference unless (cross_reference?(from) && !group.projects.include?(from)) || full
return reference unless (cross_reference?(from) && !group.projects.include?(from)) || full
"#{group.full_path}#{reference}"
end
......
......@@ -31,7 +31,7 @@ module EE
has_many :epics, foreign_key: :author_id
has_many :assigned_epics, foreign_key: :assignee_id, class_name: "Epic"
has_many :path_locks, dependent: :destroy # rubocop: disable Cop/ActiveRecordDependent
has_many :vulnerability_feedback, foreign_key: :author_id, class_name: 'Vulnerabilities::Feedback'
has_many :vulnerability_feedback, foreign_key: :author_id, class_name: 'Vulnerabilities::Feedback'
has_many :approvals, dependent: :destroy # rubocop: disable Cop/ActiveRecordDependent
has_many :approvers, dependent: :destroy # rubocop: disable Cop/ActiveRecordDependent
......
......@@ -285,7 +285,7 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
# @see REGISTRY_TYPES
def should_be_redownloaded?(type)
ensure_valid_type!(type)
return true if public_send("force_to_redownload_#{type}") # rubocop:disable GitlabSecurity/PublicSend
return true if public_send("force_to_redownload_#{type}") # rubocop:disable GitlabSecurity/PublicSend
retry_count(type) > RETRIES_BEFORE_REDOWNLOAD
end
......
......@@ -127,7 +127,7 @@ class GeoNode < ActiveRecord::Base
end
def url=(value)
value += '/' if value.present? && !value.end_with?('/')
value += '/' if value.present? && !value.end_with?('/')
write_attribute(:url, value)
......@@ -280,7 +280,7 @@ class GeoNode < ActiveRecord::Base
errors.add(:url, 'scheme must be http or https')
end
rescue URI::InvalidURIError
errors.add(:url, 'is invalid')
errors.add(:url, 'is invalid')
end
def update_clone_url
......
......@@ -31,7 +31,7 @@ module EE
# select projects which have allowed number of shared runner minutes or are public
super
.where("projects.visibility_level=? OR (#{builds_check_limit.to_sql})=1", # rubocop:disable GitlabSecurity/SqlInjection
.where("projects.visibility_level=? OR (#{builds_check_limit.to_sql})=1", # rubocop:disable GitlabSecurity/SqlInjection
::Gitlab::VisibilityLevel::PUBLIC)
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -39,7 +39,7 @@
- mr_created_count = @events.merge_requests.created.count
- mr_merged_count = @events.merge_requests.merged.count
- if mr_created_count > 0 || mr_merged_count > 0
= _('<strong>%{created_count}</strong> created, <strong>%{accepted_count}</strong> accepted.').html_safe % { created_count: mr_created_count, accepted_count: mr_merged_count }
= _('<strong>%{created_count}</strong> created, <strong>%{accepted_count}</strong> accepted.').html_safe % { created_count: mr_created_count, accepted_count: mr_merged_count }
- else
= _('No merge requests for the selected time period.')
......
- breadcrumb_title _("Security Dashboard")
- page_title _("Security Dashboard")
- page_title _("Security Dashboard")
#js-group-security-dashboard{ data: { vulnerabilities_endpoint: group_security_vulnerabilities_path(@group),
vulnerabilities_summary_endpoint: summary_group_security_vulnerabilities_path(@group),
......
......@@ -6,4 +6,4 @@
"error-state-svg-path" => image_path('illustrations/feature_flag.svg'),
"feature-flags-help-page-path" => help_page_path("user/project/operations/feature_flags"),
"can-user-admin-feature-flag" => can?(current_user, :admin_feature_flag, @project),
"new-feature-flag-path" => can?(current_user, :create_feature_flag, @project) ? new_project_feature_flag_path(@project): nil } }
"new-feature-flag-path" => can?(current_user, :create_feature_flag, @project) ? new_project_feature_flag_path(@project): nil } }
......@@ -14,7 +14,7 @@
%a.btn.btn-default.append-right-10{ href: project_path(template), rel: 'noopener noreferrer', target: '_blank' }
= _('Preview')
%label.btn.btn-success.custom-template-button.choose-template.append-bottom-0{ for: template.name }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name }
%span
= _('Use template')
......
......@@ -33,7 +33,7 @@
%a.btn.btn-default.append-right-10{ href: project_path(project), rel: 'noopener noreferrer', target: '_blank' }
= _('Preview')
%label.btn.btn-success.custom-template-button.choose-template.append-bottom-0{ for: project.name }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: project.name, value: project.name, data: { subgroup_id: project.namespace_id } }
%input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: project.name, value: project.name, data: { subgroup_id: project.namespace_id } }
%span.qa-use-template-button
= _('Use template')
......
......@@ -20,7 +20,7 @@ class AddFeatureFlagsToProjects < ActiveRecord::Migration[4.2]
t.index [:project_id, :name], unique: true
end
create_table :operations_feature_flags_clients, id: :bigserial do |t|
create_table :operations_feature_flags_clients, id: :bigserial do |t|
t.integer :project_id, null: false
t.string :token, null: false
......
......@@ -6,7 +6,7 @@ class CreateVulnerabilityOccurrences < ActiveRecord::Migration[4.2]
DOWNTIME = false
def change
create_table :vulnerability_occurrences, id: :bigserial do |t|
create_table :vulnerability_occurrences, id: :bigserial do |t|
t.timestamps_with_timezone null: false
t.integer :severity, null: false, limit: 2
......
......@@ -9,7 +9,7 @@ class RecreateVulnerabilityOccurrencesAndVulnerabilityOccurrenceIdentifiers < Ac
drop_table :vulnerability_occurrence_identifiers
drop_table :vulnerability_occurrences
create_table :vulnerability_occurrences, id: :bigserial do |t|
create_table :vulnerability_occurrences, id: :bigserial do |t|
t.timestamps_with_timezone null: false
t.integer :severity, null: false, limit: 2
......@@ -62,7 +62,7 @@ class RecreateVulnerabilityOccurrencesAndVulnerabilityOccurrenceIdentifiers < Ac
drop_table :vulnerability_occurrence_identifiers
drop_table :vulnerability_occurrences
create_table :vulnerability_occurrences, id: :bigserial do |t|
create_table :vulnerability_occurrences, id: :bigserial do |t|
t.timestamps_with_timezone null: false
t.integer :severity, null: false, limit: 2
......
......@@ -7,7 +7,7 @@ class ChangeVulnOccurrenceColumns < ActiveRecord::Migration[4.2]
drop_table :vulnerability_occurrence_identifiers
drop_table :vulnerability_occurrences
create_table :vulnerability_occurrences, id: :bigserial do |t|
create_table :vulnerability_occurrences, id: :bigserial do |t|
t.timestamps_with_timezone null: false
t.integer :severity, null: false, limit: 2
......@@ -59,7 +59,7 @@ class ChangeVulnOccurrenceColumns < ActiveRecord::Migration[4.2]
drop_table :vulnerability_occurrence_identifiers
drop_table :vulnerability_occurrences
create_table :vulnerability_occurrences, id: :bigserial do |t|
create_table :vulnerability_occurrences, id: :bigserial do |t|
t.timestamps_with_timezone null: false
t.integer :severity, null: false, limit: 2
......
......@@ -27,7 +27,7 @@ module API
requires :id, type: String, desc: 'The ID of a project'
end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc 'Get project software license policies' do
success Entities::ManagedLicense
end
......
......@@ -350,7 +350,7 @@ module EE
number_to_percentage(node.repositories_synced_in_percentage, precision: 2)
end
expose :wikis_count # Deprecated
expose :wikis_count # Deprecated
expose :wikis_failed_count
expose :wikis_synced_count
expose :wikis_synced_in_percentage do |node|
......
......@@ -84,7 +84,7 @@ module EE
}
results = count(::Ci::Build.where(name: types.keys).group(:name), fallback: Hash.new(-1))
results.each_with_object({}) { |(key, value), response| response[types[key.to_sym]] = value }
results.each_with_object({}) { |(key, value), response| response[types[key.to_sym]] = value }
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -31,7 +31,7 @@ namespace :gitlab do
end
desc "GitLab | Elasticsearch | Index project repositories"
task index_repositories: :environment do
task index_repositories: :environment do
print "Indexing project repositories..."
Sidekiq::Logging.logger = Logger.new(STDOUT)
......@@ -41,7 +41,7 @@ namespace :gitlab do
end
desc "GitLab | Elasticsearch | Index wiki repositories"
task index_wikis: :environment do
task index_wikis: :environment do
projects = apply_project_filters(Project.with_wiki_enabled)
projects.find_each do |project|
......
......@@ -278,7 +278,7 @@ describe Groups::EpicsController do
group.add_developer(user)
end
context 'with correct basic params' do
context 'with correct basic params' do
it 'returns status 200' do
update_epic(epic, params)
......
......@@ -246,7 +246,7 @@ describe Groups::Security::VulnerabilitiesController do
end
describe 'GET history.json' do
subject { get :history, params: { group_id: group }, format: :json }
subject { get :history, params: { group_id: group }, format: :json }
context 'when security dashboard feature is disabled' do
before do
......@@ -350,7 +350,7 @@ describe Groups::Security::VulnerabilitiesController do
it 'returns filtered history if filters are enabled' do
travel_to(Time.zone.parse('2019-02-10')) do
get :history, params: { group_id: group, report_type: %w[dependency_scanning sast] }, format: :json
get :history, params: { group_id: group, report_type: %w[dependency_scanning sast] }, format: :json
end
expect(response).to have_gitlab_http_status(200)
......
......@@ -251,7 +251,7 @@ describe Projects::IssuesController do
end
describe 'GET #discussions' do
let(:issue) { create(:issue, project: project) }
let(:issue) { create(:issue, project: project) }
let!(:discussion) { create(:discussion_note_on_issue, noteable: issue, project: issue.project) }
context 'with a related system note' do
......
......@@ -5,7 +5,7 @@ describe UnsubscribesController do
describe "show" do
it "responds with success" do
get :show, params: { email: Base64.urlsafe_encode64('me@example.com') }
get :show, params: { email: Base64.urlsafe_encode64('me@example.com') }
assert_response :success
end
......
......@@ -46,7 +46,7 @@ FactoryBot.define do
trait :repository_sync_failed do
sync_failed
last_wiki_successful_sync_at { 5.days.ago }
last_wiki_successful_sync_at { 5.days.ago }
resync_wiki false
wiki_retry_count nil
end
......
......@@ -8,7 +8,7 @@ FactoryBot.define do
factory :vulnerabilities_occurrence, class: Vulnerabilities::Occurrence do
name 'Cipher with no integrity'
project
sequence(:uuid) { generate(:vulnerability_occurrence_uuid) }
sequence(:uuid) { generate(:vulnerability_occurrence_uuid) }
project_fingerprint { generate(:project_fingerprint) }
primary_identifier factory: :vulnerabilities_identifier
location_fingerprint '4e5b6966dd100170b4b1ad599c7058cce91b57b4'
......
......@@ -2,8 +2,8 @@ require 'rails_helper'
describe 'Manually create a todo item from epic', :js do
let(:group) { create(:group) }
let(:epic) { create(:epic, group: group) }
let(:user) { create(:user)}
let(:epic) { create(:epic, group: group) }
let(:user) { create(:user)}
before do
stub_licensed_features(epics: true)
......
......@@ -3,8 +3,8 @@ require 'spec_helper'
describe 'Edit group settings' do
include Select2Helper
let(:user) { create(:user) }
let(:developer) { create(:user) }
let(:user) { create(:user) }
let(:developer) { create(:user) }
let(:group) { create(:group, path: 'foo') }
before do
......
......@@ -6,7 +6,7 @@ describe 'Issues csv' do
let(:milestone) { create(:milestone, title: 'v1.0', project: project) }
let(:idea_label) { create(:label, project: project, title: 'Idea') }
let(:feature_label) { create(:label, project: project, title: 'Feature', priority: 10) }
let!(:issue) { create(:issue, project: project, author: user) }
let!(:issue) { create(:issue, project: project, author: user) }
before do
sign_in(user)
......
......@@ -47,7 +47,7 @@ describe 'Pipeline', :js do
end
describe 'GET /:project/pipelines/:id/licenses' do
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
let(:pipeline) { create(:ci_pipeline, project: project, ref: 'master', sha: project.commit.id) }
before do
stub_licensed_features(license_management: true)
......
......@@ -7,7 +7,7 @@ describe 'Promotions', :js do
let(:group) { create(:group) }
let(:project) { create(:project, :repository, namespace: group) }
let(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 7.days.from_now) }
let!(:issue) { create(:issue, project: project, author: user) }
let!(:issue) { create(:issue, project: project, author: user) }
let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) }
describe 'if you have a license' do
......
require 'spec_helper'
describe EpicsFinder do
let(:user) { create(:user) }
let(:search_user) { create(:user) }
let(:user) { create(:user) }
let(:search_user) { create(:user) }
let(:group) { create(:group, :private) }
let(:another_group) { create(:group) }
let!(:epic1) { create(:epic, :opened, group: group, title: 'This is awesome epic', created_at: 1.week.ago) }
......
......@@ -109,7 +109,7 @@ describe Gitlab::Auth::Smartcard::Certificate do
context 'avoids conflicting namespaces' do
let(:subject_dn) { '/CN=Gitlab User/emailAddress=gitlab-user@random-corp.org' }
let!(:existing_user) { create(:user, username: 'GitlabUser') }
let!(:existing_user) { create(:user, username: 'GitlabUser') }
it 'creates user with correct usnername' do
expect { subject }.to change { User.count }.from(1).to(2)
......
......@@ -8,7 +8,7 @@ describe Gitlab::Auth do
password: password,
password_confirmation: password)
end
let(:username) { 'John' } # username isn't lowercase, test this
let(:username) { 'John' } # username isn't lowercase, test this
let(:password) { 'my-secret' }
context 'with kerberos' do
......
......@@ -11,7 +11,7 @@ describe Gitlab::Elastic::Indexer do
let(:project) { create(:project, :repository) }
let(:from_sha) { Gitlab::Git::BLANK_SHA }
let(:to_sha) { project.commit.try(:sha) }
let(:indexer) { described_class.new(project) }
let(:indexer) { described_class.new(project) }
let(:popen_success) { [[''], 0] }
let(:popen_failure) { [['error'], 1] }
......
......@@ -26,7 +26,7 @@ describe Gitlab::GitAccessWiki do
context 'when wiki is disabled' do
let(:user) { :geo }
let(:project) { create(:project, :private, :wiki_repo, wiki_access_level: ProjectFeature::DISABLED) }
let(:authentication_abilities) { [:download_code] }
let(:authentication_abilities) { [:download_code] }
subject { access.check('git-upload-pack', changes) }
......
......@@ -9,8 +9,8 @@ describe SystemCheck::Geo::HTTPCloneEnabledCheck do
['unknown', false],
['ssh', false],
['http', true],
['', true],
[nil, true]
['', true],
[nil, true]
]
end
......
......@@ -6,7 +6,7 @@ require Rails.root.join('db', 'post_migrate', '20180723130817_delete_inconsisten
describe DeleteInconsistentInternalIdRecords, :migration do
context 'for milestones (by group)' do
# milestones (by group) is a little different than most of the other models
let(:groups) { table(:namespaces) }
let(:groups) { table(:namespaces) }
let(:group1) { groups.create(name: 'Group 1', type: 'Group', path: 'group_1') }
let(:group2) { groups.create(name: 'Group 2', type: 'Group', path: 'group_2') }
let(:group3) { groups.create(name: 'Group 2', type: 'Group', path: 'group_3') }
......
......@@ -4,7 +4,7 @@ require Rails.root.join('ee', 'db', 'post_migrate', '20180502130136_migrate_mirr
describe MigrateMirrorAttributesDataFromProjectsToImportState, :migration do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:import_state) { table(:project_mirror_data) }
let(:import_state) { table(:project_mirror_data) }
describe '#up' do
before do
......
......@@ -51,7 +51,7 @@ describe ApplicationSetting do
it { is_expected.to allow_value('').for(:external_auth_client_key) }
context 'when setting a valid client certificate for external authorization' do
let(:certificate_data) { File.read('ee/spec/fixtures/passphrase_x509_certificate.crt') }
let(:certificate_data) { File.read('ee/spec/fixtures/passphrase_x509_certificate.crt') }
before do
setting.external_auth_client_cert = certificate_data
......
......@@ -40,7 +40,7 @@ describe Ci::Bridge do
end
context 'when trigger does not have project defined' do
let(:options) { { trigger: {} } }
let(:options) { { trigger: {} } }
it 'returns nil' do
expect(bridge.target_project_path).to be_nil
......
......@@ -43,7 +43,7 @@ describe Environment do
context 'when the environment is protected' do
before do
create(:protected_environment, name: environment.name, project: project)
create(:protected_environment, name: environment.name, project: project)
end
it { is_expected.to be_truthy }
......
......@@ -584,7 +584,7 @@ describe Epic do
end
context 'mentioning other objects' do
let(:group) { create(:group) }
let(:group) { create(:group) }
let(:epic) { create(:epic, group: group) }
let(:project) { create(:project, :repository, :public) }
......
......@@ -4,7 +4,7 @@ describe 'Every Geo event' do
subject { events }
it 'includes Geo::Eventable' do
is_expected.to all( satisfy { |klass| klass.ancestors.include?(Geo::Eventable) })
is_expected.to all( satisfy { |klass| klass.ancestors.include?(Geo::Eventable) })
end
it 'has its class in Geo::EventLog::EVENT_CLASSES' do
......
......@@ -3,7 +3,7 @@ require 'spec_helper'
describe GeoNodeStatus, :geo do
include ::EE::GeoHelpers
let!(:primary) { create(:geo_node, :primary) }
let!(:primary) { create(:geo_node, :primary) }
let!(:secondary) { create(:geo_node) }
let!(:group) { create(:group) }
......@@ -857,7 +857,7 @@ describe GeoNodeStatus, :geo do
end
describe '#revision' do
it { expect(status.revision).to eq(Gitlab.revision) }
it { expect(status.revision).to eq(Gitlab.revision) }
end
describe '#[]' do
......
......@@ -1425,7 +1425,7 @@ describe Project do
let(:secondary_base_host) { 'secondary.geo' }
let(:secondary_base_url) { "http://#{secondary_base_host}" }
let(:secondary_node) { create(:geo_node, url: secondary_base_url) }
let(:secondary_url) { "#{secondary_base_url}#{project_path}" }
let(:secondary_url) { "#{secondary_base_url}#{project_path}" }
before do
stub_current_geo_node(secondary_node)
......
......@@ -190,7 +190,7 @@ describe API::EpicIssues do
context 'when epic_issue association does not include the epic in the url' do
before do
other_group = create(:group)
other_group_epic = create(:epic, group: other_group)
other_group_epic = create(:epic, group: other_group)
epic_issue.update_attribute(:epic, other_group_epic)
group.add_developer(user)
......
......@@ -112,7 +112,7 @@ describe API::GeoNodes, :geo, :prometheus, api: true do
expect(response).to match_response_schema('public_api/v4/geo_node_status', dir: 'ee')
end
it 'shows the database-held response if current node status exists in the database, but not redis' do
it 'shows the database-held response if current node status exists in the database, but not redis' do
stub_current_geo_node(secondary)
expect(GeoNodeStatus).to receive(:fast_current_node_status).and_return(nil)
......
require 'spec_helper'
describe API::LdapGroupLinks, api: true do
describe API::LdapGroupLinks, api: true do
include ApiHelpers
let(:owner) { create(:user) }
......
require 'spec_helper'
describe API::License, api: true do
describe API::License, api: true do
include ApiHelpers
let(:gl_license) { build(:gitlab_license) }
......
......@@ -7,7 +7,7 @@ describe API::MergeRequests do
let(:user) { create(:user) }
let!(:project) { create(:project, :public, :repository, creator: user, namespace: user.namespace, only_allow_merge_if_pipeline_succeeds: false) }
let(:milestone) { create(:milestone, title: '1.0.0', project: project) }
let(:milestone1) { create(:milestone, title: '0.9', project: project) }
let(:milestone1) { create(:milestone, title: '0.9', project: project) }
let!(:merge_request) { create(:merge_request, :simple, milestone: milestone1, author: user, assignee: user, source_project: project, target_project: project, title: "Test", created_at: base_time) }
let!(:label) do
create(:label, title: 'label', color: '#FFAABB', project: project)
......
require 'spec_helper'
describe API::ProjectPushRule, 'ProjectPushRule', api: true do
describe API::ProjectPushRule, 'ProjectPushRule', api: true do
include ApiHelpers
let(:user) { create(:user) }
let(:user3) { create(:user) }
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe SmartcardController, type: :request do
describe SmartcardController, type: :request do
let(:subject_dn) { '/O=Random Corp Ltd/CN=gitlab-user/emailAddress=gitlab-user@random-corp.org' }
let(:issuer_dn) { '/O=Random Corp Ltd/CN=Random Corp' }
let(:certificate_headers) { { 'X-SSL-CLIENT-CERTIFICATE': 'certificate' } }
......
require 'spec_helper'
describe EpicEntity do
let(:group) { create(:group) }
let(:group) { create(:group) }
let(:resource) { create(:epic, group: group) }
let(:user) { create(:user) }
......@@ -10,7 +10,7 @@ describe EpicEntity do
subject { described_class.new(resource, request: request).as_json }
it 'has Issuable attributes' do
expect(subject).to include(:id, :iid, :description, :title, :labels)
expect(subject).to include(:id, :iid, :description, :title, :labels)
end
it 'has epic specific attributes' do
......
......@@ -6,14 +6,14 @@ describe Boards::Issues::ListService, services: true do
let(:group) { create(:group) }
let(:project) { create(:project, :empty_repo, namespace: group) }
let(:project1) { create(:project, :empty_repo, namespace: group) }
let(:board) { create(:board, group: group) }
let(:board) { create(:board, group: group) }
let(:m1) { create(:milestone, group: group) }
let(:m2) { create(:milestone, group: group) }
let(:bug) { create(:group_label, group: group, name: 'Bug') }
let(:development) { create(:group_label, group: group, name: 'Development') }
let(:testing) { create(:group_label, group: group, name: 'Testing') }
let(:testing) { create(:group_label, group: group, name: 'Testing') }
let(:p1) { create(:group_label, title: 'P1', group: group) }
let(:p2) { create(:group_label, title: 'P2', group: group) }
......
......@@ -27,7 +27,7 @@ describe Boards::Issues::MoveService, services: true do
end
context 'from label to milestone list' do
let(:issue) { create(:labeled_issue, project: project, labels: [bug, development]) }
let(:issue) { create(:labeled_issue, project: project, labels: [bug, development]) }
it 'assigns the milestone and keeps labels' do
params = { board_id: board1.id, from_list_id: label_list1.id, to_list_id: milestone_list1.id }
......@@ -203,7 +203,7 @@ describe Boards::Issues::MoveService, services: true do
let(:bug) { create(:label, project: project, name: 'Bug') }
let(:development) { create(:label, project: project, name: 'Development') }
let(:testing) { create(:label, project: project, name: 'Testing') }
let(:testing) { create(:label, project: project, name: 'Testing') }
let(:regression) { create(:label, project: project, name: 'Regression') }
before do
......@@ -226,7 +226,7 @@ describe Boards::Issues::MoveService, services: true do
let(:bug) { create(:group_label, group: group, name: 'Bug') }
let(:development) { create(:group_label, group: group, name: 'Development') }
let(:testing) { create(:group_label, group: group, name: 'Testing') }
let(:testing) { create(:group_label, group: group, name: 'Testing') }
let(:regression) { create(:group_label, group: group, name: 'Regression') }
before do
......
......@@ -88,7 +88,7 @@ describe Epics::UpdateService do
end
context 'adding a label' do
let(:label) { create(:group_label, group: group) }
let(:label) { create(:group_label, group: group) }
let(:user2) { create(:user) }
let!(:todo1) do
create(:todo, :mentioned, :pending,
......
......@@ -4,7 +4,7 @@ describe Geo::FileDownloadService do
include ::EE::GeoHelpers
include ExclusiveLeaseHelpers
set(:primary) { create(:geo_node, :primary) }
set(:primary) { create(:geo_node, :primary) }
set(:secondary) { create(:geo_node) }
before do
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Geo::RepositoryUpdatedEventStore do
include EE::GeoHelpers
set(:project) { create(:project, :repository) }
set(:project) { create(:project, :repository) }
set(:secondary_node) { create(:geo_node) }
let(:blankrev) { Gitlab::Git::BLANK_SHA }
......
......@@ -14,7 +14,7 @@ describe Projects::GitlabProjectsImportService do
end
describe '#execute' do
context 'creates export job' do
context 'creates export job' do
it 'if project saved and custom template exists' do
expect(custom_template).to receive(:add_export_job)
......
......@@ -28,7 +28,7 @@ describe Projects::SlackApplicationInstallService do
result = service.execute
expect(result).to eq(message: 'Slack: something is wrong', status: :error)
expect(result).to eq(message: 'Slack: something is wrong', status: :error)
end
it 'returns success result and creates all the needed records' do
......
......@@ -20,7 +20,7 @@ describe TodoService do
let(:description_directly_addressed) { "#{mentions}\n- [ ] Task 1\n- [ ] Task 2" }
let(:group) { create(:group) }
let(:epic) { create(:epic, group: group, author: author, description: description_mentions) }
let(:epic) { create(:epic, group: group, author: author, description: description_mentions) }
let(:todos_for) { [] }
let(:todos_not_for) { [] }
......
require 'spec_helper'
describe Users::MigrateToGhostUserService do
context 'epics' do
context 'epics' do
let!(:user) { create(:user) }
let(:service) { described_class.new(user) }
......@@ -20,7 +20,7 @@ describe Users::MigrateToGhostUserService do
end
end
context 'vulnerability_feedback' do
context 'vulnerability_feedback' do
let!(:user) { create(:user) }
let(:service) { described_class.new(user) }
......
......@@ -37,7 +37,7 @@ namespace :gitlab do
end
desc "GitLab | Cleanup | Delete moved repositories"
task moved: :gitlab_environment do
task moved: :gitlab_environment do
warn_user_is_not_gitlab
remove_flag = ENV['REMOVE']
......
......@@ -3,7 +3,7 @@
module QA
context 'Create' do
describe 'batch comments in merge request' do
it 'user submits, discards batch comments' do
it 'user submits, discards batch comments' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
......
......@@ -7,8 +7,8 @@ describe 'Issue Boards', :js do
let(:group) { create(:group, :nested) }
let(:project) { create(:project, :public, namespace: group) }
let(:milestone) { create(:milestone, title: "v2.2", project: project) }
let!(:board) { create(:board, project: project) }
let!(:board_with_milestone) { create(:board, project: project, milestone: milestone) }
let!(:board) { create(:board, project: project) }
let!(:board_with_milestone) { create(:board, project: project, milestone: milestone) }
let(:user) { create(:user) }
let!(:user2) { create(:user) }
......
......@@ -106,7 +106,7 @@ describe DeleteInconsistentInternalIdRecords, :migration do
let(:group1) { groups.create(name: 'Group 1', type: 'Group', path: 'group_1') }
let(:group2) { groups.create(name: 'Group 2', type: 'Group', path: 'group_2') }
let(:group3) { groups.create(name: 'Group 2', type: 'Group', path: 'group_3') }
let!(:user) { create(:user) }
let!(:user) { create(:user) }
let(:internal_id_query) { ->(group) { InternalId.where(usage: InternalId.usages['epics'], namespace: group) } }
......
......@@ -430,7 +430,7 @@ describe ProjectPolicy do
it_behaves_like 'project policies as admin'
context 'EE' do
let(:additional_guest_permissions) { [:read_issue_link] }
let(:additional_guest_permissions) { [:read_issue_link] }
let(:additional_reporter_permissions) { [:admin_issue_link]}
let(:additional_maintainer_permissions) { [:push_code_to_protected_branches] }
let(:auditor_permissions) do
......
......@@ -928,7 +928,7 @@ describe SystemNoteService do
end
describe '.approve_mr' do
let(:noteable) { create(:merge_request, source_project: project) }
let(:noteable) { create(:merge_request, source_project: project) }
subject { described_class.approve_mr(noteable, author) }
it_behaves_like 'a system note' do
......@@ -943,7 +943,7 @@ describe SystemNoteService do
end
describe '.unapprove_mr' do
let(:noteable) { create(:merge_request, source_project: project) }
let(:noteable) { create(:merge_request, source_project: project) }
subject { described_class.unapprove_mr(noteable, author) }
it_behaves_like 'a system note' do
......@@ -1274,7 +1274,7 @@ describe SystemNoteService do
let(:project) { nil }
context 'issue added to an epic' do
subject { described_class.epic_issue(epic, issue, author, :added) }
subject { described_class.epic_issue(epic, issue, author, :added) }
it_behaves_like 'a system note' do
let(:action) { 'epic_issue_added' }
......@@ -1286,7 +1286,7 @@ describe SystemNoteService do
end
context 'issue removed from an epic' do
subject { described_class.epic_issue(epic, issue, author, :removed) }
subject { described_class.epic_issue(epic, issue, author, :removed) }
it_behaves_like 'a system note' do
let(:action) { 'epic_issue_removed' }
......@@ -1307,7 +1307,7 @@ describe SystemNoteService do
describe '.issue_on_epic' do
context 'issue added to an epic' do
subject { described_class.issue_on_epic(issue, epic, author, :added) }
subject { described_class.issue_on_epic(issue, epic, author, :added) }
it_behaves_like 'a system note' do
let(:action) { 'issue_added_to_epic' }
......@@ -1319,7 +1319,7 @@ describe SystemNoteService do
end
context 'issue removed from an epic' do
subject { described_class.issue_on_epic(issue, epic, author, :removed) }
subject { described_class.issue_on_epic(issue, epic, author, :removed) }
it_behaves_like 'a system note' do
let(:action) { 'issue_removed_from_epic' }
......
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