Commit 9ca3c72a authored by Arturo Herrero's avatar Arturo Herrero

RSpec zero monkey patching mode

The plan for RSpec 4.0 is to disable monkey patching:
https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode

This commit stops using RSpec monkey patching:
https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode
parent 9ed204a2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe TestReportsComparerEntity do RSpec.describe TestReportsComparerEntity do
include TestReportsHelper include TestReportsHelper
let(:entity) { described_class.new(comparer) } let(:entity) { described_class.new(comparer) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe TestReportsComparerSerializer do RSpec.describe TestReportsComparerSerializer do
include TestReportsHelper include TestReportsHelper
let(:project) { double(:project) } let(:project) { double(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe TestSuiteComparerEntity do RSpec.describe TestSuiteComparerEntity do
include TestReportsHelper include TestReportsHelper
let(:entity) { described_class.new(comparer) } let(:entity) { described_class.new(comparer) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe UserAnalyticsEntity do RSpec.describe UserAnalyticsEntity do
let(:user) { build_stubbed(:user) } let(:user) { build_stubbed(:user) }
let(:events) do let(:events) do
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::FeedbackEntity do RSpec.describe Vulnerabilities::FeedbackEntity do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:request) { double('request') } let(:request) { double('request') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::FindingEntity do RSpec.describe Vulnerabilities::FindingEntity do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::FindingReportsComparerEntity do RSpec.describe Vulnerabilities::FindingReportsComparerEntity do
describe 'container scanning report comparison' do describe 'container scanning report comparison' do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::HistoryEntity do RSpec.describe Vulnerabilities::HistoryEntity do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:time) { Time.zone.parse('2018-11-10') } let(:time) { Time.zone.parse('2018-11-10') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::IdentifierEntity do RSpec.describe Vulnerabilities::IdentifierEntity do
let(:identifier) { create(:vulnerabilities_identifier) } let(:identifier) { create(:vulnerabilities_identifier) }
let(:entity) do let(:entity) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::RequestEntity do RSpec.describe Vulnerabilities::RequestEntity do
let(:request) { create(:vulnerabilities_occurrence).evidence[:request] } let(:request) { create(:vulnerabilities_occurrence).evidence[:request] }
let(:entity) do let(:entity) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::ResponseEntity do RSpec.describe Vulnerabilities::ResponseEntity do
let(:response) { create(:vulnerabilities_occurrence).evidence[:response] } let(:response) { create(:vulnerabilities_occurrence).evidence[:response] }
let(:entity) do let(:entity) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::ScanEntity do RSpec.describe Vulnerabilities::ScanEntity do
let(:scan) { build(:security_scan, scanned_resources_count: 10) } let(:scan) { build(:security_scan, scanned_resources_count: 10) }
let(:request) { double('request') } let(:request) { double('request') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Vulnerabilities::ScannerEntity do RSpec.describe Vulnerabilities::ScannerEntity do
let(:scanner) { create(:vulnerabilities_scanner) } let(:scanner) { create(:vulnerabilities_scanner) }
let(:entity) do let(:entity) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VulnerabilityEntity do RSpec.describe VulnerabilityEntity do
let(:vulnerability) { create(:vulnerability, project: project, author: user) } let(:vulnerability) { create(:vulnerability, project: project, author: user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VulnerabilityNoteEntity do RSpec.describe VulnerabilityNoteEntity do
include Gitlab::Routing include Gitlab::Routing
let(:request) { double('request', current_user: user, noteable: note.noteable) } let(:request) { double('request', current_user: user, noteable: note.noteable) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VulnerableProjectEntity do RSpec.describe VulnerableProjectEntity do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:vulnerable_project) { ::Security::VulnerableProjectPresenter.new(project) } let(:vulnerable_project) { ::Security::VulnerableProjectPresenter.new(project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe VulnerableProjectSerializer do RSpec.describe VulnerableProjectSerializer do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:serializer) { described_class.new(project: project, current_user: user) } let(:serializer) { described_class.new(project: project, current_user: user) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Admin::EmailService do RSpec.describe Admin::EmailService do
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
describe '#execute', :clean_gitlab_redis_shared_state do describe '#execute', :clean_gitlab_redis_shared_state do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Analytics::CycleAnalytics::Stages::CreateService do RSpec.describe Analytics::CycleAnalytics::Stages::CreateService do
let_it_be(:group, refind: true) { create(:group) } let_it_be(:group, refind: true) { create(:group) }
let_it_be(:user, refind: true) { create(:user) } let_it_be(:user, refind: true) { create(:user) }
let(:params) { { name: 'my stage', start_event_identifier: :merge_request_created, end_event_identifier: :merge_request_merged } } let(:params) { { name: 'my stage', start_event_identifier: :merge_request_created, end_event_identifier: :merge_request_merged } }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Analytics::CycleAnalytics::Stages::DeleteService do RSpec.describe Analytics::CycleAnalytics::Stages::DeleteService do
let_it_be(:group, refind: true) { create(:group) } let_it_be(:group, refind: true) { create(:group) }
let_it_be(:user, refind: true) { create(:user) } let_it_be(:user, refind: true) { create(:user) }
let_it_be(:stage, refind: true) { create(:cycle_analytics_group_stage, group: group) } let_it_be(:stage, refind: true) { create(:cycle_analytics_group_stage, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Analytics::CycleAnalytics::Stages::ListService do RSpec.describe Analytics::CycleAnalytics::Stages::ListService do
let_it_be(:group, refind: true) { create(:group) } let_it_be(:group, refind: true) { create(:group) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:stages) { subject.payload[:stages] } let(:stages) { subject.payload[:stages] }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Analytics::CycleAnalytics::Stages::UpdateService do RSpec.describe Analytics::CycleAnalytics::Stages::UpdateService do
let_it_be(:group, refind: true) { create(:group) } let_it_be(:group, refind: true) { create(:group) }
let_it_be(:user, refind: true) { create(:user) } let_it_be(:user, refind: true) { create(:user) }
let(:default_stages) { Gitlab::Analytics::CycleAnalytics::DefaultStages.all } let(:default_stages) { Gitlab::Analytics::CycleAnalytics::DefaultStages.all }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApplicationSettings::UpdateService do RSpec.describe ApplicationSettings::UpdateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:setting) { ApplicationSetting.create_from_defaults } let(:setting) { ApplicationSetting.create_from_defaults }
let(:service) { described_class.new(setting, user, opts) } let(:service) { described_class.new(setting, user, opts) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Applications::CreateService do RSpec.describe ::Applications::CreateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:params) { attributes_for(:application) } let(:params) { attributes_for(:application) }
let(:request) { ActionController::TestRequest.new({ remote_ip: "127.0.0.1" }, ActionController::TestSession.new, nil) } let(:request) { ActionController::TestRequest.new({ remote_ip: "127.0.0.1" }, ActionController::TestSession.new, nil) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRules::CreateService do RSpec.describe ApprovalRules::CreateService do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { project.creator } let(:user) { project.creator }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRules::FinalizeService do RSpec.describe ApprovalRules::FinalizeService do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRules::MergeRequestRuleDestroyService do RSpec.describe ApprovalRules::MergeRequestRuleDestroyService do
let(:rule) { create(:approval_merge_request_rule) } let(:rule) { create(:approval_merge_request_rule) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRules::ParamsFilteringService do RSpec.describe ApprovalRules::ParamsFilteringService do
let(:service) { described_class.new(merge_request, user, params) } let(:service) { described_class.new(merge_request, user, params) }
let(:project_member) { create(:user) } let(:project_member) { create(:user) }
let(:outsider) { create(:user) } let(:outsider) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRules::ProjectRuleDestroyService do RSpec.describe ApprovalRules::ProjectRuleDestroyService do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ApprovalRules::UpdateService do RSpec.describe ApprovalRules::UpdateService do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { project.creator } let(:user) { project.creator }
let(:approval_rule) { target.approval_rules.create(name: 'foo', approvals_required: 2) } let(:approval_rule) { target.approval_rules.create(name: 'foo', approvals_required: 2) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AuditEventService do RSpec.describe AuditEventService do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user, current_sign_in_ip: '192.168.68.104') } let(:user) { create(:user, current_sign_in_ip: '192.168.68.104') }
let(:project_member) { create(:project_member, user: user, expires_at: 1.day.from_now) } let(:project_member) { create(:project_member, user: user, expires_at: 1.day.from_now) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AutoMerge::AddToMergeTrainWhenPipelineSucceedsService do RSpec.describe AutoMerge::AddToMergeTrainWhenPipelineSucceedsService do
let_it_be(:project, reload: true) { create(:project, :repository) } let_it_be(:project, reload: true) { create(:project, :repository) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:service) { described_class.new(project, user) } let(:service) { described_class.new(project, user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AutoMerge::MergeTrainService do RSpec.describe AutoMerge::MergeTrainService do
include ExclusiveLeaseHelpers include ExclusiveLeaseHelpers
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AwardEmojis::AddService do RSpec.describe AwardEmojis::AddService do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:awardable) { create(:note_on_issue, project: project) } let_it_be(:awardable) { create(:note_on_issue, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AwardEmojis::DestroyService do RSpec.describe AwardEmojis::DestroyService do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:awardable) { create(:note_on_issue, project: project) } let_it_be(:awardable) { create(:note_on_issue, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe BaseCountService do RSpec.describe BaseCountService do
include ::EE::GeoHelpers include ::EE::GeoHelpers
describe '#cache_options' do describe '#cache_options' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::CreateService, services: true do RSpec.describe Boards::CreateService, services: true do
shared_examples 'boards create service' do shared_examples 'boards create service' do
context 'With the feature available' do context 'With the feature available' do
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::DestroyService do RSpec.describe Boards::DestroyService do
describe '#execute' do describe '#execute' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::ListService do RSpec.describe Boards::ListService do
it_behaves_like 'multiple boards list service' do it_behaves_like 'multiple boards list service' do
let(:parent) { create(:project, :empty_repo) } let(:parent) { create(:project, :empty_repo) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'EE::Boards::Lists::UpdateService' do RSpec.describe 'EE::Boards::Lists::UpdateService' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:user) { create(:group_member, :owner, group: group, user: create(:user)).user } let(:user) { create(:group_member, :owner, group: group, user: create(:user)).user }
let(:unpriviledged_user) { create(:group_member, :guest, group: group, user: create(:user)).user } let(:unpriviledged_user) { create(:group_member, :guest, group: group, user: create(:user)).user }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::UpdateService, services: true do RSpec.describe Boards::UpdateService, services: true do
describe '#execute' do describe '#execute' do
let(:project) { create(:project, group: group) } let(:project) { create(:project, group: group) }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Branches::DeleteService do RSpec.describe Branches::DeleteService do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:repository) { project.repository } let(:repository) { project.repository }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe BurnupChartService do RSpec.describe BurnupChartService do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:other_user) { create(:user) } let_it_be(:other_user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareContainerScanningReportsService do RSpec.describe Ci::CompareContainerScanningReportsService do
let(:current_user) { build(:user, :admin) } let(:current_user) { build(:user, :admin) }
let(:service) { described_class.new(project, current_user) } let(:service) { described_class.new(project, current_user) }
let(:project) { build(:project, :repository) } let(:project) { build(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareDastReportsService do RSpec.describe Ci::CompareDastReportsService do
let(:current_user) { build(:user, :admin) } let(:current_user) { build(:user, :admin) }
let(:service) { described_class.new(project, current_user) } let(:service) { described_class.new(project, current_user) }
let(:project) { build(:project, :repository) } let(:project) { build(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareDependencyScanningReportsService do RSpec.describe Ci::CompareDependencyScanningReportsService do
let(:current_user) { build(:user, :admin) } let(:current_user) { build(:user, :admin) }
let(:service) { described_class.new(project, current_user) } let(:service) { described_class.new(project, current_user) }
let(:project) { build(:project, :repository) } let(:project) { build(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareLicenseScanningReportsService do RSpec.describe Ci::CompareLicenseScanningReportsService do
let(:service) { described_class.new(project, nil) } let(:service) { described_class.new(project, nil) }
let(:project) { build(:project, :repository) } let(:project) { build(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareMetricsReportsService do RSpec.describe Ci::CompareMetricsReportsService do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:service) { described_class.new(project) } let(:service) { described_class.new(project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareSastReportsService do RSpec.describe Ci::CompareSastReportsService do
let(:current_user) { build(:user, :admin) } let(:current_user) { build(:user, :admin) }
let(:service) { described_class.new(project, current_user) } let(:service) { described_class.new(project, current_user) }
let(:project) { build(:project, :repository) } let(:project) { build(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CompareSecretDetectionReportsService do RSpec.describe Ci::CompareSecretDetectionReportsService do
let(:current_user) { build(:user, :admin) } let(:current_user) { build(:user, :admin) }
let(:service) { described_class.new(project, current_user) } let(:service) { described_class.new(project, current_user) }
let(:project) { build(:project, :repository) } let(:project) { build(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CreatePipelineService do RSpec.describe Ci::CreatePipelineService do
subject(:execute) { service.execute(:push) } subject(:execute) { service.execute(:push) }
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CreatePipelineService do RSpec.describe Ci::CreatePipelineService do
subject(:execute) { service.execute(:push) } subject(:execute) { service.execute(:push) }
let_it_be(:downstream_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'some')) } let_it_be(:downstream_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'some')) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::CreatePipelineService, '#execute' do RSpec.describe Ci::CreatePipelineService, '#execute' do
let_it_be(:namespace) { create(:namespace) } let_it_be(:namespace) { create(:namespace) }
let_it_be(:gold_plan) { create(:gold_plan) } let_it_be(:gold_plan) { create(:gold_plan) }
let_it_be(:plan_limits) { create(:plan_limits, plan: gold_plan) } let_it_be(:plan_limits) { create(:plan_limits, plan: gold_plan) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::Ci::DestroyPipelineService do RSpec.describe ::Ci::DestroyPipelineService do
let(:project) { create(:project) } let(:project) { create(:project) }
let!(:pipeline) { create(:ci_pipeline, project: project) } let!(:pipeline) { create(:ci_pipeline, project: project) }
let(:user) { project.owner } let(:user) { project.owner }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::ExpirePipelineCacheService do RSpec.describe Ci::ExpirePipelineCacheService do
let(:pipeline) { create(:ci_empty_pipeline) } let(:pipeline) { create(:ci_empty_pipeline) }
subject { described_class.new } subject { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::ExternalPullRequests::ProcessGithubEventService do RSpec.describe Ci::ExternalPullRequests::ProcessGithubEventService do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:action) { 'opened' } let(:action) { 'opened' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Minutes::BatchResetService do RSpec.describe Ci::Minutes::BatchResetService do
let(:service) { described_class.new } let(:service) { described_class.new }
describe '#execute!' do describe '#execute!' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::Minutes::EmailNotificationService do RSpec.describe Ci::Minutes::EmailNotificationService do
shared_examples 'namespace with available CI minutes' do shared_examples 'namespace with available CI minutes' do
context 'when usage is below the quote' do context 'when usage is below the quote' do
it 'does not send the email' do it 'does not send the email' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::PipelineBridgeStatusService do RSpec.describe Ci::PipelineBridgeStatusService do
let(:user) { build(:user) } let(:user) { build(:user) }
let(:project) { build(:project) } let(:project) { build(:project) }
let(:pipeline) { build(:ci_pipeline, project: project) } let(:pipeline) { build(:ci_pipeline, project: project) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Ci::PlayBuildService, '#execute' do RSpec.describe Ci::PlayBuildService, '#execute' do
it_behaves_like 'restricts access to protected environments' it_behaves_like 'restricts access to protected environments'
end end
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Ci::ProcessBuildService, '#execute' do RSpec.describe Ci::ProcessBuildService, '#execute' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:environment) { create(:environment, project: project, name: 'production') } let(:environment) { create(:environment, project: project, name: 'production') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::ProcessPipelineService, '#execute' do RSpec.describe Ci::ProcessPipelineService, '#execute' do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:downstream) { create(:project, :repository) } let_it_be(:downstream) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::RegisterJobService do RSpec.describe Ci::RegisterJobService do
let_it_be(:shared_runner) { create(:ci_runner, :instance) } let_it_be(:shared_runner) { create(:ci_runner, :instance) }
let!(:project) { create :project, shared_runners_enabled: true } let!(:project) { create :project, shared_runners_enabled: true }
let!(:pipeline) { create :ci_empty_pipeline, project: project } let!(:pipeline) { create :ci_empty_pipeline, project: project }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Ci::RetryBuildService do RSpec.describe Ci::RetryBuildService do
it_behaves_like 'restricts access to protected environments' it_behaves_like 'restricts access to protected environments'
end end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::SubscribeBridgeService do RSpec.describe Ci::SubscribeBridgeService do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:bridge) { build(:ci_bridge, upstream: upstream_project) } let(:bridge) { build(:ci_bridge, upstream: upstream_project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Ci::TriggerDownstreamSubscriptionService do RSpec.describe Ci::TriggerDownstreamSubscriptionService do
describe '#execute' do describe '#execute' do
subject(:execute) { described_class.new(pipeline.project, pipeline.user).execute(pipeline) } subject(:execute) { described_class.new(pipeline.project, pipeline.user).execute(pipeline) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe CiCd::GithubIntegrationSetupService do RSpec.describe CiCd::GithubIntegrationSetupService do
let(:repo_full_name) { "MyUser/my-project" } let(:repo_full_name) { "MyUser/my-project" }
let(:api_token) { "abcdefghijk123" } let(:api_token) { "abcdefghijk123" }
let(:import_url) { "https://#{api_token}@github.com/#{repo_full_name}.git" } let(:import_url) { "https://#{api_token}@github.com/#{repo_full_name}.git" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe CiCd::GithubSetupService do RSpec.describe CiCd::GithubSetupService do
let(:repo_full_name) { "MyUser/my-project" } let(:repo_full_name) { "MyUser/my-project" }
let(:api_token) { "abcdefghijk123" } let(:api_token) { "abcdefghijk123" }
let(:import_url) { "https://#{api_token}@github.com/#{repo_full_name}.git" } let(:import_url) { "https://#{api_token}@github.com/#{repo_full_name}.git" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe CiCd::SetupProject do RSpec.describe CiCd::SetupProject do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, creator: user, import_type: 'github', import_url: 'http://foo.com') } let(:project) { create(:project, creator: user, import_type: 'github', import_url: 'http://foo.com') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ClearNamespaceSharedRunnersMinutesService do RSpec.describe ClearNamespaceSharedRunnersMinutesService do
describe '#execute' do describe '#execute' do
subject { described_class.new(namespace).execute } subject { described_class.new(namespace).execute }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Dashboard::Environments::ListService do RSpec.describe Dashboard::Environments::ListService do
describe '#execute' do describe '#execute' do
def setup def setup
user = create(:user) user = create(:user)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Dashboard::Operations::ListService do RSpec.describe Dashboard::Operations::ListService do
let(:subject) { described_class.new(user).execute } let(:subject) { described_class.new(user).execute }
let(:dashboard_project) { subject.first } let(:dashboard_project) { subject.first }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Dashboard::Projects::CreateService do RSpec.describe Dashboard::Projects::CreateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:service) { described_class.new(user, user.ops_dashboard_projects, feature: :operations_dashboard) } let(:service) { described_class.new(user, user.ops_dashboard_projects, feature: :operations_dashboard) }
let(:project) { create(:project) } let(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Dashboard::Projects::ListService do RSpec.describe Dashboard::Projects::ListService do
let!(:license) { create(:license, plan: License::ULTIMATE_PLAN) } let!(:license) { create(:license, plan: License::ULTIMATE_PLAN) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe DependencyProxy::DownloadBlobService do RSpec.describe DependencyProxy::DownloadBlobService do
include EE::DependencyProxyHelpers include EE::DependencyProxyHelpers
let(:image) { 'alpine' } let(:image) { 'alpine' }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe DependencyProxy::FindOrCreateBlobService do RSpec.describe DependencyProxy::FindOrCreateBlobService do
include EE::DependencyProxyHelpers include EE::DependencyProxyHelpers
let(:blob) { create(:dependency_proxy_blob) } let(:blob) { create(:dependency_proxy_blob) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe DependencyProxy::PullManifestService do RSpec.describe DependencyProxy::PullManifestService do
include EE::DependencyProxyHelpers include EE::DependencyProxyHelpers
let(:image) { 'alpine' } let(:image) { 'alpine' }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe DependencyProxy::RequestTokenService do RSpec.describe DependencyProxy::RequestTokenService do
include EE::DependencyProxyHelpers include EE::DependencyProxyHelpers
let(:image) { 'alpine:3.9' } let(:image) { 'alpine:3.9' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::BulkInsertService do RSpec.describe EE::AuditEvents::BulkInsertService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:entity) { create(:project) } let(:entity) { create(:project) }
let(:entity_type) { 'Project' } let(:entity_type) { 'Project' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::CustomAuditEventService do RSpec.describe EE::AuditEvents::CustomAuditEventService do
describe '#security_event' do describe '#security_event' do
include_examples 'logs the custom audit event' do include_examples 'logs the custom audit event' do
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::ImpersonationAuditEventService do RSpec.describe EE::AuditEvents::ImpersonationAuditEventService do
let(:impersonator) { create(:user) } let(:impersonator) { create(:user) }
let(:ip_address) { '127.0.0.1' } let(:ip_address) { '127.0.0.1' }
let(:message) { 'Impersonation Started' } let(:message) { 'Impersonation Started' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::ProtectedBranchAuditEventService do RSpec.describe EE::AuditEvents::ProtectedBranchAuditEventService do
let(:protected_branch) { create(:protected_branch, :no_one_can_push) } let(:protected_branch) { create(:protected_branch, :no_one_can_push) }
let(:merge_level) { 'Maintainers' } let(:merge_level) { 'Maintainers' }
let(:push_level) { 'No one' } let(:push_level) { 'No one' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::ReleaseArtifactsDownloadedAuditEventService do RSpec.describe EE::AuditEvents::ReleaseArtifactsDownloadedAuditEventService do
describe '#security_event' do describe '#security_event' do
include_examples 'logs the release audit event' do include_examples 'logs the release audit event' do
let(:release) { create(:release, project: entity) } let(:release) { create(:release, project: entity) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::ReleaseAssociateMilestoneAuditEventService do RSpec.describe EE::AuditEvents::ReleaseAssociateMilestoneAuditEventService do
describe '#security_event' do describe '#security_event' do
context 'with no milestones' do context 'with no milestones' do
include_examples 'logs the release audit event' do include_examples 'logs the release audit event' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::ReleaseCreatedAuditEventService do RSpec.describe EE::AuditEvents::ReleaseCreatedAuditEventService do
describe '#security_event' do describe '#security_event' do
context 'with no milestones' do context 'with no milestones' do
include_examples 'logs the release audit event' do include_examples 'logs the release audit event' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::ReleaseUpdatedAuditEventService do RSpec.describe EE::AuditEvents::ReleaseUpdatedAuditEventService do
describe '#security_event' do describe '#security_event' do
include_examples 'logs the release audit event' do include_examples 'logs the release audit event' do
let(:release) { create(:release, project: entity) } let(:release) { create(:release, project: entity) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::RepositoryDownloadStartedAuditEventService do RSpec.describe EE::AuditEvents::RepositoryDownloadStartedAuditEventService do
describe '#security_event' do describe '#security_event' do
include_examples 'logs the custom audit event' do include_examples 'logs the custom audit event' do
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::AuditEvents::RepositoryPushAuditEventService do RSpec.describe EE::AuditEvents::RepositoryPushAuditEventService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:entity) { create(:project) } let(:entity) { create(:project) }
let(:entity_type) { 'Project' } let(:entity_type) { 'Project' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe AutoMergeService do RSpec.describe AutoMergeService do
describe '.all_strategies_ordered_by_preference' do describe '.all_strategies_ordered_by_preference' do
subject { described_class.all_strategies_ordered_by_preference } subject { described_class.all_strategies_ordered_by_preference }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::Issues::CreateService do RSpec.describe Boards::Issues::CreateService do
describe '#execute' do describe '#execute' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::Issues::ListService, services: true do RSpec.describe Boards::Issues::ListService, services: true do
describe '#execute' do describe '#execute' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::Issues::MoveService, services: true do RSpec.describe Boards::Issues::MoveService, services: true do
shared_examples 'moving an issue to/from milestone lists' do shared_examples 'moving an issue to/from milestone lists' do
context 'from backlog to milestone list' do context 'from backlog to milestone list' do
let!(:issue) { create(:labeled_issue, project: project) } let!(:issue) { create(:labeled_issue, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::Lists::CreateService do RSpec.describe Boards::Lists::CreateService do
describe '#execute' do describe '#execute' do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:board) { create(:board, project: project) } let(:board) { create(:board, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Boards::Lists::ListService do RSpec.describe Boards::Lists::ListService do
describe '#execute' do describe '#execute' do
shared_examples 'list service for board with assignee lists' do shared_examples 'list service for board with assignee lists' do
let!(:assignee_list) { build(:user_list, board: board).tap { |l| l.save(validate: false) } } let!(:assignee_list) { build(:user_list, board: board).tap { |l| l.save(validate: false) } }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Max Limits Module' do RSpec.describe 'Max Limits Module' do
let(:clazz) do let(:clazz) do
Class.new do Class.new do
include EE::Boards::Lists::MaxLimits include EE::Boards::Lists::MaxLimits
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Clusters::CreateService do RSpec.describe Clusters::CreateService do
let(:access_token) { 'xxx' } let(:access_token) { 'xxx' }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Commits::CreateService do RSpec.describe Commits::CreateService do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Deployments::AfterCreateService do RSpec.describe Deployments::AfterCreateService do
include ::EE::GeoHelpers include ::EE::GeoHelpers
let(:primary) { create(:geo_node, :primary) } let(:primary) { create(:geo_node, :primary) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe DesignManagement::DeleteDesignsService do RSpec.describe DesignManagement::DeleteDesignsService do
include DesignManagementTestHelpers include DesignManagementTestHelpers
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe DesignManagement::SaveDesignsService do RSpec.describe DesignManagement::SaveDesignsService do
include DesignManagementTestHelpers include DesignManagementTestHelpers
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EventCreateService do RSpec.describe EventCreateService do
let(:service) { described_class.new } let(:service) { described_class.new }
describe 'Epics' do describe 'Epics' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Git::BranchPushService do RSpec.describe Git::BranchPushService do
include RepoHelpers include RepoHelpers
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Git::WikiPushService do RSpec.describe Git::WikiPushService do
include RepoHelpers include RepoHelpers
let(:gl_repository) { "wiki-#{project.id}" } let(:gl_repository) { "wiki-#{project.id}" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::IpRestrictions::UpdateService do RSpec.describe EE::IpRestrictions::UpdateService do
let(:group) { create(:group) } let(:group) { create(:group) }
subject { described_class.new(group, comma_separated_ranges).execute } subject { described_class.new(group, comma_separated_ranges).execute }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Issuable::BulkUpdateService do RSpec.describe Issuable::BulkUpdateService do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project1) { create(:project, :repository, group: group) } let_it_be(:project1) { create(:project, :repository, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Issuable::Clone::AttributesRewriter do RSpec.describe Issuable::Clone::AttributesRewriter do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :public, group: group) } let(:project) { create(:project, :public, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Issuable::CommonSystemNotesService do RSpec.describe Issuable::CommonSystemNotesService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:issuable) { create(:issue) } let(:issuable) { create(:issue) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Issues::CreateFromVulnerabilityDataService, '#execute' do RSpec.describe Issues::CreateFromVulnerabilityDataService, '#execute' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:project, :public, namespace: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Issues::CreateService do RSpec.describe Issues::CreateService do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let(:project) { create(:project, group: group) } let(:project) { create(:project, group: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Issues::MoveService do RSpec.describe Issues::MoveService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:old_project) { create(:project) } let(:old_project) { create(:project) }
let(:new_project) { create(:project, group: create(:group)) } let(:new_project) { create(:project, group: create(:group)) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Issues::UpdateService do RSpec.describe Issues::UpdateService do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, group: group) } let(:project) { create(:project, group: group) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Keys::DestroyService do RSpec.describe Keys::DestroyService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:key) { create(:ldap_key) } let(:key) { create(:ldap_key) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Labels::PromoteService do RSpec.describe Labels::PromoteService do
let(:user) { create(:admin) } let(:user) { create(:admin) }
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, group: group) } let(:project) { create(:project, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Members::DestroyService do RSpec.describe Members::DestroyService do
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
let(:member_user) { create(:user) } let(:member_user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Members::UpdateService do RSpec.describe Members::UpdateService do
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let(:group) { create(:group, :public) } let(:group) { create(:group, :public) }
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::MergeRequestMetricsService do RSpec.describe EE::MergeRequestMetricsService do
subject do subject do
service = MergeRequestMetricsService.new(merge_request.metrics) service = MergeRequestMetricsService.new(merge_request.metrics)
service.merge(event) service.merge(event)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::BaseService do RSpec.describe MergeRequests::BaseService do
include ProjectForksHelper include ProjectForksHelper
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::CreateFromVulnerabilityDataService, '#execute' do RSpec.describe MergeRequests::CreateFromVulnerabilityDataService, '#execute' do
let(:remediations_folder) { Rails.root.join('ee/spec/fixtures/security_reports/remediations') } let(:remediations_folder) { Rails.root.join('ee/spec/fixtures/security_reports/remediations') }
let(:yarn_lock_content) { File.read(File.join(remediations_folder, "yarn.lock")) } let(:yarn_lock_content) { File.read(File.join(remediations_folder, "yarn.lock")) }
let(:remediation_patch_content) { File.read(File.join(remediations_folder, "remediation.patch")) } let(:remediation_patch_content) { File.read(File.join(remediations_folder, "remediation.patch")) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_shared_state do RSpec.describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_shared_state do
include ProjectForksHelper include ProjectForksHelper
describe '#execute' do describe '#execute' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::CreateService do RSpec.describe MergeRequests::CreateService do
include ProjectForksHelper include ProjectForksHelper
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::PostMergeService do RSpec.describe MergeRequests::PostMergeService do
let(:project) { merge_request.target_project } let(:project) { merge_request.target_project }
let(:merge_request) { create(:merge_request) } let(:merge_request) { create(:merge_request) }
let(:current_user) { merge_request.author } let(:current_user) { merge_request.author }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::RefreshService do RSpec.describe MergeRequests::RefreshService do
include ProjectForksHelper include ProjectForksHelper
include ProjectHelpers include ProjectHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe MergeRequests::UpdateService, :mailer do RSpec.describe MergeRequests::UpdateService, :mailer do
include ProjectForksHelper include ProjectForksHelper
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Notes::CreateService do RSpec.describe Notes::CreateService do
context 'note with commands' do context 'note with commands' do
context 'for issues' do context 'for issues' do
let(:project) { create(:project) } let(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Notes::DestroyService do RSpec.describe Notes::DestroyService do
let_it_be(:project, refind: true) { create(:project) } let_it_be(:project, refind: true) { create(:project) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Notes::PostProcessService do RSpec.describe Notes::PostProcessService do
describe '#execute' do describe '#execute' do
context 'analytics' do context 'analytics' do
subject { described_class.new(note) } subject { described_class.new(note) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Notes::QuickActionsService do RSpec.describe Notes::QuickActionsService do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, group: group) } let(:project) { create(:project, group: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Notes::UpdateService do RSpec.describe Notes::UpdateService do
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::NotificationService, :mailer do RSpec.describe EE::NotificationService, :mailer do
include EmailSpec::Matchers include EmailSpec::Matchers
include NotificationHelpers include NotificationHelpers
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::EE::NullNotificationService do RSpec.describe ::EE::NullNotificationService do
it 'responds to methods implemented by NotificationService' do it 'responds to methods implemented by NotificationService' do
method = NotificationService.instance_methods(false).sample method = NotificationService.instance_methods(false).sample
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe PostReceiveService, :geo do RSpec.describe PostReceiveService, :geo do
include EE::GeoHelpers include EE::GeoHelpers
let_it_be(:primary_url) { 'http://primary.example.com' } let_it_be(:primary_url) { 'http://primary.example.com' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe PreviewMarkdownService do RSpec.describe PreviewMarkdownService do
context 'preview epic text with quick action' do context 'preview epic text with quick action' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProtectedBranches::CreateService do RSpec.describe ProtectedBranches::CreateService do
include ProjectForksHelper include ProjectForksHelper
let(:source_project) { create(:project) } let(:source_project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProtectedBranches::DestroyService do RSpec.describe ProtectedBranches::DestroyService do
let(:protected_branch) { create(:protected_branch) } let(:protected_branch) { create(:protected_branch) }
let(:branch_name) { protected_branch.name } let(:branch_name) { protected_branch.name }
let(:project) { protected_branch.project } let(:project) { protected_branch.project }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ProtectedBranches::UpdateService do RSpec.describe ProtectedBranches::UpdateService do
let(:branch_name) { 'feature' } let(:branch_name) { 'feature' }
let(:protected_branch) { create(:protected_branch, :no_one_can_push, name: branch_name) } let(:protected_branch) { create(:protected_branch, :no_one_can_push, name: branch_name) }
let(:project) { protected_branch.project } let(:project) { protected_branch.project }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe QuickActions::TargetService do RSpec.describe QuickActions::TargetService do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:project) { create(:project, group: group) } let(:project) { create(:project, group: group) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ResourceEvents::MergeIntoNotesService do RSpec.describe ResourceEvents::MergeIntoNotesService do
def create_label_event(params) def create_label_event(params)
event_params = { action: :add, label: label, issue: resource, event_params = { action: :add, label: label, issue: resource,
user: user } user: user }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::ResourceEvents::SyntheticWeightNotesBuilderService do RSpec.describe EE::ResourceEvents::SyntheticWeightNotesBuilderService do
describe '#execute' do describe '#execute' do
let!(:user) { create(:user) } let!(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::SystemHooksService do RSpec.describe EE::SystemHooksService do
context 'when group member' do context 'when group member' do
let(:group) { create(:group) } let(:group) { create(:group) }
let(:group_member) { create(:group_member, group: group) } let(:group_member) { create(:group_member, group: group) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::SystemNotes::EpicsService do RSpec.describe EE::SystemNotes::EpicsService do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, :repository, group: group) } let_it_be(:project) { create(:project, :repository, group: group) }
let_it_be(:author) { create(:user) } let_it_be(:author) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::SystemNotes::IssuablesService do RSpec.describe ::SystemNotes::IssuablesService do
let_it_be(:group) { create(:group) } let_it_be(:group) { create(:group) }
let_it_be(:project) { create(:project, :repository, group: group) } let_it_be(:project) { create(:project, :repository, group: group) }
let_it_be(:author) { create(:user) } let_it_be(:author) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe ::SystemNotes::MergeRequestsService do RSpec.describe ::SystemNotes::MergeRequestsService do
let(:author) { create(:user) } let(:author) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:noteable) { create(:merge_request, source_project: project) } let(:noteable) { create(:merge_request, source_project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::SystemNotes::MergeTrainService do RSpec.describe EE::SystemNotes::MergeTrainService do
let_it_be(:author) { create(:user) } let_it_be(:author) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::SystemNotes::VulnerabilitiesService do RSpec.describe EE::SystemNotes::VulnerabilitiesService do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:author) { create(:user) } let_it_be(:author) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe EE::UserProjectAccessChangedService do RSpec.describe EE::UserProjectAccessChangedService do
let(:service) { UserProjectAccessChangedService.new([1, 2]) } let(:service) { UserProjectAccessChangedService.new([1, 2]) }
describe '#execute' do describe '#execute' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Users::BlockService do RSpec.describe Users::BlockService do
let(:current_user) { create(:admin) } let(:current_user) { create(:admin) }
subject(:service) { described_class.new(current_user) } subject(:service) { described_class.new(current_user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Users::BuildService do RSpec.describe Users::BuildService do
describe '#execute' do describe '#execute' do
let(:params) do let(:params) do
{ name: 'John Doe', username: 'jduser', email: 'jd@example.com', password: 'mydummypass' } { name: 'John Doe', username: 'jduser', email: 'jd@example.com', password: 'mydummypass' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Users::CreateService do RSpec.describe Users::CreateService do
let(:current_user) { create(:admin) } let(:current_user) { create(:admin) }
let(:params) do let(:params) do
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Users::DestroyService do RSpec.describe Users::DestroyService do
let(:current_user) { create(:admin) } let(:current_user) { create(:admin) }
subject(:service) { described_class.new(current_user) } subject(:service) { described_class.new(current_user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Users::MigrateToGhostUserService do RSpec.describe Users::MigrateToGhostUserService do
context 'epics' do context 'epics' do
let!(:user) { create(:user) } let!(:user) { create(:user) }
let(:service) { described_class.new(user) } let(:service) { described_class.new(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