Commit 2711b46e authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '198581-fix_rspec_cops' into 'master'

Fix RSpec cop violations

Closes #198581

See merge request gitlab-org/gitlab!24538
parents c7d01d56 363e774d
......@@ -660,129 +660,3 @@ Style/UnneededCondition:
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Enabled: false
RSpec/ReceiveCounts:
Exclude:
- 'ee/spec/models/broadcast_message_spec.rb'
- 'ee/spec/services/geo/project_housekeeping_service_spec.rb'
- 'ee/spec/services/geo/repository_sync_service_spec.rb'
- 'spec/lib/gitlab/ci/build/rules/rule/clause/exists_spec.rb'
- 'spec/lib/gitlab/ci/trace/section_parser_spec.rb'
- 'spec/lib/gitlab/cleanup/project_uploads_spec.rb'
- 'spec/lib/gitlab/danger/teammate_spec.rb'
- 'spec/lib/gitlab/git_access_spec.rb'
- 'spec/lib/gitlab/gpg_spec.rb'
- 'spec/lib/gitlab/legacy_github_import/importer_spec.rb'
- 'spec/lib/gitlab/sanitizers/exif_spec.rb'
- 'spec/models/concerns/avatarable_spec.rb'
- 'spec/models/concerns/triggerable_hooks_spec.rb'
- 'spec/requests/api/graphql_spec.rb'
- 'spec/services/ci/ensure_stage_service_spec.rb'
- 'spec/services/clusters/cleanup/app_service_spec.rb'
- 'spec/services/notification_service_spec.rb'
- 'spec/services/projects/housekeeping_service_spec.rb'
- 'spec/tasks/gitlab/cleanup_rake_spec.rb'
- 'spec/uploaders/gitlab_uploader_spec.rb'
- 'spec/workers/create_gpg_signature_worker_spec.rb'
RSpec/ContextMethod:
Exclude:
- 'ee/spec/controllers/ee/projects/autocomplete_sources_controller_spec.rb'
- 'ee/spec/controllers/groups/autocomplete_sources_controller_spec.rb'
- 'ee/spec/finders/geo/file_registry_finder_spec.rb'
- 'ee/spec/helpers/feature_flags_helper_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules_spec.rb'
- 'ee/spec/lib/ee/gitlab/ci/config/entry/trigger_spec.rb'
- 'ee/spec/lib/elastic/latest/snippet_instance_proxy_spec.rb'
- 'ee/spec/lib/gitlab/contribution_analytics/data_collector_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/file_transfer_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/job_artifact_downloader_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/job_artifact_retriever_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/job_artifact_transfer_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/lfs_downloader_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/lfs_retriever_spec.rb'
- 'ee/spec/lib/gitlab/geo/replication/lfs_transfer_spec.rb'
- 'ee/spec/lib/gitlab/geo_spec.rb'
- 'ee/spec/models/approval_state_spec.rb'
- 'ee/spec/models/approval_wrapped_any_approver_rule_spec.rb'
- 'ee/spec/models/concerns/approval_rule_like_spec.rb'
- 'ee/spec/models/concerns/elastic/issue_spec.rb'
- 'ee/spec/models/concerns/elastic/note_spec.rb'
- 'ee/spec/models/concerns/elastic/project_spec.rb'
- 'ee/spec/models/concerns/epic_tree_sorting_spec.rb'
- 'ee/spec/models/concerns/has_timelogs_report_spec.rb'
- 'ee/spec/models/ee/clusters/applications/prometheus_spec.rb'
- 'ee/spec/models/ee/clusters/platforms/kubernetes_spec.rb'
- 'ee/spec/models/user_spec.rb'
- 'ee/spec/presenters/ci/pipeline_presenter_spec.rb'
- 'ee/spec/requests/api/epics_spec.rb'
- 'ee/spec/services/boards/update_service_spec.rb'
- 'ee/spec/services/ee/boards/issues/list_service_spec.rb'
- 'ee/spec/services/ee/merge_requests/refresh_service_spec.rb'
- 'ee/spec/services/groups/update_service_spec.rb'
- 'ee/spec/services/projects/create_from_template_service_spec.rb'
- 'ee/spec/services/projects/update_service_spec.rb'
- 'ee/spec/services/update_build_minutes_service_spec.rb'
- 'ee/spec/support/shared_examples/features/gold_trial_callout_shared_examples.rb'
- 'ee/spec/support/shared_examples/models/concerns/elastic/limited_indexing_shared_examples.rb'
- 'qa/spec/ee/scenario/test/integration/group_saml_spec.rb'
- 'qa/spec/resource/api_fabricator_spec.rb'
- 'qa/spec/scenario/test/integration/github_spec.rb'
- 'qa/spec/scenario/test/integration/instance_saml_spec.rb'
- 'qa/spec/scenario/test/integration/kubernetes_spec.rb'
- 'qa/spec/scenario/test/integration/ldap_spec.rb'
- 'qa/spec/scenario/test/integration/mattermost_spec.rb'
- 'qa/spec/scenario/test/integration/oauth_spec.rb'
- 'qa/spec/scenario/test/integration/object_storage_spec.rb'
- 'qa/spec/specs/runner_spec.rb'
- 'spec/controllers/application_controller_spec.rb'
- 'spec/controllers/projects/milestones_controller_spec.rb'
- 'spec/features/projects/blobs/blob_show_spec.rb'
- 'spec/finders/concerns/finder_with_cross_project_access_spec.rb'
- 'spec/helpers/diff_helper_spec.rb'
- 'spec/helpers/nav_helper_spec.rb'
- 'spec/helpers/sourcegraph_helper_spec.rb'
- 'spec/lib/container_registry/registry_spec.rb'
- 'spec/lib/container_registry/tag_spec.rb'
- 'spec/lib/gitlab/ci/trace/chunked_io_spec.rb'
- 'spec/lib/gitlab/content_security_policy/config_loader_spec.rb'
- 'spec/lib/gitlab/database/count_spec.rb'
- 'spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb'
- 'spec/lib/gitlab/git_ref_validator_spec.rb'
- 'spec/lib/gitlab/private_commit_email_spec.rb'
- 'spec/lib/gitlab/rugged_instrumentation_spec.rb'
- 'spec/lib/omni_auth/strategies/jwt_spec.rb'
- 'spec/lib/safe_zip/entry_spec.rb'
- 'spec/lib/safe_zip/extract_spec.rb'
- 'spec/models/badge_spec.rb'
- 'spec/models/badges/project_badge_spec.rb'
- 'spec/models/ci/artifact_blob_spec.rb'
- 'spec/models/ci/persistent_ref_spec.rb'
- 'spec/models/ci/runner_spec.rb'
- 'spec/models/concerns/routable_spec.rb'
- 'spec/models/deployment_spec.rb'
- 'spec/models/issue_spec.rb'
- 'spec/models/notification_recipient_spec.rb'
- 'spec/models/project_services/bamboo_service_spec.rb'
- 'spec/models/project_services/buildkite_service_spec.rb'
- 'spec/models/project_services/chat_message/issue_message_spec.rb'
- 'spec/models/project_services/drone_ci_service_spec.rb'
- 'spec/models/project_services/hipchat_service_spec.rb'
- 'spec/models/project_services/jira_service_spec.rb'
- 'spec/models/project_spec.rb'
- 'spec/models/remote_mirror_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/models/wiki_page_spec.rb'
- 'spec/requests/api/issues/get_group_issues_spec.rb'
- 'spec/requests/api/merge_requests_spec.rb'
- 'spec/serializers/diff_file_entity_spec.rb'
- 'spec/services/branches/delete_merged_service_spec.rb'
- 'spec/services/labels/available_labels_service_spec.rb'
- 'spec/services/projects/batch_open_issues_count_service_spec.rb'
- 'spec/services/projects/destroy_service_spec.rb'
- 'spec/services/projects/hashed_storage/migrate_attachments_service_spec.rb'
- 'spec/services/projects/hashed_storage/rollback_attachments_service_spec.rb'
- 'spec/services/projects/open_issues_count_service_spec.rb'
- 'spec/services/quick_actions/interpret_service_spec.rb'
- 'spec/support/shared_examples/services/boards/issues_list_service_shared_examples.rb'
- 'spec/uploaders/namespace_file_uploader_spec.rb'
......@@ -26,7 +26,7 @@ describe Projects::AutocompleteSourcesController do
stub_licensed_features(epics: true)
end
context '#epics' do
describe '#epics' do
it 'returns the correct response' do
get :epics, params: { namespace_id: project.namespace, project_id: project }
......
......@@ -13,7 +13,7 @@ describe Groups::AutocompleteSourcesController do
sign_in(user)
end
context '#epics' do
describe '#epics' do
it 'returns 200 status' do
get :epics, params: { group_id: group }
......@@ -30,7 +30,7 @@ describe Groups::AutocompleteSourcesController do
end
end
context '#milestones' do
describe '#milestones' do
it 'returns correct response' do
parent_group = create(:group, :private)
group.update!(parent: parent_group)
......@@ -49,7 +49,7 @@ describe Groups::AutocompleteSourcesController do
end
end
context '#commands' do
describe '#commands' do
it 'returns 200 status' do
get :commands, params: { group_id: group, type: 'Epic', type_id: epic.iid }
......
......@@ -24,7 +24,7 @@ describe Geo::FileRegistryFinder, :geo, :geo_fdw do
end
end
context '#local_storage_only?' do
describe '#local_storage_only?' do
subject { described_class.new(current_node_id: geo_node.id) }
context 'sync_object_storage is enabled' do
......
......@@ -5,13 +5,13 @@ require 'spec_helper'
describe FeatureFlagsHelper do
let_it_be(:project) { create(:project) }
context '#unleash_api_url' do
describe '#unleash_api_url' do
subject { helper.unleash_api_url(project) }
it { is_expected.to end_with("/api/v4/feature_flags/unleash/#{project.id}") }
end
context '#unleash_api_instance_id' do
describe '#unleash_api_instance_id' do
subject { helper.unleash_api_instance_id(project) }
it { is_expected.not_to be_empty }
......
......@@ -195,7 +195,7 @@ describe Gitlab::BackgroundMigration::MigrateApproverToApprovalRules do
end
end
context '#sync_code_owners_with_approvers' do
describe '#sync_code_owners_with_approvers' do
let(:owners) { create_list(:user, 2) }
before do
......
......@@ -82,7 +82,7 @@ describe EE::Gitlab::Ci::Config::Entry::Trigger do
end
end
context '#include' do
describe '#include' do
context 'with simple include' do
let(:config) { { include: 'path/to/config.yml' } }
......
......@@ -7,7 +7,7 @@ describe Elastic::Latest::SnippetInstanceProxy do
subject { described_class.new(snippet) }
context '#as_indexed_json' do
describe '#as_indexed_json' do
it 'serializes snippet as hash' do
expect(subject.as_indexed_json.with_indifferent_access).to include(
id: snippet.id,
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Gitlab::ContributionAnalytics::DataCollector do
context '#totals' do
describe '#totals' do
it 'collects event counts grouped by users by calling #base_query' do
group = create(:group)
user = create(:user)
......
......@@ -28,7 +28,7 @@ describe Gitlab::Geo::Replication::FileTransfer do
end
end
context '#download_from_primary' do
describe '#download_from_primary' do
before do
stub_current_geo_node(secondary_node)
end
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::JobArtifactDownloader, :geo do
let(:job_artifact) { create(:ci_job_artifact) }
context '#execute' do
describe '#execute' do
context 'with job artifact' do
it 'returns a FileDownloader::Result object' do
downloader = described_class.new(:job_artifact, job_artifact.id)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Gitlab::Geo::Replication::JobArtifactRetriever, :geo do
context '#execute' do
describe '#execute' do
let(:retriever) { described_class.new(job_artifact.id, {}) }
subject { retriever.execute }
......
......@@ -13,7 +13,7 @@ describe Gitlab::Geo::Replication::JobArtifactTransfer, :geo do
described_class.new(job_artifact)
end
context '#initialize' do
describe '#initialize' do
it 'sets file_type to :ci_trace' do
expect(subject.file_type).to eq(:job_artifact)
end
......@@ -35,7 +35,7 @@ describe Gitlab::Geo::Replication::JobArtifactTransfer, :geo do
end
end
context '#download_from_primary' do
describe '#download_from_primary' do
before do
stub_current_geo_node(secondary_node)
end
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::Geo::Replication::LfsDownloader, :geo do
let(:lfs_object) { create(:lfs_object) }
context '#execute' do
describe '#execute' do
context 'with LFS object' do
it 'returns a FileDownloader::Result object' do
downloader = described_class.new(:lfs, lfs_object.id)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Gitlab::Geo::Replication::LfsRetriever, :geo do
context '#execute' do
describe '#execute' do
subject { retriever.execute }
context 'when the LFS object exists' do
......
......@@ -13,7 +13,7 @@ describe Gitlab::Geo::Replication::LfsTransfer do
described_class.new(lfs_object)
end
context '#download_from_primary' do
describe '#download_from_primary' do
before do
stub_current_geo_node(secondary_node)
end
......
......@@ -288,7 +288,7 @@ describe Gitlab::Geo, :geo, :request_store do
end
end
context '.allowed_ip?' do
describe '.allowed_ip?' do
where(:allowed_ips, :ip, :allowed) do
"192.1.1.1" | "192.1.1.1" | true
"192.1.1.1, 192.1.2.1" | "192.1.2.1" | true
......
......@@ -99,7 +99,7 @@ describe ApprovalState do
it { expect(subject.can_approve?(nil)).to be_falsey }
end
context '#approval_rules_overwritten?' do
describe '#approval_rules_overwritten?' do
context 'when approval rule on the merge request does not exist' do
it 'returns false' do
expect(subject.approval_rules_overwritten?).to eq(false)
......
......@@ -19,7 +19,7 @@ describe ApprovalWrappedAnyApproverRule do
create(:approval, merge_request: merge_request, user: approver2)
end
context '#approvals_approvers' do
describe '#approvals_approvers' do
it 'contains every approved user' do
expect(subject.approved_approvers).to contain_exactly(approver1, approver2)
end
......
......@@ -8,7 +8,7 @@ describe BroadcastMessage do
describe '.current', :use_clean_rails_memory_store_caching do
context 'without Geo' do
it 'caches the output of the query for two weeks' do
expect(Gitlab::Geo).to receive(:enabled?).and_return(false).exactly(2).times
expect(Gitlab::Geo).to receive(:enabled?).and_return(false).twice
create(:broadcast_message)
......@@ -25,7 +25,7 @@ describe BroadcastMessage do
context 'with Geo' do
context 'on the primary' do
it 'caches the output of the query for two weeks' do
expect(Gitlab::Geo).to receive(:enabled?).and_return(false).exactly(2).times
expect(Gitlab::Geo).to receive(:enabled?).and_return(false).twice
create(:broadcast_message)
......
......@@ -91,7 +91,7 @@ describe ApprovalRuleLike do
it_behaves_like 'approval rule like'
end
context '.group_users' do
describe '.group_users' do
subject { create(:approval_project_rule) }
it 'returns distinct users' do
......
......@@ -19,7 +19,7 @@ describe Issue, :elastic do
end
context 'when the project is not enabled specifically' do
context '#searchable?' do
describe '#searchable?' do
it 'returns false' do
expect(issue.searchable?).to be_falsey
end
......@@ -31,7 +31,7 @@ describe Issue, :elastic do
create :elasticsearch_indexed_project, project: project
end
context '#searchable?' do
describe '#searchable?' do
it 'returns true' do
expect(issue.searchable?).to be_truthy
end
......@@ -45,7 +45,7 @@ describe Issue, :elastic do
create :elasticsearch_indexed_namespace, namespace: group
end
context '#searchable?' do
describe '#searchable?' do
it 'returns true' do
project = create :project, name: 'test1', group: group
issue = create :issue, project: project
......
......@@ -15,7 +15,7 @@ describe Note, :elastic do
create :note, project: project
end
context '#searchable?' do
describe '#searchable?' do
before do
create :elasticsearch_indexed_project, project: project
end
......
......@@ -15,13 +15,13 @@ describe Project, :elastic do
end
context 'when the project is not enabled specifically' do
context '#searchable?' do
describe '#searchable?' do
it 'returns false' do
expect(project.searchable?).to be_falsey
end
end
context '#use_elasticsearch?' do
describe '#use_elasticsearch?' do
it 'returns false' do
expect(project.use_elasticsearch?).to be_falsey
end
......@@ -33,13 +33,13 @@ describe Project, :elastic do
create :elasticsearch_indexed_project, project: project
end
context '#searchable?' do
describe '#searchable?' do
it 'returns true' do
expect(project.searchable?).to be_truthy
end
end
context '#use_elasticsearch?' do
describe '#use_elasticsearch?' do
it 'returns true' do
expect(project.use_elasticsearch?).to be_truthy
end
......@@ -68,7 +68,7 @@ describe Project, :elastic do
create :elasticsearch_indexed_namespace, namespace: group
end
context '#searchable?' do
describe '#searchable?' do
it 'returns true' do
project = create :project, name: 'test1', group: group
......
......@@ -12,7 +12,7 @@ describe EpicTreeSorting do
let!(:epic2) { create(:epic, parent: base_epic, group: group, relative_position: 1000) }
let!(:epic3) { create(:epic, parent: base_epic, group: group, relative_position: 1001) }
context '#move_after' do
describe '#move_after' do
it 'moves an epic' do
epic1.move_after(epic_issue2)
......@@ -27,7 +27,7 @@ describe EpicTreeSorting do
end
end
context '#move_before' do
describe '#move_before' do
it 'moves an epic' do
epic2.move_before(epic_issue2)
......@@ -41,7 +41,7 @@ describe EpicTreeSorting do
end
end
context '#move_between' do
describe '#move_between' do
it 'moves an epic' do
epic1.move_between(epic_issue1, epic_issue2)
......@@ -55,7 +55,7 @@ describe EpicTreeSorting do
end
end
context '#move_sequence' do
describe '#move_sequence' do
let!(:epic_issue1) { create(:epic_issue, epic: base_epic, relative_position: 1000) }
let!(:epic_issue2) { create(:epic_issue, epic: base_epic, relative_position: 1001) }
let!(:epic_issue3) { create(:epic_issue, epic: base_epic, relative_position: 1004) }
......
......@@ -7,7 +7,7 @@ describe HasTimelogsReport do
let(:group) { create(:group) }
let(:issue) { create(:issue, project: create(:project, :public, group: group)) }
context '#timelogs' do
describe '#timelogs' do
let!(:timelog1) { create_timelog(15.days.ago) }
let!(:timelog2) { create_timelog(10.days.ago) }
let!(:timelog3) { create_timelog(5.days.ago) }
......@@ -31,7 +31,7 @@ describe HasTimelogsReport do
end
end
context '#user_can_access_group_timelogs?' do
describe '#user_can_access_group_timelogs?' do
before do
group.add_developer(user)
stub_licensed_features(group_timelogs: true)
......
......@@ -16,7 +16,7 @@ describe Clusters::Applications::Prometheus do
end
end
context '#updated_since?' do
describe '#updated_since?' do
let(:cluster) { create(:cluster) }
let(:prometheus_app) { build(:clusters_applications_prometheus, cluster: cluster) }
let(:timestamp) { Time.now - 5.minutes }
......
......@@ -310,7 +310,7 @@ describe Clusters::Platforms::Kubernetes do
end
end
context '#reactive_cache_updated' do
describe '#reactive_cache_updated' do
let(:opts) do
{
'environment_id' => environment.id,
......
......@@ -138,7 +138,7 @@ describe User do
end
end
context '#auditor?' do
describe '#auditor?' do
it "returns true for an auditor user if the addon is enabled" do
stub_licensed_features(auditor_user: true)
......
......@@ -338,7 +338,7 @@ describe API::Epics do
expect_paginated_array_response(epic.id)
end
context "#to_reference" do
describe "#to_reference" do
it 'exposes reference path' do
get api(url)
......
......@@ -66,7 +66,7 @@ describe Boards::UpdateService, services: true do
end
end
context '#set_labels' do
describe '#set_labels' do
def expect_label_assigned(user, board, input_labels, expected_labels)
service = described_class.new(board.resource_parent, user, labels: input_labels.join(','))
service.execute(board)
......
......@@ -78,7 +78,7 @@ describe Boards::Issues::ListService, services: true do
end
end
context '#metadata' do
describe '#metadata' do
it 'returns issues count and weight for list' do
params = { board_id: board.id, id: backlog.id }
......
......@@ -60,7 +60,7 @@ describe MergeRequests::RefreshService do
end
end
context '#update_approvers' do
describe '#update_approvers' do
let(:owner) { create(:user) }
let(:current_user) { merge_request.author }
let(:service) { described_class.new(project, current_user) }
......
......@@ -53,7 +53,7 @@ describe Geo::ProjectHousekeepingService do
# At fetch 200
expect(GitGarbageCollectWorker).to receive(:perform_async).with(project.id, :gc, :the_lease_key, :the_uuid)
.exactly(1).times
.once
# At fetch 50, 100, 150
expect(GitGarbageCollectWorker).to receive(:perform_async).with(project.id, :full_repack, :the_lease_key, :the_uuid)
.exactly(3).times
......
......@@ -323,9 +323,9 @@ describe Geo::RepositorySyncService do
create(:geo_project_registry, project: project, repository_retry_count: Geo::ProjectRegistry::RETRIES_BEFORE_REDOWNLOAD + 1)
expect(subject).to receive(:sync_repository).and_call_original
expect(subject.gitlab_shell).to receive(:mv_repository).exactly(2).times.and_call_original
expect(subject.gitlab_shell).to receive(:mv_repository).twice.and_call_original
expect(subject.gitlab_shell).to receive(:remove_repository).exactly(2).times.and_call_original
expect(subject.gitlab_shell).to receive(:remove_repository).twice.and_call_original
subject.execute
......
......@@ -21,7 +21,7 @@ describe Groups::UpdateService, '#execute' do
}
end
context '#visibility' do
describe '#visibility' do
before do
group.add_owner(user)
end
......
......@@ -55,7 +55,7 @@ describe Projects::CreateFromTemplateService do
stub_ee_application_setting(custom_project_templates_group_id: subgroup_1_2.id)
end
context '#execute' do
describe '#execute' do
context 'does not create project from custom template' do
after do
project = subject.execute
......
......@@ -47,7 +47,7 @@ describe Projects::UpdateService, '#execute' do
}
end
context '#name' do
describe '#name' do
include_examples 'audit event logging' do
let!(:old_name) { project.full_name }
let(:operation) { update_project(project, user, name: 'foobar') }
......@@ -67,7 +67,7 @@ describe Projects::UpdateService, '#execute' do
end
end
context '#path' do
describe '#path' do
include_examples 'audit event logging' do
let(:operation) { update_project(project, user, path: 'foobar1') }
let(:fail_condition!) do
......@@ -86,7 +86,7 @@ describe Projects::UpdateService, '#execute' do
end
end
context '#visibility' do
describe '#visibility' do
include_examples 'audit event logging' do
let(:operation) do
update_project(project, user, visibility_level: Gitlab::VisibilityLevel::INTERNAL)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe UpdateBuildMinutesService do
context '#perform' do
describe '#perform' do
let(:namespace) { create(:namespace, shared_runners_minutes_limit: 100) }
let(:project) { create(:project, namespace: namespace) }
let(:pipeline) { create(:ci_pipeline, project: project) }
......
......@@ -13,7 +13,7 @@ RSpec.shared_examples 'dashboard gold trial callout' do
expect(page).not_to have_selector '.promotion-callout'
end
context '.com' do
describe '.com' do
before do
allow(Gitlab).to receive(:com?).and_return(true)
end
......
......@@ -8,7 +8,7 @@ RSpec.shared_examples 'limited indexing is enabled' do
end
context 'when the project is not enabled specifically' do
context '#searchable?' do
describe '#searchable?' do
it 'returns false' do
expect(object.searchable?).to be_falsey
end
......@@ -20,7 +20,7 @@ RSpec.shared_examples 'limited indexing is enabled' do
create :elasticsearch_indexed_project, project: project
end
context '#searchable?' do
describe '#searchable?' do
it 'returns true' do
expect(object.searchable?).to be_truthy
end
......@@ -32,7 +32,7 @@ RSpec.shared_examples 'limited indexing is enabled' do
create :elasticsearch_indexed_namespace, namespace: group
end
context '#searchable?' do
describe '#searchable?' do
it 'returns true' do
expect(group_object.searchable?).to be_truthy
end
......
# frozen_string_literal: true
describe QA::EE::Scenario::Test::Integration::GroupSAML do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:group_saml] }
end
......
......@@ -120,7 +120,7 @@ describe QA::Resource::ApiFabricator do
end
end
context '#transform_api_resource' do
describe '#transform_api_resource' do
let(:resource) do
Class.new do
def self.name
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::Github do
context '#perform' do
describe '#perform' do
let(:env) { spy('Runtime::Env') }
before do
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::InstanceSAML do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:instance_saml] }
end
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::Kubernetes do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:kubernetes] }
end
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::LDAPNoTLS do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:ldap_no_tls] }
end
......@@ -9,7 +9,7 @@ describe QA::Scenario::Test::Integration::LDAPNoTLS do
end
describe QA::Scenario::Test::Integration::LDAPNoServer do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:ldap_no_server] }
end
......@@ -17,7 +17,7 @@ describe QA::Scenario::Test::Integration::LDAPNoServer do
end
describe QA::Scenario::Test::Integration::LDAPTLS do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:ldap_tls] }
end
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::Mattermost do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:args) { %w[gitlab_address mattermost_address] }
let(:args) do
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::OAuth do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:oauth] }
end
......
# frozen_string_literal: true
describe QA::Scenario::Test::Integration::ObjectStorage do
context '#perform' do
describe '#perform' do
it_behaves_like 'a QA scenario class' do
let(:tags) { [:object_storage] }
end
......
......@@ -11,7 +11,7 @@ describe QA::Specs::Runner do
end
end
context '#perform' do
describe '#perform' do
before do
allow(QA::Runtime::Browser).to receive(:configure!)
end
......
......@@ -896,7 +896,7 @@ describe ApplicationController do
end
end
context '#set_current_context' do
describe '#set_current_context' do
controller(described_class) do
def index
Labkit::Context.with_context do |context|
......
......@@ -245,7 +245,7 @@ describe Projects::MilestonesController do
end
end
context '#participants' do
describe '#participants' do
render_views
context "when guest user" do
......
......@@ -453,7 +453,7 @@ describe 'File blob', :js do
end
end
context '.gitlab-ci.yml' do
describe '.gitlab-ci.yml' do
before do
project.add_maintainer(project.creator)
......@@ -481,7 +481,7 @@ describe 'File blob', :js do
end
end
context '.gitlab/route-map.yml' do
describe '.gitlab/route-map.yml' do
before do
project.add_maintainer(project.creator)
......
......@@ -128,7 +128,7 @@ describe FinderWithCrossProjectAccess do
end
end
context '.finder_model' do
describe '.finder_model' do
it 'is set correctly' do
expect(finder_class.finder_model).to eq(Project)
end
......
......@@ -258,7 +258,7 @@ describe DiffHelper do
end
end
context '#render_overflow_warning?' do
describe '#render_overflow_warning?' do
let(:diffs_collection) { instance_double(Gitlab::Diff::FileCollection::MergeRequestDiff, raw_diff_files: diff_files) }
let(:diff_files) { Gitlab::Git::DiffCollection.new(files) }
let(:safe_file) { { too_large: false, diff: '' } }
......@@ -303,7 +303,7 @@ describe DiffHelper do
end
end
context '#diff_file_path_text' do
describe '#diff_file_path_text' do
it 'returns full path by default' do
expect(diff_file_path_text(diff_file)).to eq(diff_file.new_path)
end
......
......@@ -106,13 +106,13 @@ describe NavHelper, :do_not_mock_admin_mode do
end
end
context '.admin_monitoring_nav_links' do
describe '.admin_monitoring_nav_links' do
subject { helper.admin_monitoring_nav_links }
it { is_expected.to all(be_a(String)) }
end
context '.group_issues_sub_menu_items' do
describe '.group_issues_sub_menu_items' do
subject { helper.group_issues_sub_menu_items }
it { is_expected.to all(be_a(String)) }
......
......@@ -34,7 +34,7 @@ describe SourcegraphHelper do
end
end
context '#sourcegraph_experimental_message' do
describe '#sourcegraph_experimental_message' do
let(:feature_conditional) { false }
let(:public_only) { false }
......
......@@ -14,7 +14,7 @@ describe ContainerRegistry::Registry do
it { expect(subject).not_to be_nil }
context '#path' do
describe '#path' do
subject { registry.path }
context 'path from URL' do
......
......@@ -70,26 +70,26 @@ describe ContainerRegistry::Tag do
headers: { 'Content-Type' => 'application/vnd.docker.distribution.manifest.v1+prettyjws' })
end
context '#layers' do
describe '#layers' do
subject { tag.layers }
it { expect(subject.length).to eq(1) }
end
context '#total_size' do
describe '#total_size' do
subject { tag.total_size }
it { is_expected.to be_nil }
end
context 'config processing' do
context '#config' do
describe '#config' do
subject { tag.config }
it { is_expected.to be_nil }
end
context '#created_at' do
describe '#created_at' do
subject { tag.created_at }
it { is_expected.to be_nil }
......@@ -113,7 +113,7 @@ describe ContainerRegistry::Tag do
body: File.read(Rails.root + 'spec/fixtures/container_registry/config_blob_helm.json'))
end
context '#created_at' do
describe '#created_at' do
subject { tag.created_at }
it { is_expected.to be_nil }
......@@ -130,13 +130,13 @@ describe ContainerRegistry::Tag do
headers: { 'Content-Type' => 'application/vnd.docker.distribution.manifest.v2+json' })
end
context '#layers' do
describe '#layers' do
subject { tag.layers }
it { expect(subject.length).to eq(1) }
end
context '#total_size' do
describe '#total_size' do
subject { tag.total_size }
it { is_expected.to eq(2319870) }
......@@ -144,13 +144,13 @@ describe ContainerRegistry::Tag do
context 'config processing' do
shared_examples 'a processable' do
context '#config' do
describe '#config' do
subject { tag.config }
it { is_expected.not_to be_nil }
end
context '#created_at' do
describe '#created_at' do
subject { tag.created_at }
it { is_expected.not_to be_nil }
......
......@@ -18,7 +18,7 @@ describe Gitlab::Ci::Build::Rules::Rule::Clause::Exists do
before do
stub_const('Gitlab::Ci::Build::Rules::Rule::Clause::Exists::MAX_PATTERN_COMPARISONS', 2)
expect(File).to receive(:fnmatch?).exactly(2).times.and_call_original
expect(File).to receive(:fnmatch?).twice.and_call_original
end
it { is_expected.to be_truthy }
......
......@@ -12,7 +12,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
stub_feature_flags(ci_enable_live_trace: true)
end
context "#initialize" do
describe "#initialize" do
context 'when a chunk exists' do
before do
build.trace.set('ABC')
......@@ -35,7 +35,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#seek" do
describe "#seek" do
subject { chunked_io.seek(pos, where) }
before do
......@@ -66,7 +66,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#eof?" do
describe "#eof?" do
subject { chunked_io.eof? }
before do
......@@ -90,7 +90,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#each_line" do
describe "#each_line" do
let(:string_io) { StringIO.new(sample_trace_raw) }
context 'when buffer size is smaller than file size' do
......@@ -134,7 +134,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#read" do
describe "#read" do
subject { chunked_io.read(length) }
context 'when read the whole size' do
......@@ -254,7 +254,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#readline" do
describe "#readline" do
subject { chunked_io.readline }
let(:string_io) { StringIO.new(sample_trace_raw) }
......@@ -334,7 +334,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#write" do
describe "#write" do
subject { chunked_io.write(data) }
let(:data) { sample_trace_raw }
......@@ -399,7 +399,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#truncate" do
describe "#truncate" do
let(:offset) { 10 }
context 'when data does not exist' do
......@@ -432,7 +432,7 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
end
end
context "#destroy!" do
describe "#destroy!" do
subject { chunked_io.destroy! }
before do
......
......@@ -74,7 +74,7 @@ describe Gitlab::Ci::Trace::SectionParser do
let(:lines) { build_lines(trace) }
it 'must handle correctly byte positioning' do
expect(subject).to receive(:find_next_marker).exactly(2).times.and_call_original
expect(subject).to receive(:find_next_marker).twice.and_call_original
subject.parse!
......
......@@ -8,8 +8,8 @@ describe Gitlab::Cleanup::ProjectUploads do
let(:logger) { double(:logger) }
before do
allow(logger).to receive(:info).at_least(1).times
allow(logger).to receive(:debug).at_least(1).times
allow(logger).to receive(:info).at_least(:once)
allow(logger).to receive(:debug).at_least(:once)
end
describe '#run!' do
......
......@@ -19,7 +19,7 @@ describe Gitlab::ContentSecurityPolicy::ConfigLoader do
}
end
context '.default_settings_hash' do
describe '.default_settings_hash' do
it 'returns empty defaults' do
settings = described_class.default_settings_hash
......@@ -33,7 +33,7 @@ describe Gitlab::ContentSecurityPolicy::ConfigLoader do
end
end
context '#load' do
describe '#load' do
subject { described_class.new(csp_config[:directives]) }
def expected_config(directive)
......
......@@ -176,7 +176,7 @@ describe Gitlab::Danger::Teammate do
it 'returns true if request fails' do
expect(Gitlab::Danger::RequestHelper).to receive(:http_get_json)
.exactly(2).times
.twice
.and_raise(Gitlab::Danger::RequestHelper::HTTPError.new)
expect(subject.available?).to be true
......
......@@ -10,7 +10,7 @@ describe Gitlab::Database::Count do
let(:models) { [Project, Identity] }
context '.approximate_counts' do
describe '.approximate_counts' do
context 'fallbacks' do
subject { described_class.approximate_counts(models, strategies: strategies) }
......
......@@ -31,7 +31,7 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do
Gitlab::GitalyClient.instance_variable_set(:@can_use_disk, {})
end
context '#execute_rugged_call', :request_store do
describe '#execute_rugged_call', :request_store do
let(:args) { ['refs/heads/master', 1] }
before do
......
......@@ -757,7 +757,7 @@ describe Gitlab::GitAccess do
allow(project).to receive(:lfs_enabled?).and_return(true)
expect_next_instance_of(Gitlab::Checks::LfsIntegrity) do |instance|
expect(instance).to receive(:objects_missing?).exactly(1).times
expect(instance).to receive(:objects_missing?).once
end
push_access_check
......
......@@ -5,7 +5,7 @@ require 'spec_helper'
describe Gitlab::GitRefValidator do
using RSpec::Parameterized::TableSyntax
context '.validate' do
describe '.validate' do
it { expect(described_class.validate('feature/new')).to be true }
it { expect(described_class.validate('implement_@all')).to be true }
it { expect(described_class.validate('my_new_feature')).to be true }
......@@ -37,7 +37,7 @@ describe Gitlab::GitRefValidator do
it { expect(described_class.validate("\xA0\u0000\xB0")).to be false }
end
context '.validate_merge_request_branch' do
describe '.validate_merge_request_branch' do
it { expect(described_class.validate_merge_request_branch('HEAD')).to be true }
it { expect(described_class.validate_merge_request_branch('feature/new')).to be true }
it { expect(described_class.validate_merge_request_branch('implement_@all')).to be true }
......
......@@ -215,8 +215,8 @@ describe Gitlab::Gpg do
end
it 'tries at least 2 times to remove the tmp dir before raising', :aggregate_failures do
expect(Retriable).to receive(:sleep).at_least(2).times
expect(FileUtils).to receive(:remove_entry).with(tmp_dir).at_least(2).times.and_raise('Deletion failed')
expect(Retriable).to receive(:sleep).at_least(:twice)
expect(FileUtils).to receive(:remove_entry).with(tmp_dir).at_least(:twice).and_raise('Deletion failed')
expect { described_class.using_tmp_keychain { } }.to raise_error(described_class::CleanupError)
end
......
......@@ -205,7 +205,7 @@ describe Gitlab::LegacyGithubImport::Importer do
let(:gh_pull_request) { Gitlab::LegacyGithubImport::PullRequestFormatter.new(project, closed_pull_request) }
it 'does remove branches' do
expect(subject).to receive(:remove_branch).at_least(2).times
expect(subject).to receive(:remove_branch).at_least(:twice)
subject.send(:clean_up_restored_branches, gh_pull_request)
end
end
......
......@@ -8,7 +8,7 @@ describe Gitlab::PrivateCommitEmail do
let(:valid_email) { "#{id}-foo@#{hostname}" }
let(:invalid_email) { "#{id}-foo@users.noreply.bar.com" }
context '.regex' do
describe '.regex' do
subject { described_class.regex }
it { is_expected.to match("1-foo@#{hostname}") }
......@@ -18,7 +18,7 @@ describe Gitlab::PrivateCommitEmail do
it { is_expected.not_to match('foobar@gitlab.com') }
end
context '.user_id_for_email' do
describe '.user_id_for_email' do
it 'parses user id from email' do
expect(described_class.user_id_for_email(valid_email)).to eq(id)
end
......@@ -28,7 +28,7 @@ describe Gitlab::PrivateCommitEmail do
end
end
context '.user_ids_for_email' do
describe '.user_ids_for_email' do
it 'returns deduplicated user IDs for each valid email' do
result = described_class.user_ids_for_emails([valid_email, valid_email, invalid_email])
......@@ -41,7 +41,7 @@ describe Gitlab::PrivateCommitEmail do
end
end
context '.for_user' do
describe '.for_user' do
it 'returns email in the format id-username@hostname' do
user = create(:user)
......
......@@ -15,7 +15,7 @@ describe Gitlab::RuggedInstrumentation, :request_store do
end
end
context '.increment_query_count' do
describe '.increment_query_count' do
it 'tracks query counts' do
expect(subject.query_count).to eq(0)
......
......@@ -30,7 +30,7 @@ describe Gitlab::Sanitizers::Exif do
end
it 'processes only uploads created since specified date' do
expect(sanitizer).to receive(:clean).exactly(2).times
expect(sanitizer).to receive(:clean).twice
sanitizer.batch_clean(since: 2.days.ago)
end
......
......@@ -6,7 +6,7 @@ describe OmniAuth::Strategies::Jwt do
include Rack::Test::Methods
include DeviseHelpers
context '#decoded' do
describe '#decoded' do
subject { described_class.new({}) }
let(:timestamp) { Time.now.to_i }
......
......@@ -25,13 +25,13 @@ describe SafeZip::Entry do
FileUtils.remove_entry_secure(target_path)
end
context '#path_dir' do
describe '#path_dir' do
subject { entry.path_dir }
it { is_expected.to eq(target_path + '/public/folder') }
end
context '#exist?' do
describe '#exist?' do
subject { entry.exist? }
context 'when entry does not exist' do
......
......@@ -12,7 +12,7 @@ describe SafeZip::Extract do
FileUtils.remove_entry_secure(target_path)
end
context '#extract' do
describe '#extract' do
subject { object.extract(directories: directories, to: target_path) }
shared_examples 'extracts archive' do |param|
......
......@@ -81,13 +81,13 @@ describe Badge do
let(:badge) { build(:badge, link_url: placeholder_url, image_url: placeholder_url) }
let!(:project) { create(:project) }
context '#rendered_link_url' do
describe '#rendered_link_url' do
let(:method) { :link_url }
it_behaves_like 'rendered_links'
end
context '#rendered_image_url' do
describe '#rendered_image_url' do
let(:method) { :image_url }
it_behaves_like 'rendered_links'
......
......@@ -30,13 +30,13 @@ describe ProjectBadge do
let(:badge) { build(:project_badge, link_url: placeholder_url, image_url: placeholder_url) }
let!(:project) { badge.project }
context '#rendered_link_url' do
describe '#rendered_link_url' do
let(:method) { :link_url }
it_behaves_like 'rendered_links'
end
context '#rendered_image_url' do
describe '#rendered_image_url' do
let(:method) { :image_url }
it_behaves_like 'rendered_links'
......
......@@ -51,7 +51,7 @@ describe Ci::ArtifactBlob do
allow(Gitlab.config.pages).to receive(:artifacts_server).and_return(true)
end
context '.gif extension' do
describe '.gif extension' do
it 'returns nil' do
expect(subject.external_url(build.project, build)).to be_nil
end
......
......@@ -11,7 +11,7 @@ describe Ci::PersistentRef do
pipeline.succeed!
end
context '#exist?' do
describe '#exist?' do
subject { pipeline.persistent_ref.exist? }
let(:pipeline) { create(:ci_pipeline, sha: sha, project: project) }
......@@ -31,7 +31,7 @@ describe Ci::PersistentRef do
end
end
context '#create' do
describe '#create' do
subject { pipeline.persistent_ref.create }
let(:pipeline) { create(:ci_pipeline, sha: sha, project: project) }
......@@ -81,7 +81,7 @@ describe Ci::PersistentRef do
end
end
context '#delete' do
describe '#delete' do
subject { pipeline.persistent_ref.delete }
let(:pipeline) { create(:ci_pipeline, sha: sha, project: project) }
......
......@@ -25,7 +25,7 @@ describe Ci::Runner do
end
end
context '#exactly_one_group' do
describe '#exactly_one_group' do
let(:group) { create(:group) }
let(:runner) { create(:ci_runner, :group, groups: [group]) }
......
......@@ -48,14 +48,14 @@ describe Avatarable do
end
it 'calls local_url twice for path and URLs' do
expect(project.avatar).to receive(:local_url).exactly(2).times.and_call_original
expect(project.avatar).to receive(:local_url).twice.and_call_original
expect(project.avatar_path(only_path: true)).to eq(avatar_path)
expect(project.avatar_path(only_path: false)).to eq(avatar_url)
end
it 'calls local_url twice for different sizes' do
expect(project.avatar).to receive(:local_url).exactly(2).times.and_call_original
expect(project.avatar).to receive(:local_url).twice.and_call_original
expect(project.avatar_path).to eq(avatar_path)
expect(project.avatar_path(size: 40)).to eq(avatar_path + "?width=40")
......@@ -64,7 +64,7 @@ describe Avatarable do
it 'handles unpersisted objects' do
new_project = build(:project, :with_avatar)
path = [relative_url_root, new_project.avatar.local_url].join
expect(new_project.avatar).to receive(:local_url).exactly(2).times.and_call_original
expect(new_project.avatar).to receive(:local_url).twice.and_call_original
2.times do
expect(new_project.avatar_path).to eq(path)
......
......@@ -58,7 +58,7 @@ describe Group, 'Routable' do
end
end
context '.find_by_full_path' do
describe '.find_by_full_path' do
let!(:nested_group) { create(:group, parent: group) }
context 'without any redirect routes' do
......
......@@ -49,7 +49,7 @@ RSpec.describe TriggerableHooks do
TestableHook.create!(url: 'http://example2.com', push_events: true)
filter1 = double(:filter1)
filter2 = double(:filter2)
allow(ActiveHookFilter).to receive(:new).exactly(2).times.and_return(filter1, filter2)
allow(ActiveHookFilter).to receive(:new).twice.and_return(filter1, filter2)
expect(filter1).to receive(:matches?).and_return(true)
expect(filter2).to receive(:matches?).and_return(false)
......
......@@ -495,7 +495,7 @@ describe Deployment do
end
end
context '#update_status' do
describe '#update_status' do
let(:deploy) { create(:deployment, status: :running) }
it 'changes the status' do
......
......@@ -359,7 +359,7 @@ describe Issue do
allow(subject.project).to receive(:repository).and_return(repository)
end
context '#to_branch_name does not exists' do
describe '#to_branch_name does not exists' do
before do
allow(repository).to receive(:branch_exists?).and_return(false)
end
......@@ -369,7 +369,7 @@ describe Issue do
end
end
context '#to_branch_name exists not ending with -index' do
describe '#to_branch_name exists not ending with -index' do
before do
allow(repository).to receive(:branch_exists?).and_return(true)
allow(repository).to receive(:branch_exists?).with(/#{subject.to_branch_name}-\d/).and_return(false)
......@@ -380,7 +380,7 @@ describe Issue do
end
end
context '#to_branch_name exists ending with -index' do
describe '#to_branch_name exists ending with -index' do
before do
allow(repository).to receive(:branch_exists?).and_return(true)
allow(repository).to receive(:branch_exists?).with("#{subject.to_branch_name}-3").and_return(false)
......
......@@ -80,7 +80,7 @@ describe NotificationRecipient do
end
end
context '#notification_setting' do
describe '#notification_setting' do
context 'for child groups' do
let!(:moved_group) { create(:group) }
let(:group) { create(:group) }
......
......@@ -148,7 +148,7 @@ describe BambooService, :use_clean_rails_memory_store_caching do
end
shared_examples 'reactive cache calculation' do
context '#build_page' do
describe '#build_page' do
subject { service.calculate_reactive_cache('123', 'unused')[:build_page] }
it 'returns a specific URL when status is 500' do
......@@ -180,7 +180,7 @@ describe BambooService, :use_clean_rails_memory_store_caching do
end
end
context '#commit_status' do
describe '#commit_status' do
subject { service.calculate_reactive_cache('123', 'unused')[:commit_status] }
it 'sets commit status to :error when status is 500' do
......
......@@ -83,7 +83,7 @@ describe BuildkiteService, :use_clean_rails_memory_store_caching do
end
describe '#calculate_reactive_cache' do
context '#commit_status' do
describe '#commit_status' do
subject { service.calculate_reactive_cache('123', 'unused')[:commit_status] }
it 'sets commit status to :error when status is 500' do
......
......@@ -31,7 +31,7 @@ describe ChatMessage::IssueMessage do
context 'without markdown' do
let(:color) { '#C95823' }
context '#initialize' do
describe '#initialize' do
before do
args[:object_attributes][:description] = nil
end
......
......@@ -86,7 +86,7 @@ describe DroneCiService, :use_clean_rails_memory_store_caching do
describe '#calculate_reactive_cache' do
include_context :drone_ci_service
context '#commit_status' do
describe '#commit_status' do
subject { drone.calculate_reactive_cache(sha, branch)[:commit_status] }
it 'sets commit status to :error when status is 500' do
......
......@@ -352,7 +352,7 @@ describe HipchatService do
end
end
context "#message_options" do
describe "#message_options" do
it "is set to the defaults" do
expect(hipchat.__send__(:message_options)).to eq({ notify: false, color: 'yellow' })
end
......
......@@ -152,7 +152,7 @@ describe JiraService do
end
end
context '#update' do
describe '#update' do
context 'basic update' do
let(:new_username) { 'new_username' }
let(:new_url) { 'http://jira-new.example.com' }
......
......@@ -4966,7 +4966,7 @@ describe Project do
end
end
context '#members_among' do
describe '#members_among' do
let(:users) { create_list(:user, 3) }
set(:group) { create(:group) }
......
......@@ -227,7 +227,7 @@ describe RemoteMirror, :mailer do
end
end
context '#sync' do
describe '#sync' do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
around do |example|
......@@ -297,7 +297,7 @@ describe RemoteMirror, :mailer do
end
end
context '#ensure_remote!' do
describe '#ensure_remote!' do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
let(:project) { remote_mirror.project }
let(:repository) { project.repository }
......@@ -321,7 +321,7 @@ describe RemoteMirror, :mailer do
end
end
context '#url=' do
describe '#url=' do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
it 'resets all the columns when URL changes' do
......@@ -340,7 +340,7 @@ describe RemoteMirror, :mailer do
end
end
context '#updated_since?' do
describe '#updated_since?' do
let(:remote_mirror) { create(:project, :repository, :remote_mirror).remote_mirrors.first }
let(:timestamp) { Time.now - 5.minutes }
......
......@@ -681,7 +681,7 @@ describe User, :do_not_mock_admin_mode do
end
describe 'before save hook' do
context '#default_private_profile_to_false' do
describe '#default_private_profile_to_false' do
let(:user) { create(:user, private_profile: true) }
it 'converts nil to false' do
......@@ -3161,7 +3161,7 @@ describe User, :do_not_mock_admin_mode do
end
end
context '.active' do
describe '.active' do
before do
described_class.ghost
create(:user, name: 'user', state: 'active')
......@@ -3181,7 +3181,7 @@ describe User, :do_not_mock_admin_mode do
end
end
context '#invalidate_issue_cache_counts' do
describe '#invalidate_issue_cache_counts' do
let(:user) { build_stubbed(:user) }
it 'invalidates cache for issue counter' do
......@@ -3195,7 +3195,7 @@ describe User, :do_not_mock_admin_mode do
end
end
context '#invalidate_merge_request_cache_counts' do
describe '#invalidate_merge_request_cache_counts' do
let(:user) { build_stubbed(:user) }
it 'invalidates cache for Merge Request counter' do
......@@ -3209,7 +3209,7 @@ describe User, :do_not_mock_admin_mode do
end
end
context '#invalidate_personal_projects_count' do
describe '#invalidate_personal_projects_count' do
let(:user) { build_stubbed(:user) }
it 'invalidates cache for personal projects counter' do
......
......@@ -44,7 +44,7 @@ describe WikiPage do
WikiDirectory.new('dir_2', pages)
end
context "#list_pages" do
describe "#list_pages" do
context 'sort by title' do
let(:grouped_entries) { described_class.group_by_directory(wiki.list_pages) }
let(:expected_grouped_entries) { [dir_1_1, dir_1, page_dir_2, dir_2, page_1, page_6] }
......
......@@ -46,7 +46,7 @@ describe 'GraphQL' do
end
it 'logs the exception in Sentry and continues with the request' do
expect(Gitlab::ErrorTracking).to receive(:track_and_raise_for_dev_exception).at_least(1).times
expect(Gitlab::ErrorTracking).to receive(:track_and_raise_for_dev_exception).at_least(:once)
expect(Gitlab::GraphqlLogger).to receive(:info)
post_graphql(query, variables: {})
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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