Commit 390b4230 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix_empty_line_after_final_let_ee' into 'master'

Automatically fixed EmptyLineAfterFinalLet in ee/

See merge request gitlab-org/gitlab!19736
parents 2b3844aa 4202a726
......@@ -90,6 +90,7 @@ describe Analytics::CycleAnalytics::StagesController do
describe 'PUT `update`' do
let(:stage) { create(:cycle_analytics_group_stage, parent: group, relative_position: 15) }
subject { put :update, params: params.merge(id: stage.id) }
include_examples 'group permission check on the controller level'
......
......@@ -8,6 +8,7 @@ describe Analytics::TasksByTypeController do
let(:label) { create(:group_label, group: group) }
let(:params) { { group_id: group.full_path, label_ids: [label.id], created_after: 10.days.ago, subject: 'Issue' } }
let!(:issue) { create(:labeled_issue, created_at: 5.days.ago, project: create(:project, group: group), labels: [label]) }
subject { get :show, params: params }
before do
......
......@@ -17,6 +17,7 @@ describe BoardsResponses do
describe '#serialize_as_json' do
let!(:board) { create(:board, milestone: milestone) }
context 'with milestone' do
let(:milestone) { create(:milestone) }
......@@ -33,6 +34,7 @@ describe BoardsResponses do
context 'without milestone' do
let(:milestone) { nil }
it 'serialises properly' do
expected = { id: board.id, name: board.name }.as_json
......
......@@ -12,6 +12,7 @@ describe InternalRedirect do
end
end
end
subject(:controller) { controller_class.new }
describe '#host_allowed?' do
......
......@@ -73,6 +73,7 @@ describe Projects::PushRulesController do
context "Updating #{rule_attr} rule" do
context 'as an admin' do
let(:user) { create(:admin) }
it_behaves_like 'a setting with global default', rule_attr, updates: true
end
......
......@@ -47,6 +47,7 @@ describe '[EE] Internal Group access' do
describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :internal, :repository, group: group) }
subject { merge_requests_group_path(group) }
it { is_expected.to be_allowed_for(:auditor) }
......
......@@ -47,6 +47,7 @@ describe '[EE] Public Group access' do
describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :public, :repository, group: group) }
subject { merge_requests_group_path(group) }
it { is_expected.to be_allowed_for(:auditor) }
......
......@@ -70,6 +70,7 @@ describe '[EE] Internal Project Access' do
describe "GET /:project_path/blob" do
let(:commit) { project.repository.commit }
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
it { is_expected.to be_allowed_for(:auditor) }
......@@ -153,6 +154,7 @@ describe '[EE] Internal Project Access' do
describe "GET /:project_path/pipelines/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
subject { project_pipeline_path(project, pipeline) }
it { is_expected.to be_allowed_for(:auditor) }
......@@ -181,6 +183,7 @@ describe '[EE] Internal Project Access' do
describe "GET /:project_path/builds/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { project_job_path(project, build.id) }
context "when allowed for public and internal" do
......@@ -208,6 +211,7 @@ describe '[EE] Internal Project Access' do
describe "GET /:project_path/-/environments/:id" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_path(project, environment) }
it { is_expected.to be_allowed_for(:auditor) }
......
......@@ -64,6 +64,7 @@ describe '[EE] Private Project Access' do
describe "GET /:project_path/blob" do
let(:commit) { project.repository.commit }
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
it { is_expected.to be_allowed_for(:auditor) }
......@@ -135,6 +136,7 @@ describe '[EE] Private Project Access' do
describe "GET /:project_path/-/environments/:id" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_path(project, environment) }
it { is_expected.to be_allowed_for(:auditor) }
......
......@@ -70,6 +70,7 @@ describe '[EE] Public Project Access' do
describe "GET /:project_path/pipelines/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
subject { project_pipeline_path(project, pipeline) }
it { is_expected.to be_allowed_for(:auditor) }
......@@ -98,6 +99,7 @@ describe '[EE] Public Project Access' do
describe "GET /:project_path/builds/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { project_job_path(project, build.id) }
context "when allowed for public" do
......@@ -125,6 +127,7 @@ describe '[EE] Public Project Access' do
describe "GET /:project_path/-/environments/:id" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_path(project, environment) }
it { is_expected.to be_allowed_for(:auditor) }
......
......@@ -58,6 +58,7 @@ describe IssuesFinder do
describe '#with_confidentiality_access_check' do
let(:guest) { create(:user) }
set(:authorized_user) { create(:user) }
set(:project) { create(:project, namespace: authorized_user.namespace) }
set(:public_issue) { create(:issue, project: project) }
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
describe LicensesFinder do
let(:license) { create(:license) }
set(:user) { create(:admin) }
it 'returns a license by id' do
......
......@@ -13,6 +13,7 @@ describe Packages::GroupPackagesFinder do
describe '#execute' do
let(:params) { { exclude_subgroups: false } }
subject { described_class.new(user, group, params).execute }
shared_examples 'with package type' do |package_type|
......
......@@ -5,12 +5,14 @@ require 'spec_helper'
describe Mutations::MergeRequests::SetAssignees do
let(:merge_request) { create(:merge_request) }
let(:user) { create(:user) }
subject(:mutation) { described_class.new(object: nil, context: { current_user: user }) }
describe '#resolve' do
let(:assignees) { create_list(:user, 3) }
let(:assignee_usernames) { assignees.map(&:username) }
let(:mutated_merge_request) { subject[:merge_request] }
subject { mutation.resolve(project_path: merge_request.project.full_path, iid: merge_request.iid, assignee_usernames: assignee_usernames) }
before do
......
......@@ -52,6 +52,7 @@ describe LabelsHelper do
context 'when edit_context is a project' do
let(:edit_context) { create(:project) }
let(:label) { create(:label, project: edit_context, title: 'bug') }
before do
data.merge!({
project_id: edit_context.id,
......
......@@ -7,6 +7,7 @@ describe KerberosSpnegoHelper do
describe '#spnego_credentials!' do
let(:gss) { double('GSSAPI::Simple') }
let(:gss_service_name) { 'gss_service_name' }
subject { Class.new { include KerberosSpnegoHelper }.new }
before do
......
......@@ -24,6 +24,7 @@ describe LicenseHelper do
context 'normal user' do
let(:is_admin) { false }
it 'displays correct error message for normal user' do
expect(license_message(signed_in: true, is_admin: is_admin)).to be_blank
end
......
......@@ -180,6 +180,7 @@ describe SearchHelper do
let(:use_elasticsearch) { true }
let(:scope) { 'commits' }
let(:search_service) { instance_double(Search::GlobalService, use_elasticsearch?: use_elasticsearch, scope: scope) }
subject { show_switch_to_basic_search?(search_service) }
before do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
describe UsersHelper do
describe '#current_user_menu_items' do
let(:user) { create(:user) }
using RSpec::Parameterized::TableSyntax
where(
......
......@@ -11,6 +11,7 @@ describe EE::Gitlab::Auth::LDAP::AccessLevels do
uid=janedoe,ou=users,dc=example,dc=com
)
end
subject { access_levels }
context 'when access_levels is empty' do
......@@ -40,6 +41,7 @@ describe EE::Gitlab::Auth::LDAP::AccessLevels do
uid=janedoe,ou=users,dc=example,dc=com
}
end
before do
access_levels.set(master_dns, to: Gitlab::Access::MAINTAINER)
access_levels.set(developer_dns, to: Gitlab::Access::DEVELOPER)
......
......@@ -311,6 +311,7 @@ describe EE::Gitlab::Auth::LDAP::Sync::Group do
context 'when user inherits higher permissions from parent' do
let(:parent_group) { create(:group) }
let(:ldap_group1) { ldap_group_entry(user_dn(user.username)) }
before do
group.update(parent: parent_group)
parent_group.add_maintainer(user)
......@@ -350,6 +351,7 @@ describe EE::Gitlab::Auth::LDAP::Sync::Group do
context 'when user inherits lower permissions from parent' do
let(:parent_group) { create(:group) }
let(:ldap_group1) { ldap_group_entry(user_dn(user.username)) }
before do
group.update(parent: parent_group)
parent_group.add_reporter(user)
......@@ -390,6 +392,7 @@ describe EE::Gitlab::Auth::LDAP::Sync::Group do
let(:parent_group) { create(:group) }
let(:ldap_group1) { ldap_group_entry(user_dn(user.username)) }
let(:access_requester) { parent_group.request_access(user) }
before do
group.update(parent: parent_group)
parent_group.add_owner(create(:user))
......@@ -415,6 +418,7 @@ describe EE::Gitlab::Auth::LDAP::Sync::Group do
context 'when user inherits permissions from parent and user is no longer in LDAP group' do
let(:parent_group) { create(:group) }
let(:ldap_group1) { ldap_group_entry(user_dn('other_user')) }
before do
group.update(parent: parent_group)
parent_group.add_maintainer(user)
......@@ -434,6 +438,7 @@ describe EE::Gitlab::Auth::LDAP::Sync::Group do
let(:group1) { create(:group) }
let(:group2) { create(:group) }
let(:group3) { create(:group) }
before do
group1.add_reporter(user)
......
......@@ -6,6 +6,7 @@ describe Gitlab::Cleanup::OrphanJobArtifactFiles do
include ::EE::GeoHelpers
let(:null_logger) { Logger.new('/dev/null') }
subject(:cleanup) { described_class.new(logger: null_logger) }
before do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::Analytics::CycleAnalytics::RequestParams do
let(:params) { { created_after: '2018-01-01', created_before: '2019-01-01' } }
subject { described_class.new(params) }
describe 'validations' do
......
......@@ -70,6 +70,7 @@ describe Gitlab::Auth::AuthFinders do
describe '#find_user_from_bearer_token' do
let(:job) { create(:ci_build, user: user) }
subject { find_user_from_bearer_token }
context 'when the token is passed as an oauth token' do
......@@ -107,6 +108,7 @@ describe Gitlab::Auth::AuthFinders do
describe '#find_user_from_job_token' do
let(:job) { create(:ci_build, user: user) }
subject { find_user_from_job_token }
shared_examples 'job token disabled' do
......
......@@ -60,6 +60,7 @@ describe Gitlab::Auth::Smartcard::LDAPCertificate do
context 'user exists but it is using a new ldap certificate' do
let(:ldap_person_email) { user.email }
let_it_be(:user) { create(:user) }
it 'finds existing user' do
......
......@@ -176,6 +176,7 @@ describe Gitlab::Ci::Reports::LicenseScanning::Report do
context 'when diffing two v1 reports' do
let(:base_report) { build(:license_scan_report, :version_1) }
let(:head_report) { build(:license_scan_report, :version_1) }
subject { base_report.diff_with(head_report) }
before do
......@@ -196,6 +197,7 @@ describe Gitlab::Ci::Reports::LicenseScanning::Report do
context 'when diffing two v2 reports' do
let(:base_report) { build(:license_scan_report, :version_2) }
let(:head_report) { build(:license_scan_report, :version_2) }
subject { base_report.diff_with(head_report) }
before do
......@@ -216,6 +218,7 @@ describe Gitlab::Ci::Reports::LicenseScanning::Report do
context 'when diffing a v1 report with a v2 report' do
let(:base_report) { build(:license_scan_report, :version_1) }
let(:head_report) { build(:license_scan_report, :version_2) }
subject { base_report.diff_with(head_report) }
before do
......@@ -236,6 +239,7 @@ describe Gitlab::Ci::Reports::LicenseScanning::Report do
context 'when diffing a v2 report with a v1 report' do
let(:base_report) { build(:license_scan_report, :version_2) }
let(:head_report) { build(:license_scan_report, :version_1) }
subject { base_report.diff_with(head_report) }
before do
......
......@@ -21,6 +21,7 @@ describe Gitlab::Elastic::ProjectSearchResults, :elastic do
describe 'initialize with ref' do
let(:ref) { 'refs/heads/test' }
subject(:results) { described_class.new(user, query, project.id, ref) }
it { expect(results.project).to eq(project) }
......
......@@ -639,6 +639,7 @@ describe Gitlab::Elastic::SearchResults, :elastic, :sidekiq_might_not_need_inlin
describe 'Wikis' do
let(:results) { described_class.new(user, 'term', limit_project_ids) }
subject(:wiki_blobs) { results.objects('wiki_blobs') }
before do
......
......@@ -6,6 +6,7 @@ describe Gitlab::Geo::EventGapTracking, :clean_gitlab_redis_cache do
let(:previous_event_id) { 7 }
let(:gap_id) { previous_event_id + 1 }
let(:event_id_with_gap) { previous_event_id + 2 }
subject(:gap_tracking) { described_class.new }
before do
......
......@@ -8,6 +8,7 @@ describe Gitlab::Geo::GitPushHttp, :geo, :use_clean_rails_memory_store_caching d
let(:gl_id) { 'user-1234' }
let(:gl_repository) { 'project-77777' }
let(:cache_key) { "#{described_class::CACHE_KEY_PREFIX}:#{gl_id}:#{gl_repository}" }
set(:secondary) { create(:geo_node) }
subject { described_class.new(gl_id, gl_repository) }
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::JobArtifactRetriever, :geo do
context '#execute' do
let(:retriever) { described_class.new(job_artifact.id, {}) }
subject { retriever.execute }
context 'when the job artifact exists' do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::IpAddressState do
let(:address) { '1.1.1.1' }
describe '.with' do
it 'saves IP address' do
described_class.with(address) do
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
describe Gitlab::Prometheus::Queries::ClusterQuery do
let(:client) { double('prometheus_client', query_range: nil) }
subject { described_class.new(client) }
around do |example|
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
describe Gitlab::Prometheus::Queries::ValidateQuery do
let(:client) { double('prometheus_client') }
let(:query) { 'avg(metric)' }
subject { described_class.new(client) }
context 'valid query' do
......@@ -21,6 +22,7 @@ describe Gitlab::Prometheus::Queries::ValidateQuery do
context 'invalid query' do
let(:message) { 'message' }
before do
allow(client).to receive(:query).with(query).and_raise(Gitlab::PrometheusClient::QueryError.new(message))
end
......
......@@ -10,6 +10,7 @@ describe Pseudonymizer::Dumper do
config: YAML.load_file(Gitlab.config.pseudonymizer.manifest)
)
end
subject(:pseudo) { described_class.new(options) }
before do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
describe Pseudonymizer::Pager do
let(:page_size) { 1 }
let!(:projects) { create_list(:project, 10) }
subject { described_class.new("projects", whitelisted_columns) }
before do
......
......@@ -10,6 +10,7 @@ describe Pseudonymizer::Uploader do
)
end
let(:remote_directory) { subject.send(:remote_directory) }
subject { described_class.new(options) }
def mock_file(file_name)
......
......@@ -122,6 +122,7 @@ describe Notify do
describe 'that are approved' do
let(:last_approver) { create(:user) }
subject { described_class.approved_merge_request_email(recipient.id, merge_request.id, last_approver.id) }
before do
......@@ -185,6 +186,7 @@ describe Notify do
describe 'that are unapproved' do
let(:last_unapprover) { create(:user) }
subject { described_class.unapproved_merge_request_email(recipient.id, merge_request.id, last_unapprover.id) }
before do
......@@ -239,6 +241,7 @@ describe Notify do
context 'for merge requests without assignee' do
describe 'that are unapproved' do
let(:last_unapprover) { create(:user) }
subject { described_class.unapproved_merge_request_email(recipient.id, merge_request_without_assignee.id, last_unapprover.id) }
before do
......
......@@ -11,6 +11,7 @@ describe Approvable do
describe '#approval_feature_available?' do
let(:project) { create(:project) }
let(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
subject { merge_request.approval_feature_available? }
it 'is false when feature is disabled' do
......
......@@ -207,6 +207,7 @@ describe DesignManagement::Version do
describe '#author' do
let(:author) { create(:user) }
subject(:version) { create(:design_version, :committed, author: author) }
it { is_expected.to have_attributes(author: author) }
......
......@@ -36,6 +36,7 @@ describe List do
context 'when it is a milestone type' do
let(:milestone) { build(:milestone, title: 'awesome-release') }
subject { described_class.new(list_type: :milestone, milestone: milestone, board: board) }
it { is_expected.to be_destroyable }
......
......@@ -159,6 +159,7 @@ describe GitlabSubscription do
describe '#expired?' do
let(:gitlab_subscription) { create(:gitlab_subscription, end_date: end_date) }
subject { gitlab_subscription.expired? }
context 'when end_date is expired' do
......
......@@ -266,6 +266,7 @@ describe Issue do
describe '#promoted?' do
let(:issue) { create(:issue) }
subject { issue.promoted? }
context 'issue not promoted' do
......@@ -487,6 +488,7 @@ describe Issue do
describe 'current designs' do
let(:issue) { create(:issue) }
subject { issue.designs.current }
context 'an issue has no designs' do
......
......@@ -304,6 +304,7 @@ describe License do
describe '.plan_includes_feature?' do
let(:feature) { :deploy_board }
subject { described_class.plan_includes_feature?(plan, feature) }
context 'when addon included' do
......@@ -669,6 +670,7 @@ describe License do
context 'when the license is the very first trial' do
let(:tomorrow) { Date.tomorrow }
before do
gl_license.restrictions = { trial: true }
gl_license.expires_at = tomorrow
......@@ -689,6 +691,7 @@ describe License do
context 'when the license is a repeated trial' do
let(:yesterday) { Date.yesterday }
before do
gl_license.restrictions = { trial: true }
gl_license.expires_at = Date.tomorrow
......
......@@ -335,6 +335,7 @@ describe MergeRequest do
let(:project) { create(:project, :repository) }
let(:current_user) { project.users.take }
let(:merge_request) { create(:merge_request, source_project: project) }
subject { merge_request.calculate_reactive_cache(service_class_name, current_user&.id) }
context 'when given a known service class name' do
......@@ -713,6 +714,7 @@ describe MergeRequest do
context 'when using approvals' do
let(:user) { create(:user) }
before do
allow(subject).to receive(:mergeable_state?).and_return(true)
......
......@@ -620,6 +620,7 @@ describe Namespace do
describe '#shared_runners_remaining_minutes_percent' do
let(:namespace) { build(:namespace) }
subject { namespace.shared_runners_remaining_minutes_percent }
it 'returns the minutes left as a percent of the limit' do
......@@ -666,6 +667,7 @@ describe Namespace do
describe '#shared_runners_remaining_minutes_below_threshold?' do
let(:namespace) { build(:namespace, last_ci_minutes_usage_notification_level: 30) }
subject { namespace.shared_runners_remaining_minutes_below_threshold? }
it 'is true when minutes left is below the notification level' do
......
......@@ -23,6 +23,7 @@ ICON_STATUS_HTML
describe '#calculate_reactive_cache' do
let(:pass_unstable) { '0' }
before do
@service = JenkinsDeprecatedService.new
allow(@service).to receive_messages(
......@@ -73,6 +74,7 @@ ICON_STATUS_HTML
describe 'multiproject enabled' do
let!(:project) { create(:project) }
before do
@service = JenkinsDeprecatedService.new
allow(@service).to receive_messages(
......
......@@ -1767,6 +1767,7 @@ describe Project do
describe '#object_pool_missing?' do
let(:pool) { create(:pool_repository, :ready) }
subject { create(:project, :repository, pool_repository: pool) }
it 'returns true when object pool is missing' do
......
......@@ -657,6 +657,7 @@ describe User do
context 'namespace with input name exists' do
let(:name) { 'Disney' }
before do
create(:user, name: 'disney')
end
......@@ -670,6 +671,7 @@ describe User do
context 'namespace with input name and suffix exists' do
let(:name) { 'Disney' }
before do
create(:user, name: 'disney')
create(:user, name: 'disney1')
......
......@@ -4,6 +4,7 @@ require 'spec_helper'
describe Clusters::InstancePolicy do
let(:user) { create(:admin) }
subject { described_class.new(user, Clusters::Instance.new) }
context 'when cluster deployments is available' do
......
......@@ -138,6 +138,7 @@ describe GroupPolicy do
context 'with sso enforcement enabled' do
let(:current_user) { guest }
let_it_be(:saml_provider) { create(:saml_provider, group: group, enforced_sso: true) }
context 'when the session has been set globally' do
......
......@@ -105,6 +105,7 @@ describe 'Updating an Epic' do
context 'when changing labels of the epic' do
let(:attributes) { { add_label_ids: [label_1.id, label_3.id], remove_label_ids: label_2.id } }
it 'adds and removes labels correctly' do
post_graphql_mutation(mutation, current_user: current_user)
......
......@@ -27,6 +27,7 @@ describe API::Issues, :mailer do
title: issue_title,
description: issue_description
end
set(:milestone) { create(:milestone, title: '1.0.0', project: project) }
before(:all) do
......
......@@ -9,6 +9,7 @@ describe API::ProjectImport do
let(:user) { create(:user) }
let(:file) { File.join('spec', 'features', 'projects', 'import_export', 'test_project_export.tar.gz') }
let(:namespace) { create(:group) }
before do
allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
......
......@@ -6,6 +6,7 @@ describe API::Todos do
set(:group) { create(:group) }
let(:user) { create(:user) }
let(:epic) { create(:epic, group: group) }
set(:project) { create(:project, group: group) }
describe 'GET /todos' do
......
......@@ -67,6 +67,7 @@ describe "Git HTTP requests (Geo)", :geo do
context 'no Geo JWT token' do
let(:env) { workhorse_internal_api_request_header }
it { is_expected.to have_gitlab_http_status(:unauthorized) }
end
......
......@@ -11,6 +11,7 @@ describe EpicNoteEntity do
let(:epic) { create(:epic, author: user) }
let(:note) { create(:note, noteable: epic, author: user) }
let(:user) { create(:user) }
subject { entity.as_json }
it_behaves_like 'note entity'
......
......@@ -10,6 +10,7 @@ describe Boards::Lists::CreateService do
context 'when assignee_id param is sent' do
let(:other_user) { create(:user) }
subject(:service) { described_class.new(project, user, 'assignee_id' => other_user.id) }
before do
......@@ -30,6 +31,7 @@ describe Boards::Lists::CreateService do
context 'when milestone_id param is sent' do
let(:user) { create(:user) }
let(:milestone) { create(:milestone, project: project) }
subject(:service) { described_class.new(project, user, 'milestone_id' => milestone.id) }
before do
......
......@@ -5,6 +5,7 @@ require 'spec_helper'
describe FetchSubscriptionPlansService do
describe '#execute' do
let(:endpoint_url) { 'https://customers.gitlab.com/gitlab_plans' }
subject { described_class.new(plan: 'bronze').execute }
context 'when successully fetching plans data' do
......
......@@ -3,6 +3,7 @@ require 'spec_helper'
describe Licenses::DestroyService do
let(:license) { create(:license) }
set(:user) { create(:admin) }
def destroy_with(user)
......
......@@ -106,6 +106,7 @@ describe MergeRequests::ApprovalService do
let(:params) do
{ approval_password: 'incorrect' }
end
it 'raises an error' do
service_with_params = described_class.new(project, user, params)
expect { service_with_params.execute(merge_request) }.to raise_error(::MergeRequests::ApprovalService::IncorrectApprovalPasswordError)
......@@ -116,6 +117,7 @@ describe MergeRequests::ApprovalService do
let(:params) do
{ approval_password: 'password' }
end
it 'does not raise an error' do
service_with_params = described_class.new(project, user, params)
expect { service_with_params.execute(merge_request) }.not_to raise_error(::MergeRequests::ApprovalService::IncorrectApprovalPasswordError)
......
......@@ -7,6 +7,7 @@ describe PersonalAccessTokens::RevokeInvalidTokens do
describe '#execute' do
let(:expiration_date) { 10.days.from_now }
let_it_be(:user) { create(:user) }
let_it_be(:pat) { create(:personal_access_token, expires_at: 5.days.from_now, user: user) }
let_it_be(:invalid_pat1) { create(:personal_access_token, expires_at: nil, user: user) }
......
......@@ -565,6 +565,7 @@ describe QuickActions::InterpretService do
context 'when child and parent epics are in different groups' do
let(:child_epic) { create(:epic, group: group, parent: epic) }
context 'when child epic is in a parent group of the parent epic' do
before do
epic.update!(group: subgroup)
......
......@@ -86,6 +86,7 @@ describe Search::GroupService, :elastic do
{ project_level: :internal, feature_access_level: :enabled, membership: :guest, expected_count: 1 }
]
end
where(:project_level, :feature_access_level, :membership, :expected_count) do
permission_table_for_reporter_feature_access
end
......
......@@ -24,6 +24,7 @@ RSpec.shared_examples 'additional custom metrics query' do
context 'with custom metrics' do
let!(:metric) { create(:prometheus_metric, project: project) }
before do
allow(client).to receive(:query_range).with('avg(metric)', any_args).and_return(query_range_result)
end
......
......@@ -73,6 +73,7 @@ shared_examples 'returns paginated packages' do
context 'when viewing the first page' do
let(:page) { 1 }
it 'returns first 2 packages' do
get api(url, user), params: { page: page, per_page: per_page }
......@@ -82,6 +83,7 @@ shared_examples 'returns paginated packages' do
context 'when viewing the second page' do
let(:page) { 2 }
it 'returns first 2 packages' do
get api(url, user), params: { page: page, per_page: per_page }
......
......@@ -7,6 +7,7 @@ shared_examples 'report list' do
end
let(:request) { double('request') }
set(:project) { create(:project, :repository, :private) }
set(:developer) { create(:user) }
......
......@@ -6,6 +6,7 @@ describe EE::RepositoryCheck::BatchWorker do
include ::EE::GeoHelpers
let(:shard_name) { 'default' }
subject(:worker) { RepositoryCheck::BatchWorker.new }
before do
......
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