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) }
......
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