diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-24 18:09:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-24 18:09:03 +0000 |
commit | c59765a50abd6a235220fd895f5de78038c243a8 (patch) | |
tree | 6cacf61d1746e2d54149c028ecd3f187128cd7da | |
parent | 4c5468b40825debc2b7bbe08b975dedd2f7f1523 (diff) | |
download | gitlab-ce-c59765a50abd6a235220fd895f5de78038c243a8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
1473 files changed, 2238 insertions, 2020 deletions
diff --git a/app/assets/javascripts/batch_comments/components/draft_note.vue b/app/assets/javascripts/batch_comments/components/draft_note.vue index 963d104b6b3..9abfd43d85c 100644 --- a/app/assets/javascripts/batch_comments/components/draft_note.vue +++ b/app/assets/javascripts/batch_comments/components/draft_note.vue @@ -81,7 +81,7 @@ export default { @handleUpdateNote="update" @toggleResolveStatus="toggleResolveDiscussion(draft.id)" > - <strong slot="note-header-info" class="badge draft-pending-label append-right-4"> + <strong slot="note-header-info" class="badge draft-pending-label gl-mr-2"> {{ __('Pending') }} </strong> </noteable-note> diff --git a/app/assets/javascripts/boards/components/issue_card_inner.vue b/app/assets/javascripts/boards/components/issue_card_inner.vue index f2e198eaedb..d90928f35b6 100644 --- a/app/assets/javascripts/boards/components/issue_card_inner.vue +++ b/app/assets/javascripts/boards/components/issue_card_inner.vue @@ -153,7 +153,7 @@ export default { v-gl-tooltip name="issue-block" :title="__('Blocked issue')" - class="issue-blocked-icon append-right-4" + class="issue-blocked-icon gl-mr-2" :aria-label="__('Blocked issue')" /> <icon @@ -161,7 +161,7 @@ export default { v-gl-tooltip name="eye-slash" :title="__('Confidential')" - class="confidential-icon append-right-4" + class="confidential-icon gl-mr-2" :aria-label="__('Confidential')" /> <a :href="issue.path" :title="issue.title" class="js-no-trigger" @mousemove.stop>{{ diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index d2110483c1c..00eeac5a9d3 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -166,13 +166,7 @@ export default { class="diff-toggle-caret append-right-5" @click.stop="handleToggleFile" /> - <a - v-once - ref="titleWrapper" - class="append-right-4" - :href="titleLink" - @click="handleFileNameClick" - > + <a v-once ref="titleWrapper" class="gl-mr-2" :href="titleLink" @click="handleFileNameClick"> <file-icon :file-name="filePath" :size="18" diff --git a/app/assets/javascripts/groups/components/group_item.vue b/app/assets/javascripts/groups/components/group_item.vue index 6b9748bb725..be90ba12678 100644 --- a/app/assets/javascripts/groups/components/group_item.vue +++ b/app/assets/javascripts/groups/components/group_item.vue @@ -104,7 +104,7 @@ export default { :class="{ 'project-row-contents': !isGroup }" class="group-row-contents d-flex align-items-center py-2 pr-3" > - <div class="folder-toggle-wrap append-right-4 d-flex align-items-center"> + <div class="folder-toggle-wrap gl-mr-2 d-flex align-items-center"> <item-caret :is-group-open="group.isOpen" /> <item-type-icon :item-type="group.type" :is-group-open="group.isOpen" /> </div> @@ -140,7 +140,7 @@ export default { <item-stats-value :icon-name="visibilityIcon" :title="visibilityTooltip" - css-class="item-visibility d-inline-flex align-items-center gl-mt-3 append-right-4 text-secondary" + css-class="item-visibility d-inline-flex align-items-center gl-mt-3 gl-mr-2 text-secondary" /> <span v-if="group.permission" class="user-access-role gl-mt-3"> {{ group.permission }} diff --git a/app/assets/javascripts/groups/components/item_caret.vue b/app/assets/javascripts/groups/components/item_caret.vue index 18ea4819878..cd3e3de4cb4 100644 --- a/app/assets/javascripts/groups/components/item_caret.vue +++ b/app/assets/javascripts/groups/components/item_caret.vue @@ -21,5 +21,5 @@ export default { </script> <template> - <span class="folder-caret append-right-4"> <icon :size="10" :name="iconClass" /> </span> + <span class="folder-caret gl-mr-2"> <icon :size="10" :name="iconClass" /> </span> </template> diff --git a/app/assets/javascripts/jobs/components/stuck_block.vue b/app/assets/javascripts/jobs/components/stuck_block.vue index da01269a50c..b69e6f9686f 100644 --- a/app/assets/javascripts/jobs/components/stuck_block.vue +++ b/app/assets/javascripts/jobs/components/stuck_block.vue @@ -31,7 +31,7 @@ export default { s__(`This job is stuck because you don't have any active runners online or available with any of these tags assigned to them:`) }} - <span v-for="(tag, index) in tags" :key="index" class="badge badge-primary append-right-4"> + <span v-for="(tag, index) in tags" :key="index" class="badge badge-primary gl-mr-2"> {{ tag }} </span> </p> diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index 52642dadea6..3c52368acdd 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -316,6 +316,16 @@ export default { // As a fallback, switch to default time range instead this.selectedTimeRange = defaultTimeRange; }, + isPanelHalfWidth(panelIndex, totalPanels) { + /** + * A single panel on a row should take the full width of its parent. + * All others should have half the width their parent. + */ + const isNumberOfPanelsEven = totalPanels % 2 === 0; + const isLastPanel = panelIndex === totalPanels - 1; + + return isNumberOfPanelsEven || !isLastPanel; + }, }, i18n: { goBackLabel: s__('Metrics|Go back (Esc)'), @@ -391,8 +401,12 @@ export default { <div v-for="(graphData, graphIndex) in groupData.panels" :key="`dashboard-panel-${graphIndex}`" - class="col-12 col-lg-6 px-2 mb-2 draggable" - :class="{ 'draggable-enabled': isRearrangingPanels }" + data-testid="dashboard-panel-layout-wrapper" + class="col-12 px-2 mb-2 draggable" + :class="{ + 'draggable-enabled': isRearrangingPanels, + 'col-lg-6': isPanelHalfWidth(graphIndex, groupData.panels.length), + }" > <div class="position-relative draggable-panel js-draggable-panel"> <div diff --git a/app/assets/javascripts/pipelines/components/graph/graph_component.vue b/app/assets/javascripts/pipelines/components/graph/graph_component.vue index 1ff5b662d18..02fbf342ba7 100644 --- a/app/assets/javascripts/pipelines/components/graph/graph_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/graph_component.vue @@ -172,7 +172,7 @@ export default { :class="{ 'has-upstream prepend-left-64': hasUpstream(index), 'has-only-one-job': hasOnlyOneJob(stage), - 'append-right-46': shouldAddRightMargin(index), + 'gl-mr-26': shouldAddRightMargin(index), }" :title="capitalizeStageName(stage.name)" :groups="stage.groups" diff --git a/app/assets/javascripts/releases/components/release_block_assets.vue b/app/assets/javascripts/releases/components/release_block_assets.vue index 3c4b87e2329..558a8e38e43 100644 --- a/app/assets/javascripts/releases/components/release_block_assets.vue +++ b/app/assets/javascripts/releases/components/release_block_assets.vue @@ -157,7 +157,7 @@ export default { <ul v-if="assets.links.length" class="pl-0 mb-0 gl-mt-3 list-unstyled js-assets-list"> <li v-for="link in assets.links" :key="link.name" class="gl-mb-3"> <gl-link v-gl-tooltip.bottom :title="__('Download asset')" :href="link.directAssetUrl"> - <icon name="package" class="align-middle append-right-4 align-text-bottom" /> + <icon name="package" class="align-middle gl-mr-2 align-text-bottom" /> {{ link.name }} <span v-if="link.external" data-testid="external-link-indicator">{{ __('(external source)') @@ -174,7 +174,7 @@ export default { aria-haspopup="true" aria-expanded="false" > - <icon name="doc-code" class="align-top append-right-4" /> + <icon name="doc-code" class="align-top gl-mr-2" /> {{ __('Source code') }} <icon name="chevron-down" /> </button> diff --git a/app/assets/javascripts/releases/components/release_block_metadata.vue b/app/assets/javascripts/releases/components/release_block_metadata.vue index a3377ce044a..861c2e11798 100644 --- a/app/assets/javascripts/releases/components/release_block_metadata.vue +++ b/app/assets/javascripts/releases/components/release_block_metadata.vue @@ -75,7 +75,7 @@ export default { <release-block-milestones v-if="shouldRenderMilestones" :milestones="release.milestones" /> - <div class="append-right-4"> + <div class="gl-mr-2"> • <span v-gl-tooltip.bottom diff --git a/app/assets/javascripts/releases/components/release_block_milestone_info.vue b/app/assets/javascripts/releases/components/release_block_milestone_info.vue index 4f75e15a149..b16ae400d6b 100644 --- a/app/assets/javascripts/releases/components/release_block_milestone_info.vue +++ b/app/assets/javascripts/releases/components/release_block_milestone_info.vue @@ -126,12 +126,12 @@ export default { v-gl-tooltip :title="milestone.description" :href="milestone.webUrl" - class="append-right-4" + class="gl-mr-2" > {{ milestone.title }} </gl-link> <template v-if="shouldRenderBullet(index)"> - <span :key="'bullet-' + milestone.id" class="append-right-4">•</span> + <span :key="'bullet-' + milestone.id" class="gl-mr-2">•</span> </template> <template v-if="shouldRenderShowMoreLink(index)"> <gl-button :key="'more-button-' + milestone.id" variant="link" @click="toggleShowAll"> diff --git a/app/assets/javascripts/static_site_editor/components/edit_area.vue b/app/assets/javascripts/static_site_editor/components/edit_area.vue index b8c6be51afa..b052c211542 100644 --- a/app/assets/javascripts/static_site_editor/components/edit_area.vue +++ b/app/assets/javascripts/static_site_editor/components/edit_area.vue @@ -37,41 +37,28 @@ export default { saveable: false, parsedSource: parseSourceFile(this.content), editorMode: EDITOR_TYPES.wysiwyg, + isModified: false, }; }, computed: { editableContent() { - return this.parsedSource.editable; - }, - editableKey() { - return this.isWysiwygMode ? 'body' : 'raw'; + return this.parsedSource.content(this.isWysiwygMode); }, isWysiwygMode() { return this.editorMode === EDITOR_TYPES.wysiwyg; }, - modified() { - return this.isWysiwygMode - ? this.parsedSource.isModifiedBody() - : this.parsedSource.isModifiedRaw(); - }, }, methods: { - syncSource() { - if (this.isWysiwygMode) { - this.parsedSource.syncBodyToRaw(); - return; - } - - this.parsedSource.syncRawToBody(); + onInputChange(newVal) { + this.parsedSource.sync(newVal, this.isWysiwygMode); + this.isModified = this.parsedSource.isModified(); }, onModeChange(mode) { - // Sequentially sync then switch modes (rich-content-editor's v-model computed source content update) - this.syncSource(); this.editorMode = mode; + this.$refs.editor.resetInitialValue(this.editableContent); }, onSubmit() { - this.syncSource(); - this.$emit('submit', { content: this.editableContent.raw }); + this.$emit('submit', { content: this.parsedSource.content() }); }, }, }; @@ -80,16 +67,18 @@ export default { <div class="d-flex flex-grow-1 flex-column h-100"> <edit-header class="py-2" :title="title" /> <rich-content-editor - v-model="editableContent[editableKey]" + ref="editor" + :content="editableContent" :initial-edit-type="editorMode" class="mb-9 h-100" @modeChange="onModeChange" + @input="onInputChange" /> - <unsaved-changes-confirm-dialog :modified="modified" /> + <unsaved-changes-confirm-dialog :modified="isModified" /> <publish-toolbar class="gl-fixed gl-left-0 gl-bottom-0 gl-w-full" :return-url="returnUrl" - :saveable="modified" + :saveable="isModified" :saving-changes="savingChanges" @submit="onSubmit" /> diff --git a/app/assets/javascripts/static_site_editor/services/parse_source_file.js b/app/assets/javascripts/static_site_editor/services/parse_source_file.js index c22bd1d27f2..126dfe81b90 100644 --- a/app/assets/javascripts/static_site_editor/services/parse_source_file.js +++ b/app/assets/javascripts/static_site_editor/services/parse_source_file.js @@ -22,33 +22,43 @@ const parseSourceFile = raw => { return buildPayload(source, '', '', source); }; - const computedRaw = () => `${editable.header}${editable.spacing}${editable.body}`; - - const syncRawToBody = () => { + const syncEditable = () => { /* We re-parse as markdown editing could have added non-body changes (preFrontMatter, frontMatter, or spacing). - Re-parsing additionally gets us the desired body that was extracted from the mutated editable.raw - Additionally we intentionally mutate the existing editable's key values as opposed to reassigning the object itself so consumers of the potentially reactive property stay in sync. + Re-parsing additionally gets us the desired body that was extracted from the potentially mutated editable.raw */ - Object.assign(editable, parse(editable.raw)); + editable = parse(editable.raw); }; const syncBodyToRaw = () => { - editable.raw = computedRaw(); + editable.raw = `${editable.header}${editable.spacing}${editable.body}`; + }; + + const sync = (newVal, isBodyToRaw) => { + const editableKey = isBodyToRaw ? 'body' : 'raw'; + editable[editableKey] = newVal; + + if (isBodyToRaw) { + syncBodyToRaw(); + } + + syncEditable(); + }; + + const content = (isBody = false) => { + const editableKey = isBody ? 'body' : 'raw'; + return editable[editableKey]; }; - const isModifiedRaw = () => initial.raw !== editable.raw; - const isModifiedBody = () => initial.raw !== computedRaw(); + const isModified = () => initial.raw !== editable.raw; initial = parse(raw); editable = parse(raw); return { - editable, - isModifiedRaw, - isModifiedBody, - syncBodyToRaw, - syncRawToBody, + content, + isModified, + sync, }; }; diff --git a/app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue b/app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue index 63de1e009fd..caf13bc898b 100644 --- a/app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue +++ b/app/assets/javascripts/vue_shared/components/issue/related_issuable_item.vue @@ -82,7 +82,7 @@ export default { v-gl-tooltip name="eye-slash" :title="__('Confidential')" - class="confidential-icon append-right-4 align-self-baseline align-self-md-auto mt-xl-0" + class="confidential-icon gl-mr-2 align-self-baseline align-self-md-auto mt-xl-0" :aria-label="__('Confidential')" /> <a :href="computedPath" class="sortable-link gl-font-weight-normal">{{ title }}</a> diff --git a/app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue b/app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue index 76d7683e889..aaa13985b09 100644 --- a/app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue +++ b/app/assets/javascripts/vue_shared/components/rich_content_editor/rich_content_editor.vue @@ -27,7 +27,7 @@ export default { AddImageModal, }, props: { - value: { + content: { type: String, required: true, }, @@ -66,23 +66,6 @@ export default { return this.$refs.editor; }, }, - watch: { - value(newVal) { - const isSameMode = this.previousMode === this.editorApi.currentMode; - if (!isSameMode) { - /* - The ToastUI Editor consumes its content via the `initial-value` prop and then internally - manages changes. If we desire the `v-model` to work as expected, we need to manually call - `setMarkdown`. However, if we do this in each v-model change we'll continually prevent - the editor from internally managing changes. Thus we use the `previousMode` flag as - confirmation to actually update its internals. This is initially designed so that front - matter is excluded from editing in wysiwyg mode, but included in markdown mode. - */ - this.editorInstance.invoke('setMarkdown', newVal); - this.previousMode = this.editorApi.currentMode; - } - }, - }, beforeDestroy() { removeCustomEventListener( this.editorApi, @@ -93,6 +76,9 @@ export default { this.editorApi.eventManager.removeEventHandler('changeMode', this.onChangeMode); }, methods: { + resetInitialValue(newVal) { + this.editorInstance.invoke('setMarkdown', newVal); + }, onContentChanged() { this.$emit('input', getMarkdown(this.editorInstance)); }, @@ -123,7 +109,7 @@ export default { <div> <toast-editor ref="editor" - :initial-value="value" + :initial-value="content" :options="editorOptions" :preview-style="previewStyle" :initial-edit-type="initialEditType" diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss index d6d81680f58..be8b7038765 100644 --- a/app/assets/stylesheets/framework/common.scss +++ b/app/assets/stylesheets/framework/common.scss @@ -409,7 +409,6 @@ img.emoji { .prepend-left-20 { margin-left: 20px; } .prepend-left-64 { margin-left: 64px; } .append-right-2 { margin-right: 2px; } -.append-right-4 { margin-right: 4px; } .append-right-5 { margin-right: 5px; } .append-right-10 { margin-right: 10px; } .append-right-15 { margin-right: 15px; } diff --git a/app/controllers/projects/releases_controller.rb b/app/controllers/projects/releases_controller.rb index d3285b64dab..ea3ef23fe4c 100644 --- a/app/controllers/projects/releases_controller.rb +++ b/app/controllers/projects/releases_controller.rb @@ -13,6 +13,7 @@ class Projects::ReleasesController < Projects::ApplicationController push_frontend_feature_flag(:release_asset_link_type, project, default_enabled: true) end before_action :authorize_update_release!, only: %i[edit update] + before_action :authorize_create_release!, only: :new def index respond_to do |format| diff --git a/app/finders/todos_finder.rb b/app/finders/todos_finder.rb index 672bbd52b07..a2054f73c9d 100644 --- a/app/finders/todos_finder.rb +++ b/app/finders/todos_finder.rb @@ -11,7 +11,7 @@ # author_id: integer # project_id; integer # state: 'pending' (default) or 'done' -# type: 'Issue' or 'MergeRequest' +# type: 'Issue' or 'MergeRequest' or ['Issue', 'MergeRequest'] # class TodosFinder @@ -40,13 +40,14 @@ class TodosFinder def execute return Todo.none if current_user.nil? + raise ArgumentError, invalid_type_message unless valid_types? items = current_user.todos items = by_action_id(items) items = by_action(items) items = by_author(items) items = by_state(items) - items = by_type(items) + items = by_types(items) items = by_group(items) # Filtering by project HAS TO be the last because we use # the project IDs yielded by the todos query thus far @@ -123,12 +124,16 @@ class TodosFinder end end - def type? - type.present? && self.class.todo_types.include?(type) + def types + @types ||= Array(params[:type]).reject(&:blank?) end - def type - params[:type] + def valid_types? + types.all? { |type| self.class.todo_types.include?(type) } + end + + def invalid_type_message + _("Unsupported todo type passed. Supported todo types are: %{todo_types}") % { todo_types: self.class.todo_types.to_a.join(', ') } end def sort(items) @@ -193,9 +198,9 @@ class TodosFinder items.with_states(params[:state]) end - def by_type(items) - if type? - items.for_type(type) + def by_types(items) + if types.any? + items.for_type(types) else items end diff --git a/app/helpers/deploy_tokens_helper.rb b/app/helpers/deploy_tokens_helper.rb index 80a5bb44c69..eeeeb14d991 100644 --- a/app/helpers/deploy_tokens_helper.rb +++ b/app/helpers/deploy_tokens_helper.rb @@ -7,8 +7,14 @@ module DeployTokensHelper Rails.env.test? end - def container_registry_enabled?(project) + def container_registry_enabled?(subject) Gitlab.config.registry.enabled && - can?(current_user, :read_container_image, project) + can?(current_user, :read_container_image, subject) + end + + def packages_registry_enabled?(subject) + Gitlab.config.packages.enabled && + subject.feature_available?(:packages) && + can?(current_user, :read_package, subject) end end diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index d4e07713cda..d731a231f98 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -209,19 +209,19 @@ module EventsHelper def event_wiki_title_html(event) capture do - concat content_tag(:span, _('wiki page'), class: "event-target-type append-right-4") + concat content_tag(:span, _('wiki page'), class: "event-target-type gl-mr-2") concat link_to(event.target_title, event_wiki_page_target_url(event), title: event.target_title, - class: 'has-tooltip event-target-link append-right-4') + class: 'has-tooltip event-target-link gl-mr-2') end end def event_design_title_html(event) capture do - concat content_tag(:span, _('design'), class: "event-target-type append-right-4") + concat content_tag(:span, _('design'), class: "event-target-type gl-mr-2") concat link_to(event.design.reference_link_text, design_url(event.design), title: event.target_title, - class: 'has-tooltip event-design event-target-link append-right-4') + class: 'has-tooltip event-design event-target-link gl-mr-2') end end @@ -232,8 +232,8 @@ module EventsHelper def event_note_title_html(event) if event.note_target capture do - concat content_tag(:span, event.note_target_type, class: "event-target-type append-right-4") - concat link_to(event.note_target_reference, event_note_target_url(event), title: event.target_title, class: 'has-tooltip event-target-link append-right-4') + concat content_tag(:span, event.note_target_type, class: "event-target-type gl-mr-2") + concat link_to(event.note_target_reference, event_note_target_url(event), title: event.target_title, class: 'has-tooltip event-target-link gl-mr-2') end else content_tag(:strong, '(deleted)') @@ -278,7 +278,7 @@ module EventsHelper def inline_event_icon(event) unless current_path?('users#show') - content_tag :span, class: "system-note-image-inline d-none d-sm-flex append-right-4 #{event.action_name.parameterize}-icon align-self-center" do + content_tag :span, class: "system-note-image-inline d-none d-sm-flex gl-mr-2 #{event.action_name.parameterize}-icon align-self-center" do next design_event_icon(event.action, size: 14) if event.design? icon_for_event(event.action_name, size: 14) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index bda9a69d71f..64df416bd43 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -384,9 +384,12 @@ module ProjectsHelper end def project_license_name(project) - project.repository.license&.name + key = "project:#{project.id}:license_name" + + Gitlab::SafeRequestStore.fetch(key) { project.repository.license&.name } rescue GRPC::Unavailable, GRPC::DeadlineExceeded, Gitlab::Git::CommandError => e Gitlab::ErrorTracking.track_exception(e) + Gitlab::SafeRequestStore[key] = nil nil end diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb index a663bc555f6..4e8dae1d508 100644 --- a/app/presenters/project_presenter.rb +++ b/app/presenters/project_presenter.rb @@ -16,7 +16,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated MAX_TOPICS_TO_SHOW = 3 def statistic_icon(icon_name = 'plus-square-o') - sprite_icon(icon_name, size: 16, css_class: 'icon append-right-4') + sprite_icon(icon_name, size: 16, css_class: 'icon gl-mr-2') end def statistics_anchors(show_auto_devops_callout:) diff --git a/app/presenters/projects/prometheus/alert_presenter.rb b/app/presenters/projects/prometheus/alert_presenter.rb index a817934a739..28b8cd6522c 100644 --- a/app/presenters/projects/prometheus/alert_presenter.rb +++ b/app/presenters/projects/prometheus/alert_presenter.rb @@ -6,7 +6,7 @@ module Projects RESERVED_ANNOTATIONS = %w(gitlab_incident_markdown gitlab_y_label title).freeze GENERIC_ALERT_SUMMARY_ANNOTATIONS = %w(monitoring_tool service hosts).freeze MARKDOWN_LINE_BREAK = " \n".freeze - INCIDENT_LABEL_NAME = IncidentManagement::CreateIssueService::INCIDENT_LABEL[:title].freeze + INCIDENT_LABEL_NAME = IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES[:title].freeze METRIC_TIME_WINDOW = 30.minutes def full_title diff --git a/app/services/alert_management/create_alert_issue_service.rb b/app/services/alert_management/create_alert_issue_service.rb index 211d3c29a13..66ca28f2223 100644 --- a/app/services/alert_management/create_alert_issue_service.rb +++ b/app/services/alert_management/create_alert_issue_service.rb @@ -4,8 +4,6 @@ module AlertManagement class CreateAlertIssueService include Gitlab::Utils::StrongMemoize - INCIDENT_LABEL = ::IncidentManagement::CreateIssueService::INCIDENT_LABEL - # @param alert [AlertManagement::Alert] # @param user [User] def initialize(alert, user) @@ -18,17 +16,17 @@ module AlertManagement return error_issue_already_exists if alert.issue result = create_issue - @issue = result.payload[:issue] + issue = result.payload[:issue] - return error(result.message) if result.error? - return error(alert.errors.full_messages.to_sentence) unless update_alert_issue_id + return error(result.message, issue) if result.error? + return error(object_errors(alert), issue) unless associate_alert_with_issue(issue) - success + result end private - attr_reader :alert, :user, :issue + attr_reader :alert, :user delegate :project, to: :alert @@ -37,31 +35,35 @@ module AlertManagement end def create_issue - issue = do_create_issue(label_ids: issue_label_ids) + label_result = find_or_create_incident_label - # Create an unlabelled issue if we couldn't create the issue - # due to labels errors. + # Create an unlabelled issue if we couldn't create the label + # due to a race condition. # See https://gitlab.com/gitlab-org/gitlab-foss/issues/65042 - if issue.errors.include?(:labels) - log_label_error(issue) - issue = do_create_issue - end + extra_params = label_result.success? ? { label_ids: [label_result.payload[:label].id] } : {} + + issue = Issues::CreateService.new( + project, + user, + title: alert_presenter.title, + description: alert_presenter.issue_description, + **extra_params + ).execute - return error(issue_errors(issue)) unless issue.valid? + return error(object_errors(issue), issue) unless issue.valid? - @issue = issue - success + success(issue) end - def update_alert_issue_id + def associate_alert_with_issue(issue) alert.update(issue_id: issue.id) end - def success + def success(issue) ServiceResponse.success(payload: { issue: issue }) end - def error(message) + def error(message, issue = nil) ServiceResponse.error(payload: { issue: issue }, message: message) end @@ -73,47 +75,18 @@ module AlertManagement error(_('You have no permissions')) end - def do_create_issue(**params) - Issues::CreateService.new( - project, - user, - title: alert_presenter.title, - description: alert_presenter.issue_description, - **params - ).execute - end - def alert_presenter strong_memoize(:alert_presenter) do alert.present end end - def issue_label_ids - [ - find_or_create_label(**INCIDENT_LABEL) - ].compact.map(&:id) - end - - def find_or_create_label(**params) - Labels::FindOrCreateService - .new(user, project, **params) - .execute - end - - def issue_errors(issue) - issue.errors.full_messages.to_sentence + def find_or_create_incident_label + IncidentManagement::CreateIncidentLabelService.new(project, user).execute end - def log_label_error(issue) - Gitlab::AppLogger.info( - <<~TEXT.chomp - Cannot create incident issue with labels \ - #{issue.labels.map(&:title).inspect} \ - for "#{project.full_name}": #{issue.errors.full_messages.to_sentence}. - Retrying without labels. - TEXT - ) + def object_errors(object) + object.errors.full_messages.to_sentence end end end diff --git a/app/services/incident_management/create_incident_label_service.rb b/app/services/incident_management/create_incident_label_service.rb new file mode 100644 index 00000000000..dbd0d78fa3c --- /dev/null +++ b/app/services/incident_management/create_incident_label_service.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module IncidentManagement + class CreateIncidentLabelService < BaseService + LABEL_PROPERTIES = { + title: 'incident', + color: '#CC0033', + description: <<~DESCRIPTION.chomp + Denotes a disruption to IT services and \ + the associated issues require immediate attention + DESCRIPTION + }.freeze + + def execute + label = Labels::FindOrCreateService + .new(current_user, project, **LABEL_PROPERTIES) + .execute + + if label.invalid? + log_invalid_label_info(label) + return ServiceResponse.error(payload: { label: label }, message: full_error_message(label)) + end + + ServiceResponse.success(payload: { label: label }) + end + + private + + def log_invalid_label_info(label) + log_info <<~TEXT.chomp + Cannot create incident label "#{label.title}" \ + for "#{label.project.full_name}": #{full_error_message(label)}. + TEXT + end + + def full_error_message(label) + label.errors.full_messages.to_sentence + end + end +end diff --git a/app/services/incident_management/create_issue_service.rb b/app/services/incident_management/create_issue_service.rb index 43077e03e6d..5e1e0863115 100644 --- a/app/services/incident_management/create_issue_service.rb +++ b/app/services/incident_management/create_issue_service.rb @@ -4,15 +4,6 @@ module IncidentManagement class CreateIssueService < BaseService include Gitlab::Utils::StrongMemoize - INCIDENT_LABEL = { - title: 'incident', - color: '#CC0033', - description: <<~DESCRIPTION.chomp - Denotes a disruption to IT services and \ - the associated issues require immediate attention - DESCRIPTION - }.freeze - def initialize(project, params) super(project, User.alert_bot, params) end @@ -30,26 +21,19 @@ module IncidentManagement private def create_issue - issue = do_create_issue(label_ids: issue_label_ids) + label_result = find_or_create_incident_label - # Create an unlabelled issue if we couldn't create the issue - # due to labels errors. + # Create an unlabelled issue if we couldn't create the label + # due to a race condition. # See https://gitlab.com/gitlab-org/gitlab-foss/issues/65042 - if issue.errors.include?(:labels) - log_label_error(issue) - issue = do_create_issue - end + extra_params = label_result.success? ? { label_ids: [label_result.payload[:label].id] } : {} - issue - end - - def do_create_issue(**params) Issues::CreateService.new( project, current_user, title: issue_title, description: issue_description, - **params + **extra_params ).execute end @@ -67,16 +51,8 @@ module IncidentManagement ].compact.join(horizontal_line) end - def issue_label_ids - [ - find_or_create_label(**INCIDENT_LABEL) - ].compact.map(&:id) - end - - def find_or_create_label(**params) - Labels::FindOrCreateService - .new(current_user, project, **params) - .execute + def find_or_create_incident_label + IncidentManagement::CreateIncidentLabelService.new(project, current_user).execute end def alert_summary @@ -108,15 +84,6 @@ module IncidentManagement issue.errors.full_messages.to_sentence end - def log_label_error(issue) - log_info <<~TEXT.chomp - Cannot create incident issue with labels \ - #{issue.labels.map(&:title).inspect} \ - for "#{project.full_name}": #{issue.errors.full_messages.to_sentence}. - Retrying without labels. - TEXT - end - def error_with(message) log_error(%{Cannot create incident issue for "#{project.full_name}": #{message}}) diff --git a/app/views/admin/application_settings/integrations.html.haml b/app/views/admin/application_settings/integrations.html.haml index a8eff26b94c..cca0240462f 100644 --- a/app/views/admin/application_settings/integrations.html.haml +++ b/app/views/admin/application_settings/integrations.html.haml @@ -12,7 +12,7 @@ %h4.gl-alert-title= s_('AdminSettings|Some settings have moved') = s_('AdminSettings|Elasticsearch, PlantUML, Slack application, Third party offers, Snowplow, Amazon EKS have moved to Settings > General.') .gl-alert-actions - = link_to s_('AdminSettings|Go to General Settings'), admin_application_settings_path, class: 'btn gl-alert-action btn-info new-gl-button' + = link_to s_('AdminSettings|Go to General Settings'), general_admin_application_settings_path, class: 'btn gl-alert-action btn-info new-gl-button' %h4= s_('AdminSettings|Apply integration settings to all Projects') %p diff --git a/app/views/events/event/_common.html.haml b/app/views/events/event/_common.html.haml index 50c5885c648..dc16c46476e 100644 --- a/app/views/events/event/_common.html.haml +++ b/app/views/events/event/_common.html.haml @@ -5,16 +5,16 @@ .event-title.d-flex.flex-wrap = inline_event_icon(event) - if event.target - %span.event-type.d-inline-block.append-right-4{ class: event.action_name } + %span.event-type.d-inline-block.gl-mr-2{ class: event.action_name } = event.action_name - %span.event-target-type.append-right-4= event.target_type.titleize.downcase - = link_to event.target_link_options, class: 'has-tooltip event-target-link append-right-4', title: event.target_title do + %span.event-target-type.gl-mr-2= event.target_type.titleize.downcase + = link_to event.target_link_options, class: 'has-tooltip event-target-link gl-mr-2', title: event.target_title do = event.target.reference_link_text - unless event.milestone? - %span.event-target-title.append-right-4{ dir: "auto" } + %span.event-target-title.gl-mr-2{ dir: "auto" } = """.html_safe + event.target.title + """.html_safe - else - %span.event-type.d-inline-block.append-right-4{ class: event.action_name } + %span.event-type.d-inline-block.gl-mr-2{ class: event.action_name } = event_action_name(event) = render "events/event_scope", event: event if event.resource_parent.present? diff --git a/app/views/events/event/_created_project.html.haml b/app/views/events/event/_created_project.html.haml index 606b0febb57..f0bb07d062c 100644 --- a/app/views/events/event/_created_project.html.haml +++ b/app/views/events/event/_created_project.html.haml @@ -4,7 +4,7 @@ .event-title.d-flex.flex-wrap = inline_event_icon(event) - %span.event-type.d-inline-block.append-right-4{ class: event.action_name } + %span.event-type.d-inline-block.gl-mr-2{ class: event.action_name } = event_action_name(event) - if event.project diff --git a/app/views/events/event/_design.html.haml b/app/views/events/event/_design.html.haml index edaab3ec5a1..c1fa1aaca50 100644 --- a/app/views/events/event/_design.html.haml +++ b/app/views/events/event/_design.html.haml @@ -4,7 +4,7 @@ .event-title.d-flex.flex-wrap = inline_event_icon(event) - %span.event-type.d-inline-block.append-right-4{ class: event.action_name } + %span.event-type.d-inline-block.gl-mr-2{ class: event.action_name } = event.action_name = event_design_title_html(event) = render "events/event_scope", event: event diff --git a/app/views/events/event/_note.html.haml b/app/views/events/event/_note.html.haml index 21e8b1401ca..a81b999acba 100644 --- a/app/views/events/event/_note.html.haml +++ b/app/views/events/event/_note.html.haml @@ -4,12 +4,12 @@ .event-title.d-flex.flex-wrap = inline_event_icon(event) - %span.event-type.d-inline-block.append-right-4{ class: event.action_name } + %span.event-type.d-inline-block.gl-mr-2{ class: event.action_name } = event.action_name = event_note_title_html(event) - title = note_target_title(event.target) - if title.present? - %span.event-target-title.append-right-4{ dir: "auto" } + %span.event-target-title.gl-mr-2{ dir: "auto" } = """.html_safe + title + """.html_safe = render "events/event_scope", event: event diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml index b9e88f3fc47..4c1ee5fd3b7 100644 --- a/app/views/events/event/_push.html.haml +++ b/app/views/events/event/_push.html.haml @@ -7,9 +7,9 @@ .event-title.d-flex.flex-wrap = inline_event_icon(event) - many_refs = event.ref_count.to_i > 1 - %span.event-type.d-inline-block.append-right-4.pushed= many_refs ? "#{event.action_name} #{event.ref_count} #{event.ref_type.pluralize}" : "#{event.action_name} #{event.ref_type}" + %span.event-type.d-inline-block.gl-mr-2.pushed= many_refs ? "#{event.action_name} #{event.ref_count} #{event.ref_type.pluralize}" : "#{event.action_name} #{event.ref_type}" - unless many_refs - %span.append-right-4 + %span.gl-mr-2 - commits_link = project_commits_path(project, event.ref_name) - should_link = event.tag? ? project.repository.tag_exists?(event.ref_name) : project.repository.branch_exists?(event.ref_name) = link_to_if should_link, event.ref_name, commits_link, class: 'ref-name' diff --git a/app/views/events/event/_wiki.html.haml b/app/views/events/event/_wiki.html.haml index 7ca98294521..cbd5ebcae12 100644 --- a/app/views/events/event/_wiki.html.haml +++ b/app/views/events/event/_wiki.html.haml @@ -4,7 +4,7 @@ .event-title.d-flex.flex-wrap = inline_event_icon(event) - %span.event-type.d-inline-block.append-right-4{ class: event.action_name } + %span.event-type.d-inline-block.gl-mr-2{ class: event.action_name } = event.action_name = event_wiki_title_html(event) = render "events/event_scope", event: event diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 6f8375f80be..9e387404893 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -24,7 +24,7 @@ = render 'shared/members/access_request_links', source: @project - if @project.tag_list.present? %span.home-panel-topic-list.mt-2.w-100.d-inline-flex - = sprite_icon('tag', size: 16, css_class: 'icon append-right-4') + = sprite_icon('tag', size: 16, css_class: 'icon gl-mr-2') - @project.topics_to_show.each do |topic| - project_topics_classes = "badge badge-pill badge-secondary append-right-5" diff --git a/app/views/projects/buttons/_clone.html.haml b/app/views/projects/buttons/_clone.html.haml index b12be8a91d6..7ce143a86b3 100644 --- a/app/views/projects/buttons/_clone.html.haml +++ b/app/views/projects/buttons/_clone.html.haml @@ -3,7 +3,7 @@ .git-clone-holder.js-git-clone-holder %a#clone-dropdown.btn.btn-primary.clone-dropdown-btn.qa-clone-dropdown{ href: '#', data: { toggle: 'dropdown' } } - %span.append-right-4.js-clone-dropdown-label + %span.gl-mr-2.js-clone-dropdown-label = _('Clone') = sprite_icon("chevron-down", css_class: "icon") %ul.p-3.dropdown-menu.dropdown-menu-large.dropdown-menu-selectable.clone-options-dropdown.qa-clone-options{ class: dropdown_class } diff --git a/app/views/projects/releases/new.html.haml b/app/views/projects/releases/new.html.haml new file mode 100644 index 00000000000..5391a8047dc --- /dev/null +++ b/app/views/projects/releases/new.html.haml @@ -0,0 +1 @@ +- page_title s_('Releases|New Release') diff --git a/app/views/shared/deploy_tokens/_form.html.haml b/app/views/shared/deploy_tokens/_form.html.haml index 512644518fa..00e1cc4e9ca 100644 --- a/app/views/shared/deploy_tokens/_form.html.haml +++ b/app/views/shared/deploy_tokens/_form.html.haml @@ -35,6 +35,7 @@ = label_tag ("deploy_token_write_registry"), 'write_registry', class: 'label-bold form-check-label' .text-secondary= s_('DeployTokens|Allows write access to the registry images') + - if packages_registry_enabled?(group_or_project) %fieldset.form-group.form-check = f.check_box :read_package_registry, class: 'form-check-input' = label_tag ("deploy_token_read_package_registry"), 'read_package_registry', class: 'label-bold form-check-label' diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml index fc3f1a8d1c1..0c78708a8e8 100644 --- a/app/views/shared/projects/_project.html.haml +++ b/app/views/shared/projects/_project.html.haml @@ -16,7 +16,6 @@ - css_controls_class = compact_mode ? [] : ["flex-lg-row", "justify-content-lg-between"] - css_controls_class << "with-pipeline-status" if show_pipeline_status_icon - avatar_container_class = project.creator && use_creator_avatar ? '' : 'rect-avatar' -- license_name = project_license_name(project) %li.project-row.d-flex{ class: css_class } = cache(cache_key) do @@ -43,10 +42,10 @@ %span.metadata-info.visibility-icon.append-right-10.gl-mt-3.text-secondary.has-tooltip{ data: { container: 'body', placement: 'top' }, title: visibility_icon_description(project) } = visibility_level_icon(project.visibility_level, fw: true) - - if explore_projects_tab? && license_name + - if explore_projects_tab? && project_license_name(project) %span.metadata-info.d-inline-flex.align-items-center.append-right-10.gl-mt-3 - = sprite_icon('scale', size: 14, css_class: 'append-right-4') - = license_name + = sprite_icon('scale', size: 14, css_class: 'gl-mr-2') + = project_license_name(project) - if !explore_projects_tab? && access&.nonzero? -# haml-lint:disable UnnecessaryStringOutput @@ -77,25 +76,25 @@ = link_to project_starrers_path(project), class: "d-flex align-items-center icon-wrapper stars has-tooltip", title: _('Stars'), data: { container: 'body', placement: 'top' } do - = sprite_icon('star', size: 14, css_class: 'append-right-4') + = sprite_icon('star', size: 14, css_class: 'gl-mr-2') = number_with_delimiter(project.star_count) - if forks = link_to project_forks_path(project), class: "align-items-center icon-wrapper forks has-tooltip", title: _('Forks'), data: { container: 'body', placement: 'top' } do - = sprite_icon('fork', size: 14, css_class: 'append-right-4') + = sprite_icon('fork', size: 14, css_class: 'gl-mr-2') = number_with_delimiter(project.forks_count) - if show_merge_request_count?(disabled: !merge_requests, compact_mode: compact_mode) = link_to project_merge_requests_path(project), class: "d-none d-xl-flex align-items-center icon-wrapper merge-requests has-tooltip", title: _('Merge Requests'), data: { container: 'body', placement: 'top' } do - = sprite_icon('git-merge', size: 14, css_class: 'append-right-4') + = sprite_icon('git-merge', size: 14, css_class: 'gl-mr-2') = number_with_delimiter(project.open_merge_requests_count) - if show_issue_count?(disabled: !issues, compact_mode: compact_mode) = link_to project_issues_path(project), class: "d-none d-xl-flex align-items-center icon-wrapper issues has-tooltip", title: _('Issues'), data: { container: 'body', placement: 'top' } do - = sprite_icon('issues', size: 14, css_class: 'append-right-4') + = sprite_icon('issues', size: 14, css_class: 'gl-mr-2') = number_with_delimiter(project.open_issues_count) .updated-note %span diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 2053a60fc23..e80eb1b6b69 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -5,7 +5,7 @@ --- - :name: authorized_project_update:authorized_project_update_project_create :feature_category: :authentication_and_authorization - :has_external_dependencies: + :has_external_dependencies: :urgency: :low :resource_boundary: :unknown :weight: 1 @@ -13,7 +13,7 @@ :tags: [] - :name: authorized_project_update:authorized_project_update_project_group_link_create :feature_category: :authentication_and_authorization - :has_external_dependencies: + :has_external_dependencies: :urgency: :low :resource_boundary: :unknown :weight: 1 @@ -978,7 +978,8 @@ :resource_boundary: :cpu :weight: 5 :idempotent: - :tags: [] + :tags: + - :requires_disk_io - :name: pipeline_processing:build_queue :feature_category: :continuous_integration :has_external_dependencies: diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb index d38780dd08d..d0f7d65aed6 100644 --- a/app/workers/build_finished_worker.rb +++ b/app/workers/build_finished_worker.rb @@ -7,6 +7,7 @@ class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker queue_namespace :pipeline_processing urgency :high worker_resource_boundary :cpu + tags :requires_disk_io # rubocop: disable CodeReuse/ActiveRecord def perform(build_id) diff --git a/changelogs/unreleased/astoicescu-fullWidthCharts.yml b/changelogs/unreleased/astoicescu-fullWidthCharts.yml new file mode 100644 index 00000000000..c2d7afe5bcb --- /dev/null +++ b/changelogs/unreleased/astoicescu-fullWidthCharts.yml @@ -0,0 +1,5 @@ +--- +title: Add full width to single charts in a row +merge_request: 34999 +author: +type: added diff --git a/changelogs/unreleased/fj-219399-add-usage-data-monthly-snippet-by-type.yml b/changelogs/unreleased/fj-219399-add-usage-data-monthly-snippet-by-type.yml new file mode 100644 index 00000000000..277bdb8f97c --- /dev/null +++ b/changelogs/unreleased/fj-219399-add-usage-data-monthly-snippet-by-type.yml @@ -0,0 +1,5 @@ +--- +title: Add personal and project snippet monthly counters to usage data +merge_request: 35155 +author: +type: changed diff --git a/changelogs/unreleased/fj-223703-add-snippets-size-to-project-statistics.yml b/changelogs/unreleased/fj-223703-add-snippets-size-to-project-statistics.yml new file mode 100644 index 00000000000..af27e384676 --- /dev/null +++ b/changelogs/unreleased/fj-223703-add-snippets-size-to-project-statistics.yml @@ -0,0 +1,5 @@ +--- +title: Add snippets_size to ProjectStatistics +merge_request: 35017 +author: +type: added diff --git a/changelogs/unreleased/graphql-bug-fix-get-todo-by-type.yml b/changelogs/unreleased/graphql-bug-fix-get-todo-by-type.yml new file mode 100644 index 00000000000..e7ae939e138 --- /dev/null +++ b/changelogs/unreleased/graphql-bug-fix-get-todo-by-type.yml @@ -0,0 +1,5 @@ +--- +title: Fix broken todo GraphQL API filtering when filtering by type +merge_request: 34790 +author: +type: fixed diff --git a/changelogs/unreleased/sh-fix-gitaly-conflicts-service-duration.yml b/changelogs/unreleased/sh-fix-gitaly-conflicts-service-duration.yml new file mode 100644 index 00000000000..0e9e9945052 --- /dev/null +++ b/changelogs/unreleased/sh-fix-gitaly-conflicts-service-duration.yml @@ -0,0 +1,5 @@ +--- +title: Fix Gitaly duration timings for conflicts and search RPCs +merge_request: 34909 +author: +type: other diff --git a/changelogs/unreleased/sh-memoize-project-license-name.yml b/changelogs/unreleased/sh-memoize-project-license-name.yml new file mode 100644 index 00000000000..ad40978a7a2 --- /dev/null +++ b/changelogs/unreleased/sh-memoize-project-license-name.yml @@ -0,0 +1,5 @@ +--- +title: Only load project license if needed +merge_request: 35068 +author: +type: performance diff --git a/config/routes/project.rb b/config/routes/project.rb index 48279b36fc1..0ad4d7e0ea0 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -181,7 +181,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do end end - resources :releases, only: [:index, :show, :edit], param: :tag, constraints: { tag: %r{[^/]+} } do + resources :releases, only: [:index, :new, :show, :edit], param: :tag, constraints: { tag: %r{[^/]+} } do member do get :downloads, path: 'downloads/*filepath', format: false scope module: :releases do diff --git a/db/migrate/20200622095419_add_snippets_size_to_project_statistics.rb b/db/migrate/20200622095419_add_snippets_size_to_project_statistics.rb new file mode 100644 index 00000000000..9fe470478b8 --- /dev/null +++ b/db/migrate/20200622095419_add_snippets_size_to_project_statistics.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddSnippetsSizeToProjectStatistics < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def change + add_column :project_statistics, :snippets_size, :bigint + end +end diff --git a/db/structure.sql b/db/structure.sql index 4721c7ed809..7f1dda6375a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -5455,7 +5455,8 @@ CREATE TABLE public.project_statistics ( shared_runners_seconds bigint DEFAULT 0 NOT NULL, shared_runners_seconds_last_reset timestamp without time zone, packages_size bigint DEFAULT 0 NOT NULL, - wiki_size bigint + wiki_size bigint, + snippets_size bigint ); CREATE SEQUENCE public.project_statistics_id_seq @@ -14117,6 +14118,7 @@ COPY "schema_migrations" (version) FROM STDIN; 20200618134723 20200619154527 20200619154528 +20200622095419 20200622103836 20200622235737 20200623000148 diff --git a/doc/development/integrations/secure.md b/doc/development/integrations/secure.md index c1e4cc538bd..33fd468140f 100644 --- a/doc/development/integrations/secure.md +++ b/doc/development/integrations/secure.md @@ -575,3 +575,15 @@ remediation. `fixes[].id` contains a fixed vulnerability's [unique identifier](# The `diff` field is a base64-encoded remediation code diff, compatible with [`git apply`](https://git-scm.com/docs/git-format-patch#_discussion). This field is required. + +## Limitations + +### Container Scanning + +Container Scanning currently has these limitations: + +- Although the Security Dashboard can display scan results from multiple images, if multiple + vulnerabilities have the same fingerprint, only the first instance of that vulnerability is + displayed. We're working on removing this limitation. You can follow our progress on the issue + [Change location fingerprint for Container Scanning](https://gitlab.com/gitlab-org/gitlab/-/issues/215466). +- Different scanners may each report the same vulnerability, resulting in duplicate findings. diff --git a/doc/development/telemetry/usage_ping.md b/doc/development/telemetry/usage_ping.md index 30fc7e192d2..2427b82b8a8 100644 --- a/doc/development/telemetry/usage_ping.md +++ b/doc/development/telemetry/usage_ping.md @@ -469,8 +469,12 @@ appear to be associated to any of the services running, since they all appear to | `releases` | `counts` | `release` | | | Unique release tags | | `remote_mirrors` | `counts` | | | | | | `requirements_created` | `counts` | | | | | -| `snippets` | `counts` | 'create' | | | | -| `snippets` | `counts_monthly` | 'create' | | | | +| `snippets` | `counts` | 'create' | | CE+EE | | +| `snippets` | `counts_monthly` | 'create' | | CE+EE | | +| `personal_snippets` | `counts` | 'create' | | CE+EE | | +| `personal_snippets` | `counts_monthly` | 'create' | | CE+EE | | +| `project_snippets` | `counts` | 'create' | | CE+EE | | +| `project_snippets` | `counts_monthly` | 'create' | | CE+EE | | | `suggestions` | `counts` | | | | | | `todos` | `counts` | | | | | | `uploads` | `counts` | | | | | diff --git a/lib/gitlab/gitaly_client/conflicts_service.rb b/lib/gitlab/gitaly_client/conflicts_service.rb index f7eb4b45197..3f3c0eb6b4a 100644 --- a/lib/gitlab/gitaly_client/conflicts_service.rb +++ b/lib/gitlab/gitaly_client/conflicts_service.rb @@ -20,9 +20,9 @@ module Gitlab our_commit_oid: @our_commit_oid, their_commit_oid: @their_commit_oid ) - response = GitalyClient.call(@repository.storage, :conflicts_service, :list_conflict_files, request, timeout: GitalyClient.long_timeout) - - GitalyClient::ConflictFilesStitcher.new(response, @gitaly_repo) + GitalyClient.streaming_call(@repository.storage, :conflicts_service, :list_conflict_files, request, timeout: GitalyClient.long_timeout) do |response| + GitalyClient::ConflictFilesStitcher.new(response, @gitaly_repo) + end end def conflicts? diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index f74c9ea4192..f20568acde9 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -334,9 +334,9 @@ module Gitlab def search_files_by_content(ref, query, options = {}) request = Gitaly::SearchFilesByContentRequest.new(repository: @gitaly_repo, ref: ref, query: query) - response = GitalyClient.call(@storage, :repository_service, :search_files_by_content, request, timeout: GitalyClient.default_timeout) - - search_results_from_response(response, options) + GitalyClient.streaming_call(@storage, :repository_service, :search_files_by_content, request, timeout: GitalyClient.default_timeout) do |response| + search_results_from_response(response, options) + end end def disconnect_alternates @@ -403,14 +403,18 @@ module Gitlab def gitaly_fetch_stream_to_file(save_path, rpc_name, request_class, timeout) request = request_class.new(repository: @gitaly_repo) - response = GitalyClient.call( + GitalyClient.streaming_call( @storage, :repository_service, rpc_name, request, timeout: timeout - ) + ) do |response| + write_stream_to_file(response, save_path) + end + end + def write_stream_to_file(response, save_path) File.open(save_path, 'wb') do |f| response.each do |message| f.write(message.data) diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 6a94f1667ba..38ca70e755c 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -124,7 +124,7 @@ module Gitlab issues_created_manually_from_alerts: issues_created_manually_from_alerts, incident_issues: alert_bot_incident_count, alert_bot_incident_issues: alert_bot_incident_count, - incident_labeled_issues: count(::Issue.with_label_attributes(IncidentManagement::CreateIssueService::INCIDENT_LABEL)), + incident_labeled_issues: count(::Issue.with_label_attributes(IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES)), keys: count(Key), label_lists: count(List.label), lfs_objects: count(LfsObject), @@ -143,7 +143,6 @@ module Gitlab protected_branches: count(ProtectedBranch), releases: count(Release), remote_mirrors: count(RemoteMirror), - snippets: count(Snippet), personal_snippets: count(PersonalSnippet), project_snippets: count(ProjectSnippet), suggestions: count(Suggestion), @@ -162,7 +161,9 @@ module Gitlab ingress_modsecurity_usage, container_expiration_policies_usage, merge_requests_usage(default_time_period) - ) + ).tap do |data| + data[:snippets] = data[:personal_snippets] + data[:project_snippets] + end } end # rubocop: enable Metrics/AbcSize @@ -170,8 +171,11 @@ module Gitlab def system_usage_data_monthly { counts_monthly: { - snippets: count(Snippet.where(default_time_period)) - } + personal_snippets: count(PersonalSnippet.where(default_time_period)), + project_snippets: count(ProjectSnippet.where(default_time_period)) + }.tap do |data| + data[:snippets] = data[:personal_snippets] + data[:project_snippets] + end } end # rubocop: enable CodeReuse/ActiveRecord diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 09c77c4978a..98f9021cdc8 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -199,6 +199,11 @@ msgid_plural "%d metrics" msgstr[0] "" msgstr[1] "" +msgid "%d milestone" +msgid_plural "%d milestones" +msgstr[0] "" +msgstr[1] "" + msgid "%d minute" msgid_plural "%d minutes" msgstr[0] "" @@ -5689,7 +5694,7 @@ msgstr "" msgid "Collapse approvers" msgstr "" -msgid "Collapse child epics" +msgid "Collapse milestones" msgstr "" msgid "Collapse replies" @@ -9296,15 +9301,15 @@ msgstr "" msgid "Expand approvers" msgstr "" -msgid "Expand child epics" -msgstr "" - msgid "Expand down" msgstr "" msgid "Expand dropdown" msgstr "" +msgid "Expand milestones" +msgstr "" + msgid "Expand sidebar" msgstr "" @@ -18749,6 +18754,9 @@ msgstr "" msgid "Releases documentation" msgstr "" +msgid "Releases|New Release" +msgstr "" + msgid "Release|Something went wrong while getting the release details" msgstr "" @@ -24452,6 +24460,9 @@ msgstr "" msgid "Unsubscribes from this %{quick_action_target}." msgstr "" +msgid "Unsupported todo type passed. Supported todo types are: %{todo_types}" +msgstr "" + msgid "Until" msgstr "" diff --git a/qa/qa/page/component/ci_badge_link.rb b/qa/qa/page/component/ci_badge_link.rb index 8629399e911..4c053f1d6a9 100644 --- a/qa/qa/page/component/ci_badge_link.rb +++ b/qa/qa/page/component/ci_badge_link.rb @@ -43,7 +43,7 @@ module QA private def completed?(timeout: 60) - wait_until(reload: false, max_duration: timeout) do + wait_until(reload: false, sleep_interval: 3.0, max_duration: timeout) do COMPLETED_STATUSES.include?(status_badge) end end diff --git a/spec/controllers/projects/releases_controller_spec.rb b/spec/controllers/projects/releases_controller_spec.rb index 96c38c1b726..45beccfeef5 100644 --- a/spec/controllers/projects/releases_controller_spec.rb +++ b/spec/controllers/projects/releases_controller_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe Projects::ReleasesController do + include AccessMatchersForController + let!(:project) { create(:project, :repository, :public) } let_it_be(:private_project) { create(:project, :repository, :private) } let_it_be(:developer) { create(:user) } @@ -118,6 +120,15 @@ RSpec.describe Projects::ReleasesController do end end + describe 'GET #new' do + let(:request) do + get :new, params: { namespace_id: project.namespace, project_id: project } + end + + it { expect { request }.to be_denied_for(:reporter).of(project) } + it { expect { request }.to be_allowed_for(:developer).of(project) } + end + describe 'GET #edit' do subject do get :edit, params: { namespace_id: project.namespace, project_id: project, tag: tag } diff --git a/spec/factories/usage_data.rb b/spec/factories/usage_data.rb index aa4476f5cec..dcc0b6acb0c 100644 --- a/spec/factories/usage_data.rb +++ b/spec/factories/usage_data.rb @@ -46,7 +46,7 @@ FactoryBot.define do create(:sentry_issue, issue: projects[0].issues[0]) # Incident Labeled Issues - incident_label_attrs = IncidentManagement::CreateIssueService::INCIDENT_LABEL + incident_label_attrs = IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES incident_label = create(:label, project: projects[0], **incident_label_attrs) create(:labeled_issue, project: projects[0], labels: [incident_label]) incident_group = create(:group) @@ -92,7 +92,8 @@ FactoryBot.define do # Create fresh & a month (28-days SMAU) old data [2, 29].each do |n| - create(:snippet, created_at: n.days.ago) + create_list(:project_snippet, 2, project: projects[0], created_at: n.days.ago) + create(:personal_snippet, created_at: n.days.ago) end end end diff --git a/spec/finders/todos_finder_spec.rb b/spec/finders/todos_finder_spec.rb index 4123783d828..f6796398782 100644 --- a/spec/finders/todos_finder_spec.rb +++ b/spec/finders/todos_finder_spec.rb @@ -37,16 +37,63 @@ RSpec.describe TodosFinder do end context 'when filtering by type' do - it 'returns correct todos when filtered by a type' do + it 'returns todos by type when filtered by a single type' do todos = finder.new(user, { type: 'Issue' }).execute expect(todos).to match_array([todo1]) end - it 'returns the correct todos when filtering for multiple types' do + it 'returns todos by type when filtered by multiple types' do + design_todo = create(:todo, user: user, group: group, target: create(:design)) + todos = finder.new(user, { type: %w[Issue MergeRequest] }).execute - expect(todos).to match_array([todo1, todo2]) + expect(todos).to contain_exactly(todo1, todo2) + expect(todos).not_to include(design_todo) + end + + it 'returns all todos when type is nil' do + todos = finder.new(user, { type: nil }).execute + + expect(todos).to contain_exactly(todo1, todo2) + end + + it 'returns all todos when type is an empty collection' do + todos = finder.new(user, { type: [] }).execute + + expect(todos).to contain_exactly(todo1, todo2) + end + + it 'returns all todos when type is blank' do + todos = finder.new(user, { type: '' }).execute + + expect(todos).to contain_exactly(todo1, todo2) + end + + it 'returns todos by type when blank type is in type collection' do + todos = finder.new(user, { type: ['', 'MergeRequest'] }).execute + + expect(todos).to contain_exactly(todo2) + end + + it 'returns todos of all types when only blanks are in a collection' do + todos = finder.new(user, { type: ['', ''] }).execute + + expect(todos).to contain_exactly(todo1, todo2) + end + + it 'returns all todos when no type param' do + todos = finder.new(user).execute + + expect(todos).to contain_exactly(todo1, todo2) + end + + it 'raises an argument error when invalid type is passed' do + create(:todo, user: user, group: group, target: create(:design)) + + todos_finder = finder.new(user, { type: %w[Issue MergeRequest NotAValidType] }) + + expect { todos_finder.execute }.to raise_error(ArgumentError) end end diff --git a/spec/frontend/helpers/vue_mock_directive.js b/spec/frontend/helpers/vue_mock_directive.js index 699fe3eab26..28d4708835d 100644 --- a/spec/frontend/helpers/vue_mock_directive.js +++ b/spec/frontend/helpers/vue_mock_directive.js @@ -2,13 +2,21 @@ export const getKey = name => `$_gl_jest_${name}`; export const getBinding = (el, name) => el[getKey(name)]; +const writeBindingToElement = (el, { name, value, arg, modifiers }) => { + el[getKey(name)] = { + value, + arg, + modifiers, + }; +}; + export const createMockDirective = () => ({ - bind(el, { name, value, arg, modifiers }) { - el[getKey(name)] = { - value, - arg, - modifiers, - }; + bind(el, binding) { + writeBindingToElement(el, binding); + }, + + update(el, binding) { + writeBindingToElement(el, binding); }, unbind(el, { name }) { diff --git a/spec/frontend/monitoring/components/dashboard_spec.js b/spec/frontend/monitoring/components/dashboard_spec.js index 5143a06ec0c..9ffaefc4550 100644 --- a/spec/frontend/monitoring/components/dashboard_spec.js +++ b/spec/frontend/monitoring/components/dashboard_spec.js @@ -16,6 +16,7 @@ import DashboardsDropdown from '~/monitoring/components/dashboards_dropdown.vue' import EmptyState from '~/monitoring/components/empty_state.vue'; import GroupEmptyState from '~/monitoring/components/group_empty_state.vue'; import DashboardPanel from '~/monitoring/components/dashboard_panel.vue'; +import GraphGroup from '~/monitoring/components/graph_group.vue'; import LinksSection from '~/monitoring/components/links_section.vue'; import { createStore } from '~/monitoring/stores'; import * as types from '~/monitoring/stores/mutation_types'; @@ -24,6 +25,7 @@ import { setupStoreWithDashboard, setMetricResult, setupStoreWithData, + setupStoreWithDataForPanelCount, setupStoreWithVariable, setupStoreWithLinks, } from '../store_utils'; @@ -157,6 +159,75 @@ describe('Dashboard', () => { }); }); + describe('panel containers layout', () => { + const findPanelLayoutWrapperAt = index => { + return wrapper + .find(GraphGroup) + .findAll('[data-testid="dashboard-panel-layout-wrapper"]') + .at(index); + }; + + beforeEach(() => { + createMountedWrapper({ hasMetrics: true }); + + return wrapper.vm.$nextTick(); + }); + + describe('when the graph group has an even number of panels', () => { + it('2 panels - all panel wrappers take half width of their parent', () => { + setupStoreWithDataForPanelCount(store, 2); + + wrapper.vm.$nextTick(() => { + expect(findPanelLayoutWrapperAt(0).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(1).classes('col-lg-6')).toBe(true); + }); + }); + + it('4 panels - all panel wrappers take half width of their parent', () => { + setupStoreWithDataForPanelCount(store, 4); + + wrapper.vm.$nextTick(() => { + expect(findPanelLayoutWrapperAt(0).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(1).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(2).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(3).classes('col-lg-6')).toBe(true); + }); + }); + }); + + describe('when the graph group has an odd number of panels', () => { + it('1 panel - panel wrapper does not take half width of its parent', () => { + setupStoreWithDataForPanelCount(store, 1); + + wrapper.vm.$nextTick(() => { + expect(findPanelLayoutWrapperAt(0).classes('col-lg-6')).toBe(false); + }); + }); + + it('3 panels - all panels but last take half width of their parents', () => { + setupStoreWithDataForPanelCount(store, 3); + + wrapper.vm.$nextTick(() => { + expect(findPanelLayoutWrapperAt(0).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(1).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(2).classes('col-lg-6')).toBe(false); + }); + }); + + it('5 panels - all panels but last take half width of their parents', () => { + setupStoreWithDataForPanelCount(store, 5); + + wrapper.vm.$nextTick(() => { + expect(findPanelLayoutWrapperAt(0).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(1).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(2).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(3).classes('col-lg-6')).toBe(true); + expect(findPanelLayoutWrapperAt(4).classes('col-lg-6')).toBe(false); + }); + }); + }); + }); + describe('dashboard validation warning', () => { it('displays a warning if there are validation warnings', () => { createMountedWrapper({ hasMetrics: true }); diff --git a/spec/frontend/monitoring/store_utils.js b/spec/frontend/monitoring/store_utils.js index e2c71e41b6c..740dbaaa2e3 100644 --- a/spec/frontend/monitoring/store_utils.js +++ b/spec/frontend/monitoring/store_utils.js @@ -63,3 +63,24 @@ export const setupStoreWithData = store => { setEnvironmentData(store); }; + +export const setupStoreWithDataForPanelCount = (store, panelCount) => { + const payloadPanelGroup = metricsDashboardPayload.panel_groups[0]; + + const panelGroupCustom = { + ...payloadPanelGroup, + panels: payloadPanelGroup.panels.slice(0, panelCount), + }; + + const metricsDashboardPayloadCustom = { + ...metricsDashboardPayload, + panel_groups: [panelGroupCustom], + }; + + store.commit( + `monitoringDashboard/${types.RECEIVE_METRICS_DASHBOARD_SUCCESS}`, + metricsDashboardPayloadCustom, + ); + + setMetricResult({ store, result: metricsResult, panel: 0 }); +}; diff --git a/spec/frontend/static_site_editor/components/edit_area_spec.js b/spec/frontend/static_site_editor/components/edit_area_spec.js index 1689da52322..11c5abf1b08 100644 --- a/spec/frontend/static_site_editor/components/edit_area_spec.js +++ b/spec/frontend/static_site_editor/components/edit_area_spec.js @@ -52,7 +52,7 @@ describe('~/static_site_editor/components/edit_area.vue', () => { it('renders rich content editor', () => { expect(findRichContentEditor().exists()).toBe(true); - expect(findRichContentEditor().props('value')).toBe(body); + expect(findRichContentEditor().props('content')).toBe(body); }); it('renders publish toolbar', () => { @@ -76,6 +76,15 @@ describe('~/static_site_editor/components/edit_area.vue', () => { return wrapper.vm.$nextTick(); }); + it('updates parsedSource with new content', () => { + const newContent = 'New content'; + const spySyncParsedSource = jest.spyOn(wrapper.vm.parsedSource, 'sync'); + + findRichContentEditor().vm.$emit('input', newContent); + + expect(spySyncParsedSource).toHaveBeenCalledWith(newContent, true); + }); + it('sets publish toolbar as saveable', () => { expect(findPublishToolbar().props('saveable')).toBe(true); }); @@ -103,35 +112,21 @@ describe('~/static_site_editor/components/edit_area.vue', () => { }); it.each` - initialMode | targetMode - ${EDITOR_TYPES.wysiwyg} | ${EDITOR_TYPES.markdown} - ${EDITOR_TYPES.markdown} | ${EDITOR_TYPES.wysiwyg} - `('sets editorMode from $initialMode to $targetMode', ({ initialMode, targetMode }) => { - setInitialMode(initialMode); - findRichContentEditor().vm.$emit('modeChange', targetMode); - - expect(wrapper.vm.editorMode).toBe(targetMode); - }); - - it.each` - syncFnName | initialMode | targetMode - ${'syncBodyToRaw'} | ${EDITOR_TYPES.wysiwyg} | ${EDITOR_TYPES.markdown} - ${'syncRawToBody'} | ${EDITOR_TYPES.markdown} | ${EDITOR_TYPES.wysiwyg} + initialMode | targetMode | resetValue + ${EDITOR_TYPES.wysiwyg} | ${EDITOR_TYPES.markdown} | ${content} + ${EDITOR_TYPES.markdown} | ${EDITOR_TYPES.wysiwyg} | ${body} `( - 'calls $syncFnName source before switching from $initialMode to $targetMode', - ({ syncFnName, initialMode, targetMode }) => { + 'sets editorMode from $initialMode to $targetMode', + ({ initialMode, targetMode, resetValue }) => { setInitialMode(initialMode); - const spySyncSource = jest.spyOn(wrapper.vm, 'syncSource'); - const spySyncParsedSource = jest.spyOn(wrapper.vm.parsedSource, syncFnName); + const resetInitialValue = jest.fn(); + findRichContentEditor().setMethods({ resetInitialValue }); findRichContentEditor().vm.$emit('modeChange', targetMode); - expect(spySyncSource).toHaveBeenCalled(); - expect(spySyncParsedSource).toHaveBeenCalled(); - - spySyncSource.mockReset(); - spySyncParsedSource.mockReset(); + expect(resetInitialValue).toHaveBeenCalledWith(resetValue); + expect(wrapper.vm.editorMode).toBe(targetMode); }, ); }); diff --git a/spec/frontend/static_site_editor/services/parse_source_file_spec.js b/spec/frontend/static_site_editor/services/parse_source_file_spec.js index a6c148dfd02..4588548e614 100644 --- a/spec/frontend/static_site_editor/services/parse_source_file_spec.js +++ b/spec/frontend/static_site_editor/services/parse_source_file_spec.js @@ -1,64 +1,58 @@ -import { - sourceContent as content, - sourceContentHeader as header, - sourceContentSpacing as spacing, - sourceContentBody as body, -} from '../mock_data'; +import { sourceContent as content, sourceContentBody as body } from '../mock_data'; import parseSourceFile from '~/static_site_editor/services/parse_source_file'; describe('parseSourceFile', () => { - const contentSimple = content; const contentComplex = [content, content, content].join(''); + const complexBody = [body, content, content].join(''); + const edit = 'and more'; + const newContent = `${content} ${edit}`; + const newContentComplex = `${contentComplex} ${edit}`; - describe('the editable shape and its expected values', () => { + describe('unmodified content', () => { it.each` - sourceContent | sourceHeader | sourceSpacing | sourceBody | desc - ${contentSimple} | ${header} | ${spacing} | ${body} | ${'extracts header'} - ${contentComplex} | ${header} | ${spacing} | ${[body, content, content].join('')} | ${'extracts body'} - `('$desc', ({ sourceContent, sourceHeader, sourceSpacing, sourceBody }) => { - const { editable } = parseSourceFile(sourceContent); - - expect(editable).toMatchObject({ - raw: sourceContent, - header: sourceHeader, - spacing: sourceSpacing, - body: sourceBody, - }); + parsedSource + ${parseSourceFile(content)} + ${parseSourceFile(contentComplex)} + `('returns false by default', ({ parsedSource }) => { + expect(parsedSource.isModified()).toBe(false); }); - it('returns the same front matter regardless of front matter duplication', () => { - const parsedSourceSimple = parseSourceFile(contentSimple); - const parsedSourceComplex = parseSourceFile(contentComplex); - - expect(parsedSourceSimple.editable.header).toBe(parsedSourceComplex.editable.header); - }); - }); - - describe('editable body to raw content default and changes', () => { it.each` - sourceContent | desc - ${contentSimple} | ${'returns false by default for both raw and body'} - ${contentComplex} | ${'returns false by default for both raw and body'} - `('$desc', ({ sourceContent }) => { - const parsedSource = parseSourceFile(sourceContent); + parsedSource | isBody | target + ${parseSourceFile(content)} | ${undefined} | ${content} + ${parseSourceFile(content)} | ${false} | ${content} + ${parseSourceFile(content)} | ${true} | ${body} + ${parseSourceFile(contentComplex)} | ${undefined} | ${contentComplex} + ${parseSourceFile(contentComplex)} | ${false} | ${contentComplex} + ${parseSourceFile(contentComplex)} | ${true} | ${complexBody} + `( + 'returns only the $target content when the `isBody` parameter argument is $isBody', + ({ parsedSource, isBody, target }) => { + expect(parsedSource.content(isBody)).toBe(target); + }, + ); + }); - expect(parsedSource.isModifiedRaw()).toBe(false); - expect(parsedSource.isModifiedBody()).toBe(false); - }); + describe('modified content', () => { + const newBody = `${body} ${edit}`; + const newComplexBody = `${complexBody} ${edit}`; it.each` - sourceContent | editableKey | syncKey | isModifiedKey | desc - ${contentSimple} | ${'body'} | ${'syncBodyToRaw'} | ${'isModifiedRaw'} | ${'returns true after modification and sync'} - ${contentSimple} | ${'raw'} | ${'syncRawToBody'} | ${'isModifiedBody'} | ${'returns true after modification and sync'} - ${contentComplex} | ${'body'} | ${'syncBodyToRaw'} | ${'isModifiedRaw'} | ${'returns true after modification and sync'} - ${contentComplex} | ${'raw'} | ${'syncRawToBody'} | ${'isModifiedBody'} | ${'returns true after modification and sync'} - `('$desc', ({ sourceContent, editableKey, syncKey, isModifiedKey }) => { - const parsedSource = parseSourceFile(sourceContent); - parsedSource.editable[editableKey] += 'Added content'; - parsedSource[syncKey](); - - expect(parsedSource[isModifiedKey]()).toBe(true); - }); + parsedSource | isModified | targetRaw | targetBody + ${parseSourceFile(content)} | ${false} | ${content} | ${body} + ${parseSourceFile(content)} | ${true} | ${newContent} | ${newBody} + ${parseSourceFile(contentComplex)} | ${false} | ${contentComplex} | ${complexBody} + ${parseSourceFile(contentComplex)} | ${true} | ${newContentComplex} | ${newComplexBody} + `( + 'returns $isModified after a $targetRaw sync', + ({ parsedSource, isModified, targetRaw, targetBody }) => { + parsedSource.sync(targetRaw); + + expect(parsedSource.isModified()).toBe(isModified); + expect(parsedSource.content()).toBe(targetRaw); + expect(parsedSource.content(true)).toBe(targetBody); + }, + ); }); }); diff --git a/spec/frontend/vue_shared/components/rich_content_editor/rich_content_editor_spec.js b/spec/frontend/vue_shared/components/rich_content_editor/rich_content_editor_spec.js index 6091c757ed1..94f9764ad91 100644 --- a/spec/frontend/vue_shared/components/rich_content_editor/rich_content_editor_spec.js +++ b/spec/frontend/vue_shared/components/rich_content_editor/rich_content_editor_spec.js @@ -25,13 +25,13 @@ jest.mock('~/vue_shared/components/rich_content_editor/services/editor_service', describe('Rich Content Editor', () => { let wrapper; - const value = '## Some Markdown'; + const content = '## Some Markdown'; const findEditor = () => wrapper.find({ ref: 'editor' }); const findAddImageModal = () => wrapper.find(AddImageModal); beforeEach(() => { wrapper = shallowMount(RichContentEditor, { - propsData: { value }, + propsData: { content }, }); }); @@ -41,7 +41,7 @@ describe('Rich Content Editor', () => { }); it('renders the correct content', () => { - expect(findEditor().props().initialValue).toBe(value); + expect(findEditor().props().initialValue).toBe(content); }); it('provides the correct editor options', () => { @@ -73,6 +73,18 @@ describe('Rich Content Editor', () => { }); }); + describe('when content is reset', () => { + it('should reset the content via setMarkdown', () => { + const newContent = 'Just the body content excluding the front matter for example'; + const mockInstance = { invoke: jest.fn() }; + wrapper.vm.$refs.editor = mockInstance; + + wrapper.vm.resetInitialValue(newContent); + + expect(mockInstance.invoke).toHaveBeenCalledWith('setMarkdown', newContent); + }); + }); + describe('when editor is loaded', () => { it('adds the CUSTOM_EVENTS.openAddImageModal custom event listener', () => { const mockEditorApi = { eventManager: { addEventType: jest.fn(), listen: jest.fn() } }; diff --git a/spec/graphql/resolvers/todo_resolver_spec.rb b/spec/graphql/resolvers/todo_resolver_spec.rb index f4b98e61003..0775cb8dae7 100644 --- a/spec/graphql/resolvers/todo_resolver_spec.rb +++ b/spec/graphql/resolvers/todo_resolver_spec.rb @@ -10,9 +10,9 @@ RSpec.describe Resolvers::TodoResolver do let_it_be(:author1) { create(:user) } let_it_be(:author2) { create(:user) } - let_it_be(:todo1) { create(:todo, user: current_user, target_type: 'MergeRequest', state: :pending, action: Todo::MENTIONED, author: author1) } - let_it_be(:todo2) { create(:todo, user: current_user, state: :done, action: Todo::ASSIGNED, author: author2) } - let_it_be(:todo3) { create(:todo, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) } + let_it_be(:merge_request_todo_pending) { create(:todo, user: current_user, target_type: 'MergeRequest', state: :pending, action: Todo::MENTIONED, author: author1) } + let_it_be(:issue_todo_done) { create(:todo, user: current_user, state: :done, action: Todo::ASSIGNED, author: author2) } + let_it_be(:issue_todo_pending) { create(:todo, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) } it 'calls TodosFinder' do expect_next_instance_of(TodosFinder) do |finder| @@ -23,22 +23,30 @@ RSpec.describe Resolvers::TodoResolver do end context 'when using no filter' do - it 'returns expected todos' do - expect(resolve_todos).to contain_exactly(todo1, todo3) + it 'returns pending todos' do + expect(resolve_todos).to contain_exactly(merge_request_todo_pending, issue_todo_pending) end end context 'when using filters' do it 'returns the todos for multiple states' do - todos = resolve_todos({ state: [:done, :pending] }) + todos = resolve_todos(state: [:done, :pending]) - expect(todos).to contain_exactly(todo1, todo2, todo3) + expect(todos).to contain_exactly(merge_request_todo_pending, issue_todo_done, issue_todo_pending) end - it 'returns the todos for multiple types' do - todos = resolve_todos({ type: %w[Issue MergeRequest] }) + it 'returns the todos for multiple filters' do + design_todo_pending = create(:todo, target_type: 'DesignManagement::Design', user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) - expect(todos).to contain_exactly(todo1, todo3) + todos = resolve_todos(type: ['MergeRequest', 'DesignManagement::Design']) + + expect(todos).to contain_exactly(merge_request_todo_pending, design_todo_pending) + end + + it 'returns the todos for single filter' do + todos = resolve_todos(type: 'MergeRequest') + + expect(todos).to contain_exactly(merge_request_todo_pending) end it 'returns the todos for multiple groups' do @@ -53,7 +61,7 @@ RSpec.describe Resolvers::TodoResolver do todo5 = create(:todo, group: group2, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) create(:todo, group: group3, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) - todos = resolve_todos({ group_id: [group2.id, group1.id] }) + todos = resolve_todos(group_id: [group2.id, group1.id]) expect(todos).to contain_exactly(todo4, todo5) end @@ -61,20 +69,19 @@ RSpec.describe Resolvers::TodoResolver do it 'returns the todos for multiple authors' do author3 = create(:user) - todo4 = create(:todo, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author2) create(:todo, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author3) - todos = resolve_todos({ author_id: [author2.id, author1.id] }) + todos = resolve_todos(author_id: [author2.id, author1.id]) - expect(todos).to contain_exactly(todo1, todo3, todo4) + expect(todos).to contain_exactly(merge_request_todo_pending, issue_todo_pending) end it 'returns the todos for multiple actions' do create(:todo, user: current_user, state: :pending, action: Todo::DIRECTLY_ADDRESSED, author: author1) - todos = resolve_todos({ action: [Todo::MENTIONED, Todo::ASSIGNED] }) + todos = resolve_todos(action: [Todo::MENTIONED, Todo::ASSIGNED]) - expect(todos).to contain_exactly(todo1, todo3) + expect(todos).to contain_exactly(merge_request_todo_pending, issue_todo_pending) end it 'returns the todos for multiple projects' do @@ -86,7 +93,7 @@ RSpec.describe Resolvers::TodoResolver do todo5 = create(:todo, project: project2, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) create(:todo, project: project3, user: current_user, state: :pending, action: Todo::ASSIGNED, author: author1) - todos = resolve_todos({ project_id: [project2.id, project1.id] }) + todos = resolve_todos(project_id: [project2.id, project1.id]) expect(todos).to contain_exactly(todo4, todo5) end diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index 5a0c16cc05b..f0de602ed2d 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -174,8 +174,8 @@ RSpec.describe EventsHelper do url = helper.event_wiki_page_target_url(event) title = event.target_title html = [ - "<span class=\"event-target-type append-right-4\">wiki page</span>", - "<a title=\"#{title}\" class=\"has-tooltip event-target-link append-right-4\" href=\"#{url}\">", + "<span class=\"event-target-type gl-mr-2\">wiki page</span>", + "<a title=\"#{title}\" class=\"has-tooltip event-target-link gl-mr-2\" href=\"#{url}\">", title, "</a>" ].join diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 8dafdea454b..221825841b8 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -977,19 +977,32 @@ RSpec.describe ProjectsHelper do end end - describe '#project_license_name(project)' do + describe '#project_license_name(project)', :request_store do let_it_be(:project) { create(:project) } let_it_be(:repository) { project.repository } subject { project_license_name(project) } + def license_name + project_license_name(project) + end + context 'gitaly is working appropriately' do - it 'returns the license name' do - license = Licensee::License.new('mit') - allow(repository).to receive(:license).and_return(license) + let(:license) { Licensee::License.new('mit') } + + before do + expect(repository).to receive(:license).and_return(license) + end + it 'returns the license name' do expect(subject).to eq(license.name) end + + it 'memoizes the value' do + expect do + 2.times { expect(license_name).to eq(license.name) } + end.to change { Gitlab::GitalyClient.get_request_count }.by_at_most(1) + end end context 'gitaly is unreachable' do @@ -1003,10 +1016,16 @@ RSpec.describe ProjectsHelper do subject end + + it 'memoizes the nil value' do + expect do + 2.times { expect(license_name).to be_nil } + end.to change { Gitlab::GitalyClient.get_request_count }.by_at_most(1) + end end before do - allow(repository).to receive(:license).and_raise(exception) + expect(repository).to receive(:license).and_raise(exception) end context "Gitlab::Git::CommandError" do diff --git a/spec/lib/gitlab/ci/status/build/action_spec.rb b/spec/lib/gitlab/ci/status/build/action_spec.rb index 3aae7e18d6d..de237183feb 100644 --- a/spec/lib/gitlab/ci/status/build/action_spec.rb +++ b/spec/lib/gitlab/ci/status/build/action_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Action do +RSpec.describe Gitlab::Ci::Status::Build::Action do let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/build/cancelable_spec.rb b/spec/lib/gitlab/ci/status/build/cancelable_spec.rb index 3841dae91c7..95920518793 100644 --- a/spec/lib/gitlab/ci/status/build/cancelable_spec.rb +++ b/spec/lib/gitlab/ci/status/build/cancelable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Cancelable do +RSpec.describe Gitlab::Ci::Status::Build::Cancelable do let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/build/canceled_spec.rb b/spec/lib/gitlab/ci/status/build/canceled_spec.rb index 4b43c78f1a7..e30a2211c8f 100644 --- a/spec/lib/gitlab/ci/status/build/canceled_spec.rb +++ b/spec/lib/gitlab/ci/status/build/canceled_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Canceled do +RSpec.describe Gitlab::Ci::Status::Build::Canceled do let(:user) { create(:user) } subject do diff --git a/spec/lib/gitlab/ci/status/build/common_spec.rb b/spec/lib/gitlab/ci/status/build/common_spec.rb index 5114540708f..924ee5ee1a4 100644 --- a/spec/lib/gitlab/ci/status/build/common_spec.rb +++ b/spec/lib/gitlab/ci/status/build/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Common do +RSpec.describe Gitlab::Ci::Status::Build::Common do let(:user) { create(:user) } let(:build) { create(:ci_build) } let(:project) { build.project } diff --git a/spec/lib/gitlab/ci/status/build/created_spec.rb b/spec/lib/gitlab/ci/status/build/created_spec.rb index 6e3aa442810..49468674140 100644 --- a/spec/lib/gitlab/ci/status/build/created_spec.rb +++ b/spec/lib/gitlab/ci/status/build/created_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Created do +RSpec.describe Gitlab::Ci::Status::Build::Created do let(:user) { create(:user) } subject do diff --git a/spec/lib/gitlab/ci/status/build/erased_spec.rb b/spec/lib/gitlab/ci/status/build/erased_spec.rb index af9c296da0c..75467cc6b31 100644 --- a/spec/lib/gitlab/ci/status/build/erased_spec.rb +++ b/spec/lib/gitlab/ci/status/build/erased_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Erased do +RSpec.describe Gitlab::Ci::Status::Build::Erased do let(:user) { create(:user) } subject do diff --git a/spec/lib/gitlab/ci/status/build/factory_spec.rb b/spec/lib/gitlab/ci/status/build/factory_spec.rb index 11be17bfc53..21eca97331e 100644 --- a/spec/lib/gitlab/ci/status/build/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/build/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Factory do +RSpec.describe Gitlab::Ci::Status::Build::Factory do let(:user) { create(:user) } let(:project) { build.project } let(:status) { factory.fabricate! } diff --git a/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb b/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb index 01500689619..0ff7c3796c0 100644 --- a/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb +++ b/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::FailedAllowed do +RSpec.describe Gitlab::Ci::Status::Build::FailedAllowed do let(:status) { double('core status') } let(:user) { double('user') } let(:build) { create(:ci_build, :failed, :allowed_to_fail) } diff --git a/spec/lib/gitlab/ci/status/build/failed_spec.rb b/spec/lib/gitlab/ci/status/build/failed_spec.rb index 78f5214ca81..1d5069fe180 100644 --- a/spec/lib/gitlab/ci/status/build/failed_spec.rb +++ b/spec/lib/gitlab/ci/status/build/failed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Failed do +RSpec.describe Gitlab::Ci::Status::Build::Failed do let(:build) { create(:ci_build, :script_failure) } let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/build/manual_spec.rb b/spec/lib/gitlab/ci/status/build/manual_spec.rb index bffe2c10d12..78193055139 100644 --- a/spec/lib/gitlab/ci/status/build/manual_spec.rb +++ b/spec/lib/gitlab/ci/status/build/manual_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Manual do +RSpec.describe Gitlab::Ci::Status::Build::Manual do let(:user) { create(:user) } subject do diff --git a/spec/lib/gitlab/ci/status/build/pending_spec.rb b/spec/lib/gitlab/ci/status/build/pending_spec.rb index 64d57954c15..7b695d33877 100644 --- a/spec/lib/gitlab/ci/status/build/pending_spec.rb +++ b/spec/lib/gitlab/ci/status/build/pending_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Pending do +RSpec.describe Gitlab::Ci::Status::Build::Pending do let(:user) { create(:user) } subject do diff --git a/spec/lib/gitlab/ci/status/build/play_spec.rb b/spec/lib/gitlab/ci/status/build/play_spec.rb index bb12a900b55..bb406623d2f 100644 --- a/spec/lib/gitlab/ci/status/build/play_spec.rb +++ b/spec/lib/gitlab/ci/status/build/play_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Play do +RSpec.describe Gitlab::Ci::Status::Build::Play do let(:user) { create(:user) } let(:project) { create(:project, :stubbed_repository) } let(:build) { create(:ci_build, :manual, project: project) } diff --git a/spec/lib/gitlab/ci/status/build/preparing_spec.rb b/spec/lib/gitlab/ci/status/build/preparing_spec.rb index 4d8945845ba..5bb18ac3799 100644 --- a/spec/lib/gitlab/ci/status/build/preparing_spec.rb +++ b/spec/lib/gitlab/ci/status/build/preparing_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Preparing do +RSpec.describe Gitlab::Ci::Status::Build::Preparing do subject do described_class.new(double('subject')) end diff --git a/spec/lib/gitlab/ci/status/build/retried_spec.rb b/spec/lib/gitlab/ci/status/build/retried_spec.rb index fce497d40a1..522228f0a1d 100644 --- a/spec/lib/gitlab/ci/status/build/retried_spec.rb +++ b/spec/lib/gitlab/ci/status/build/retried_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Retried do +RSpec.describe Gitlab::Ci::Status::Build::Retried do let(:build) { create(:ci_build, :retried) } let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/build/retryable_spec.rb b/spec/lib/gitlab/ci/status/build/retryable_spec.rb index 5b0ae315927..cb1cf85169d 100644 --- a/spec/lib/gitlab/ci/status/build/retryable_spec.rb +++ b/spec/lib/gitlab/ci/status/build/retryable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Retryable do +RSpec.describe Gitlab::Ci::Status::Build::Retryable do let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/build/scheduled_spec.rb b/spec/lib/gitlab/ci/status/build/scheduled_spec.rb index 8f87da10815..b0cd1ac4dc5 100644 --- a/spec/lib/gitlab/ci/status/build/scheduled_spec.rb +++ b/spec/lib/gitlab/ci/status/build/scheduled_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Scheduled do +RSpec.describe Gitlab::Ci::Status::Build::Scheduled do let(:user) { create(:user) } let(:project) { create(:project, :stubbed_repository) } let(:build) { create(:ci_build, :scheduled, project: project) } diff --git a/spec/lib/gitlab/ci/status/build/skipped_spec.rb b/spec/lib/gitlab/ci/status/build/skipped_spec.rb index 7ce5142da78..0b998a52a57 100644 --- a/spec/lib/gitlab/ci/status/build/skipped_spec.rb +++ b/spec/lib/gitlab/ci/status/build/skipped_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Skipped do +RSpec.describe Gitlab::Ci::Status::Build::Skipped do let(:user) { create(:user) } subject do diff --git a/spec/lib/gitlab/ci/status/build/stop_spec.rb b/spec/lib/gitlab/ci/status/build/stop_spec.rb index d3e98400a53..7376afe0e83 100644 --- a/spec/lib/gitlab/ci/status/build/stop_spec.rb +++ b/spec/lib/gitlab/ci/status/build/stop_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Stop do +RSpec.describe Gitlab::Ci::Status::Build::Stop do let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/build/unschedule_spec.rb b/spec/lib/gitlab/ci/status/build/unschedule_spec.rb index c18fc3252b4..74002c7d0d7 100644 --- a/spec/lib/gitlab/ci/status/build/unschedule_spec.rb +++ b/spec/lib/gitlab/ci/status/build/unschedule_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Build::Unschedule do +RSpec.describe Gitlab::Ci::Status::Build::Unschedule do let(:status) { double('core status') } let(:user) { double('user') } diff --git a/spec/lib/gitlab/ci/status/canceled_spec.rb b/spec/lib/gitlab/ci/status/canceled_spec.rb index 6cfcea4fdde..a35efae5c57 100644 --- a/spec/lib/gitlab/ci/status/canceled_spec.rb +++ b/spec/lib/gitlab/ci/status/canceled_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Canceled do +RSpec.describe Gitlab::Ci::Status::Canceled do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/composite_spec.rb b/spec/lib/gitlab/ci/status/composite_spec.rb index 4c5f8770cb7..47bbc4169b6 100644 --- a/spec/lib/gitlab/ci/status/composite_spec.rb +++ b/spec/lib/gitlab/ci/status/composite_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Composite do +RSpec.describe Gitlab::Ci::Status::Composite do let_it_be(:pipeline) { create(:ci_pipeline) } before_all do diff --git a/spec/lib/gitlab/ci/status/created_spec.rb b/spec/lib/gitlab/ci/status/created_spec.rb index aeb41e9cfc3..1ddced923f6 100644 --- a/spec/lib/gitlab/ci/status/created_spec.rb +++ b/spec/lib/gitlab/ci/status/created_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Created do +RSpec.describe Gitlab::Ci::Status::Created do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/extended_spec.rb b/spec/lib/gitlab/ci/status/extended_spec.rb index 8accfc4a2f9..3e1004754ba 100644 --- a/spec/lib/gitlab/ci/status/extended_spec.rb +++ b/spec/lib/gitlab/ci/status/extended_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Extended do +RSpec.describe Gitlab::Ci::Status::Extended do it 'requires subclass to implement matcher' do expect { described_class.matches?(double, double) } .to raise_error(NotImplementedError) diff --git a/spec/lib/gitlab/ci/status/external/common_spec.rb b/spec/lib/gitlab/ci/status/external/common_spec.rb index 983522fa2d6..6de08ce9281 100644 --- a/spec/lib/gitlab/ci/status/external/common_spec.rb +++ b/spec/lib/gitlab/ci/status/external/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::External::Common do +RSpec.describe Gitlab::Ci::Status::External::Common do let(:user) { create(:user) } let(:project) { external_status.project } let(:external_target_url) { 'http://example.gitlab.com/status' } diff --git a/spec/lib/gitlab/ci/status/external/factory_spec.rb b/spec/lib/gitlab/ci/status/external/factory_spec.rb index aae607b9506..a31a11cd14a 100644 --- a/spec/lib/gitlab/ci/status/external/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/external/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::External::Factory do +RSpec.describe Gitlab::Ci::Status::External::Factory do let(:user) { create(:user) } let(:project) { resource.project } let(:status) { factory.fabricate! } diff --git a/spec/lib/gitlab/ci/status/factory_spec.rb b/spec/lib/gitlab/ci/status/factory_spec.rb index e16570a7648..641cb0183d3 100644 --- a/spec/lib/gitlab/ci/status/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Factory do +RSpec.describe Gitlab::Ci::Status::Factory do let(:user) { create(:user) } let(:fabricated_status) { factory.fabricate! } let(:factory) { described_class.new(resource, user) } diff --git a/spec/lib/gitlab/ci/status/failed_spec.rb b/spec/lib/gitlab/ci/status/failed_spec.rb index 5c7393fc8cf..e8bd728b740 100644 --- a/spec/lib/gitlab/ci/status/failed_spec.rb +++ b/spec/lib/gitlab/ci/status/failed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Failed do +RSpec.describe Gitlab::Ci::Status::Failed do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/group/common_spec.rb b/spec/lib/gitlab/ci/status/group/common_spec.rb index 35fff30ea9d..2bfd816e45d 100644 --- a/spec/lib/gitlab/ci/status/group/common_spec.rb +++ b/spec/lib/gitlab/ci/status/group/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Group::Common do +RSpec.describe Gitlab::Ci::Status::Group::Common do subject do Gitlab::Ci::Status::Core.new(double, double) .extend(described_class) diff --git a/spec/lib/gitlab/ci/status/group/factory_spec.rb b/spec/lib/gitlab/ci/status/group/factory_spec.rb index be76a1d5a65..6267b26aa78 100644 --- a/spec/lib/gitlab/ci/status/group/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/group/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Group::Factory do +RSpec.describe Gitlab::Ci::Status::Group::Factory do it 'inherits from the core factory' do expect(described_class) .to be < Gitlab::Ci::Status::Factory diff --git a/spec/lib/gitlab/ci/status/manual_spec.rb b/spec/lib/gitlab/ci/status/manual_spec.rb index 0839452ec22..a9203438898 100644 --- a/spec/lib/gitlab/ci/status/manual_spec.rb +++ b/spec/lib/gitlab/ci/status/manual_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Manual do +RSpec.describe Gitlab::Ci::Status::Manual do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/pending_spec.rb b/spec/lib/gitlab/ci/status/pending_spec.rb index 5f830e5bb56..0e47b19d9c1 100644 --- a/spec/lib/gitlab/ci/status/pending_spec.rb +++ b/spec/lib/gitlab/ci/status/pending_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Pending do +RSpec.describe Gitlab::Ci::Status::Pending do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb b/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb index 664915ba552..8fd974972e4 100644 --- a/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/blocked_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Pipeline::Blocked do +RSpec.describe Gitlab::Ci::Status::Pipeline::Blocked do let(:pipeline) { double('pipeline') } subject do diff --git a/spec/lib/gitlab/ci/status/pipeline/common_spec.rb b/spec/lib/gitlab/ci/status/pipeline/common_spec.rb index d3251d138b8..575acc48a61 100644 --- a/spec/lib/gitlab/ci/status/pipeline/common_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Pipeline::Common do +RSpec.describe Gitlab::Ci::Status::Pipeline::Common do let(:user) { create(:user) } let(:project) { create(:project, :private) } let(:pipeline) { create(:ci_pipeline, project: project) } diff --git a/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb b/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb index aba403de712..1302c2069ff 100644 --- a/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/delayed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Pipeline::Delayed do +RSpec.describe Gitlab::Ci::Status::Pipeline::Delayed do let(:pipeline) { double('pipeline') } subject do diff --git a/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb b/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb index d4031689463..a6f23180860 100644 --- a/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/pipeline/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Pipeline::Factory do +RSpec.describe Gitlab::Ci::Status::Pipeline::Factory do let(:user) { create(:user) } let(:project) { pipeline.project } let(:status) { factory.fabricate! } diff --git a/spec/lib/gitlab/ci/status/preparing_spec.rb b/spec/lib/gitlab/ci/status/preparing_spec.rb index 33f6bab8d65..6d33eb77560 100644 --- a/spec/lib/gitlab/ci/status/preparing_spec.rb +++ b/spec/lib/gitlab/ci/status/preparing_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Preparing do +RSpec.describe Gitlab::Ci::Status::Preparing do subject do described_class.new(double('subject'), nil) end diff --git a/spec/lib/gitlab/ci/status/running_spec.rb b/spec/lib/gitlab/ci/status/running_spec.rb index 75ff58c5c98..fbc7bfd81b3 100644 --- a/spec/lib/gitlab/ci/status/running_spec.rb +++ b/spec/lib/gitlab/ci/status/running_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Running do +RSpec.describe Gitlab::Ci::Status::Running do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/scheduled_spec.rb b/spec/lib/gitlab/ci/status/scheduled_spec.rb index a0374e1a87b..4a1dae937ca 100644 --- a/spec/lib/gitlab/ci/status/scheduled_spec.rb +++ b/spec/lib/gitlab/ci/status/scheduled_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Scheduled do +RSpec.describe Gitlab::Ci::Status::Scheduled do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/skipped_spec.rb b/spec/lib/gitlab/ci/status/skipped_spec.rb index 7f68d4a2fa9..f402bbe5221 100644 --- a/spec/lib/gitlab/ci/status/skipped_spec.rb +++ b/spec/lib/gitlab/ci/status/skipped_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Skipped do +RSpec.describe Gitlab::Ci::Status::Skipped do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/stage/common_spec.rb b/spec/lib/gitlab/ci/status/stage/common_spec.rb index 26ff0e901fd..bbd2ce6c83b 100644 --- a/spec/lib/gitlab/ci/status/stage/common_spec.rb +++ b/spec/lib/gitlab/ci/status/stage/common_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Stage::Common do +RSpec.describe Gitlab::Ci::Status::Stage::Common do let(:user) { create(:user) } let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } diff --git a/spec/lib/gitlab/ci/status/stage/factory_spec.rb b/spec/lib/gitlab/ci/status/stage/factory_spec.rb index e5c80be87bd..e0f5531f370 100644 --- a/spec/lib/gitlab/ci/status/stage/factory_spec.rb +++ b/spec/lib/gitlab/ci/status/stage/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Stage::Factory do +RSpec.describe Gitlab::Ci::Status::Stage::Factory do let(:user) { create(:user) } let(:project) { create(:project) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } diff --git a/spec/lib/gitlab/ci/status/stage/play_manual_spec.rb b/spec/lib/gitlab/ci/status/stage/play_manual_spec.rb index bdcbfed918f..25b79ff2099 100644 --- a/spec/lib/gitlab/ci/status/stage/play_manual_spec.rb +++ b/spec/lib/gitlab/ci/status/stage/play_manual_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Stage::PlayManual do +RSpec.describe Gitlab::Ci::Status::Stage::PlayManual do let(:stage) { double('stage') } let(:play_manual) { described_class.new(stage) } diff --git a/spec/lib/gitlab/ci/status/success_spec.rb b/spec/lib/gitlab/ci/status/success_spec.rb index d4b3a9f12cc..2d1c50448d4 100644 --- a/spec/lib/gitlab/ci/status/success_spec.rb +++ b/spec/lib/gitlab/ci/status/success_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::Success do +RSpec.describe Gitlab::Ci::Status::Success do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/status/success_warning_spec.rb b/spec/lib/gitlab/ci/status/success_warning_spec.rb index af952011e21..86b826ad272 100644 --- a/spec/lib/gitlab/ci/status/success_warning_spec.rb +++ b/spec/lib/gitlab/ci/status/success_warning_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::SuccessWarning do +RSpec.describe Gitlab::Ci::Status::SuccessWarning do let(:status) { double('status') } subject do diff --git a/spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb b/spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb index ed00dac8560..de18198c6c2 100644 --- a/spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb +++ b/spec/lib/gitlab/ci/status/waiting_for_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Status::WaitingForResource do +RSpec.describe Gitlab::Ci::Status::WaitingForResource do subject do described_class.new(double('subject'), double('user')) end diff --git a/spec/lib/gitlab/ci/templates/Jobs/browser_performance_testing_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/browser_performance_testing_gitlab_ci_yaml_spec.rb index 54c3500b0a0..5e5f28b2344 100644 --- a/spec/lib/gitlab/ci/templates/Jobs/browser_performance_testing_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/Jobs/browser_performance_testing_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do +RSpec.describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do subject(:template) do <<~YAML stages: diff --git a/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb index b2a9e3f5cf4..4f8faa5ddb1 100644 --- a/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Jobs/Build.gitlab-ci.yml' do +RSpec.describe 'Jobs/Build.gitlab-ci.yml' do subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Build') } describe 'the created pipeline' do diff --git a/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb index 9c5b2fd5099..e685ad3b46e 100644 --- a/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Jobs/Code-Quality.gitlab-ci.yml' do +RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Code-Quality') } describe 'the created pipeline' do diff --git a/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb index a6ae23c85d3..ea9bd5bd02c 100644 --- a/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Jobs/Deploy.gitlab-ci.yml' do +RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do subject(:template) do <<~YAML stages: diff --git a/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb index 2186bf038eb..f475785be98 100644 --- a/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Jobs/Test.gitlab-ci.yml' do +RSpec.describe 'Jobs/Test.gitlab-ci.yml' do subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Test') } describe 'the created pipeline' do diff --git a/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb index af6ec25b9d6..03523117500 100644 --- a/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Auto-DevOps.gitlab-ci.yml' do +RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Auto-DevOps') } describe 'the created pipeline' do diff --git a/spec/lib/gitlab/ci/templates/managed_cluster_applications_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/managed_cluster_applications_gitlab_ci_yaml_spec.rb index 2a6314755ef..0e458e01a2c 100644 --- a/spec/lib/gitlab/ci/templates/managed_cluster_applications_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/managed_cluster_applications_gitlab_ci_yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Managed-Cluster-Applications.gitlab-ci.yml' do +RSpec.describe 'Managed-Cluster-Applications.gitlab-ci.yml' do subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Managed-Cluster-Applications') } describe 'the created pipeline' do diff --git a/spec/lib/gitlab/ci/templates/templates_spec.rb b/spec/lib/gitlab/ci/templates/templates_spec.rb index bc3d5b89220..def4d1b3bf6 100644 --- a/spec/lib/gitlab/ci/templates/templates_spec.rb +++ b/spec/lib/gitlab/ci/templates/templates_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CI YML Templates' do +RSpec.describe 'CI YML Templates' do subject { Gitlab::Ci::YamlProcessor.new(content) } let(:all_templates) { Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name) } diff --git a/spec/lib/gitlab/ci/trace/chunked_io_spec.rb b/spec/lib/gitlab/ci/trace/chunked_io_spec.rb index 92b3e5562a9..a2903391c6f 100644 --- a/spec/lib/gitlab/ci/trace/chunked_io_spec.rb +++ b/spec/lib/gitlab/ci/trace/chunked_io_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do include ChunkedIOHelpers let_it_be(:build) { create(:ci_build, :running) } diff --git a/spec/lib/gitlab/ci/trace/section_parser_spec.rb b/spec/lib/gitlab/ci/trace/section_parser_spec.rb index 24ce4d34411..b6bb52a5c06 100644 --- a/spec/lib/gitlab/ci/trace/section_parser_spec.rb +++ b/spec/lib/gitlab/ci/trace/section_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Trace::SectionParser do +RSpec.describe Gitlab::Ci::Trace::SectionParser do def lines_with_pos(text) pos = 0 StringIO.new(text).each_line do |line| diff --git a/spec/lib/gitlab/ci/trace/stream_spec.rb b/spec/lib/gitlab/ci/trace/stream_spec.rb index ea79073840d..568c10bbac2 100644 --- a/spec/lib/gitlab/ci/trace/stream_spec.rb +++ b/spec/lib/gitlab/ci/trace/stream_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do let_it_be(:build) { create(:ci_build, :running) } before do diff --git a/spec/lib/gitlab/ci/trace_spec.rb b/spec/lib/gitlab/ci/trace_spec.rb index 574c2b73722..85edf27d3e7 100644 --- a/spec/lib/gitlab/ci/trace_spec.rb +++ b/spec/lib/gitlab/ci/trace_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Trace, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::Ci::Trace, :clean_gitlab_redis_shared_state do let(:build) { create(:ci_build) } let(:trace) { described_class.new(build) } diff --git a/spec/lib/gitlab/ci/variables/collection/item_spec.rb b/spec/lib/gitlab/ci/variables/collection/item_spec.rb index 1bdca753cd3..eba2f29836d 100644 --- a/spec/lib/gitlab/ci/variables/collection/item_spec.rb +++ b/spec/lib/gitlab/ci/variables/collection/item_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Variables::Collection::Item do +RSpec.describe Gitlab::Ci::Variables::Collection::Item do let(:variable_key) { 'VAR' } let(:variable_value) { 'something' } let(:expected_value) { variable_value } diff --git a/spec/lib/gitlab/ci/variables/collection_spec.rb b/spec/lib/gitlab/ci/variables/collection_spec.rb index 59b9f7d4fb9..ac84313ad9f 100644 --- a/spec/lib/gitlab/ci/variables/collection_spec.rb +++ b/spec/lib/gitlab/ci/variables/collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Ci::Variables::Collection do +RSpec.describe Gitlab::Ci::Variables::Collection do describe '.new' do it 'can be initialized with an array' do variable = { key: 'VAR', value: 'value', public: true, masked: false } diff --git a/spec/lib/gitlab/ci/yaml_processor_spec.rb b/spec/lib/gitlab/ci/yaml_processor_spec.rb index 07f3bd0917d..b7bcbf61ed4 100644 --- a/spec/lib/gitlab/ci/yaml_processor_spec.rb +++ b/spec/lib/gitlab/ci/yaml_processor_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' module Gitlab module Ci - describe YamlProcessor do + RSpec.describe YamlProcessor do include StubRequests subject { described_class.new(config, user: nil) } diff --git a/spec/lib/gitlab/ci_access_spec.rb b/spec/lib/gitlab/ci_access_spec.rb index 3c68d209eb6..9b573c6eb7a 100644 --- a/spec/lib/gitlab/ci_access_spec.rb +++ b/spec/lib/gitlab/ci_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CiAccess do +RSpec.describe Gitlab::CiAccess do let(:access) { described_class.new } describe '#can_do_action?' do diff --git a/spec/lib/gitlab/cleanup/orphan_job_artifact_files_batch_spec.rb b/spec/lib/gitlab/cleanup/orphan_job_artifact_files_batch_spec.rb index 4d8edfeac80..d03d4f64a0f 100644 --- a/spec/lib/gitlab/cleanup/orphan_job_artifact_files_batch_spec.rb +++ b/spec/lib/gitlab/cleanup/orphan_job_artifact_files_batch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Cleanup::OrphanJobArtifactFilesBatch do +RSpec.describe Gitlab::Cleanup::OrphanJobArtifactFilesBatch do let(:batch_size) { 10 } let(:dry_run) { true } diff --git a/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb b/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb index 966c4c8b2fb..8a7425a4156 100644 --- a/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb +++ b/spec/lib/gitlab/cleanup/orphan_job_artifact_files_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Cleanup::OrphanJobArtifactFiles do +RSpec.describe Gitlab::Cleanup::OrphanJobArtifactFiles do let(:null_logger) { Logger.new('/dev/null') } subject(:cleanup) { described_class.new(logger: null_logger) } diff --git a/spec/lib/gitlab/cleanup/orphan_lfs_file_references_spec.rb b/spec/lib/gitlab/cleanup/orphan_lfs_file_references_spec.rb index 01cc0b30784..47b2cf5dc4a 100644 --- a/spec/lib/gitlab/cleanup/orphan_lfs_file_references_spec.rb +++ b/spec/lib/gitlab/cleanup/orphan_lfs_file_references_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Cleanup::OrphanLfsFileReferences do +RSpec.describe Gitlab::Cleanup::OrphanLfsFileReferences do let(:null_logger) { Logger.new('/dev/null') } let(:project) { create(:project, :repository, lfs_enabled: true) } let(:lfs_object) { create(:lfs_object) } diff --git a/spec/lib/gitlab/cleanup/project_uploads_spec.rb b/spec/lib/gitlab/cleanup/project_uploads_spec.rb index d1e3a73686e..05d744d95e2 100644 --- a/spec/lib/gitlab/cleanup/project_uploads_spec.rb +++ b/spec/lib/gitlab/cleanup/project_uploads_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Cleanup::ProjectUploads do +RSpec.describe Gitlab::Cleanup::ProjectUploads do subject { described_class.new(logger: logger) } let(:logger) { double(:logger) } diff --git a/spec/lib/gitlab/cleanup/remote_uploads_spec.rb b/spec/lib/gitlab/cleanup/remote_uploads_spec.rb index 35642cd6e50..1752608f844 100644 --- a/spec/lib/gitlab/cleanup/remote_uploads_spec.rb +++ b/spec/lib/gitlab/cleanup/remote_uploads_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Cleanup::RemoteUploads do +RSpec.describe Gitlab::Cleanup::RemoteUploads do context 'when object_storage is enabled' do let(:connection) { double } let(:directory) { double } diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb index 4e1bf2840dc..f2bc6390032 100644 --- a/spec/lib/gitlab/closing_issue_extractor_spec.rb +++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ClosingIssueExtractor do +RSpec.describe Gitlab::ClosingIssueExtractor do let(:project) { create(:project) } let(:project2) { create(:project) } let(:forked_project) { Projects::ForkService.new(project, project2.creator).execute } diff --git a/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb b/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb index 864529a6bf6..5b69b34d04b 100644 --- a/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb +++ b/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' # For easier debugging set `PUMA_DEBUG=1` -describe Gitlab::Cluster::Mixins::PumaCluster do +RSpec.describe Gitlab::Cluster::Mixins::PumaCluster do before do stub_const('PUMA_STARTUP_TIMEOUT', 30) end diff --git a/spec/lib/gitlab/cluster/mixins/unicorn_http_server_spec.rb b/spec/lib/gitlab/cluster/mixins/unicorn_http_server_spec.rb index 3965eb722a0..0aaca0a79c2 100644 --- a/spec/lib/gitlab/cluster/mixins/unicorn_http_server_spec.rb +++ b/spec/lib/gitlab/cluster/mixins/unicorn_http_server_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' # For easier debugging set `UNICORN_DEBUG=1` -describe Gitlab::Cluster::Mixins::UnicornHttpServer do +RSpec.describe Gitlab::Cluster::Mixins::UnicornHttpServer do before do stub_const('UNICORN_STARTUP_TIMEOUT', 30) end diff --git a/spec/lib/gitlab/cluster/puma_worker_killer_observer_spec.rb b/spec/lib/gitlab/cluster/puma_worker_killer_observer_spec.rb index 6ed9dda08d7..948de161235 100644 --- a/spec/lib/gitlab/cluster/puma_worker_killer_observer_spec.rb +++ b/spec/lib/gitlab/cluster/puma_worker_killer_observer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Cluster::PumaWorkerKillerObserver do +RSpec.describe Gitlab::Cluster::PumaWorkerKillerObserver do let(:counter) { Gitlab::Metrics::NullMetric.instance } before do diff --git a/spec/lib/gitlab/cluster/rack_timeout_observer_spec.rb b/spec/lib/gitlab/cluster/rack_timeout_observer_spec.rb index 68e5435450c..05df4089075 100644 --- a/spec/lib/gitlab/cluster/rack_timeout_observer_spec.rb +++ b/spec/lib/gitlab/cluster/rack_timeout_observer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Cluster::RackTimeoutObserver do +RSpec.describe Gitlab::Cluster::RackTimeoutObserver do let(:counter) { Gitlab::Metrics::NullMetric.instance } before do diff --git a/spec/lib/gitlab/code_navigation_path_spec.rb b/spec/lib/gitlab/code_navigation_path_spec.rb index 07d4dfba622..534c9d59486 100644 --- a/spec/lib/gitlab/code_navigation_path_spec.rb +++ b/spec/lib/gitlab/code_navigation_path_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CodeNavigationPath do +RSpec.describe Gitlab::CodeNavigationPath do context 'when there is an artifact with code navigation data' do let_it_be(:project) { create(:project, :repository) } let_it_be(:sha) { project.repository.commits('master', limit: 5).last.id } diff --git a/spec/lib/gitlab/color_schemes_spec.rb b/spec/lib/gitlab/color_schemes_spec.rb index ba5573f6901..fd9fccc2bf7 100644 --- a/spec/lib/gitlab/color_schemes_spec.rb +++ b/spec/lib/gitlab/color_schemes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ColorSchemes do +RSpec.describe Gitlab::ColorSchemes do describe '.body_classes' do it 'returns a space-separated list of class names' do css = described_class.body_classes diff --git a/spec/lib/gitlab/config/entry/attributable_spec.rb b/spec/lib/gitlab/config/entry/attributable_spec.rb index 64a4670f483..1e7880ed898 100644 --- a/spec/lib/gitlab/config/entry/attributable_spec.rb +++ b/spec/lib/gitlab/config/entry/attributable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Attributable do +RSpec.describe Gitlab::Config::Entry::Attributable do let(:node) do Class.new do include Gitlab::Config::Entry::Attributable diff --git a/spec/lib/gitlab/config/entry/boolean_spec.rb b/spec/lib/gitlab/config/entry/boolean_spec.rb index 0b8b720dd80..86cd92e22d7 100644 --- a/spec/lib/gitlab/config/entry/boolean_spec.rb +++ b/spec/lib/gitlab/config/entry/boolean_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Boolean do +RSpec.describe Gitlab::Config::Entry::Boolean do let(:entry) { described_class.new(config) } describe 'validations' do diff --git a/spec/lib/gitlab/config/entry/configurable_spec.rb b/spec/lib/gitlab/config/entry/configurable_spec.rb index 8c3a4490d08..c72efa66024 100644 --- a/spec/lib/gitlab/config/entry/configurable_spec.rb +++ b/spec/lib/gitlab/config/entry/configurable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Configurable do +RSpec.describe Gitlab::Config::Entry::Configurable do let(:entry) do Class.new(Gitlab::Config::Entry::Node) do include Gitlab::Config::Entry::Configurable diff --git a/spec/lib/gitlab/config/entry/factory_spec.rb b/spec/lib/gitlab/config/entry/factory_spec.rb index 81ca5f2cba1..a00c45169ef 100644 --- a/spec/lib/gitlab/config/entry/factory_spec.rb +++ b/spec/lib/gitlab/config/entry/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Factory do +RSpec.describe Gitlab::Config::Entry::Factory do describe '#create!' do before do stub_const('Script', Class.new(Gitlab::Config::Entry::Node)) diff --git a/spec/lib/gitlab/config/entry/simplifiable_spec.rb b/spec/lib/gitlab/config/entry/simplifiable_spec.rb index 5c208cab449..2011587a342 100644 --- a/spec/lib/gitlab/config/entry/simplifiable_spec.rb +++ b/spec/lib/gitlab/config/entry/simplifiable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Simplifiable do +RSpec.describe Gitlab::Config::Entry::Simplifiable do describe '.strategy' do let(:entry) do Class.new(described_class) do diff --git a/spec/lib/gitlab/config/entry/undefined_spec.rb b/spec/lib/gitlab/config/entry/undefined_spec.rb index 83c3a6aec72..36faabd8e31 100644 --- a/spec/lib/gitlab/config/entry/undefined_spec.rb +++ b/spec/lib/gitlab/config/entry/undefined_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Undefined do +RSpec.describe Gitlab::Config::Entry::Undefined do let(:entry) { described_class.new } describe '#leaf?' do diff --git a/spec/lib/gitlab/config/entry/unspecified_spec.rb b/spec/lib/gitlab/config/entry/unspecified_spec.rb index 32c52594ecf..35ba992f62a 100644 --- a/spec/lib/gitlab/config/entry/unspecified_spec.rb +++ b/spec/lib/gitlab/config/entry/unspecified_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Unspecified do +RSpec.describe Gitlab::Config::Entry::Unspecified do let(:unspecified) { described_class.new(entry) } let(:entry) { spy('Entry') } diff --git a/spec/lib/gitlab/config/entry/validatable_spec.rb b/spec/lib/gitlab/config/entry/validatable_spec.rb index 925db3594ba..5e66de60367 100644 --- a/spec/lib/gitlab/config/entry/validatable_spec.rb +++ b/spec/lib/gitlab/config/entry/validatable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Validatable do +RSpec.describe Gitlab::Config::Entry::Validatable do let(:entry) do Class.new(Gitlab::Config::Entry::Node) do include Gitlab::Config::Entry::Validatable diff --git a/spec/lib/gitlab/config/entry/validator_spec.rb b/spec/lib/gitlab/config/entry/validator_spec.rb index 7bf350912df..d41f7f794ec 100644 --- a/spec/lib/gitlab/config/entry/validator_spec.rb +++ b/spec/lib/gitlab/config/entry/validator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Entry::Validator do +RSpec.describe Gitlab::Config::Entry::Validator do let(:validator) { Class.new(described_class) } let(:validator_instance) { validator.new(node) } let(:node) { spy('node') } diff --git a/spec/lib/gitlab/config/loader/yaml_spec.rb b/spec/lib/gitlab/config/loader/yaml_spec.rb index 623fe927233..731ee12d7f4 100644 --- a/spec/lib/gitlab/config/loader/yaml_spec.rb +++ b/spec/lib/gitlab/config/loader/yaml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Config::Loader::Yaml do +RSpec.describe Gitlab::Config::Loader::Yaml do let(:loader) { described_class.new(yml) } let(:yml) do diff --git a/spec/lib/gitlab/config_checker/external_database_checker_spec.rb b/spec/lib/gitlab/config_checker/external_database_checker_spec.rb index d86d132c237..c651868bd1e 100644 --- a/spec/lib/gitlab/config_checker/external_database_checker_spec.rb +++ b/spec/lib/gitlab/config_checker/external_database_checker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ConfigChecker::ExternalDatabaseChecker do +RSpec.describe Gitlab::ConfigChecker::ExternalDatabaseChecker do describe '#check' do subject { described_class.check } diff --git a/spec/lib/gitlab/config_checker/puma_rugged_checker_spec.rb b/spec/lib/gitlab/config_checker/puma_rugged_checker_spec.rb index badfd56d571..afee3c5536e 100644 --- a/spec/lib/gitlab/config_checker/puma_rugged_checker_spec.rb +++ b/spec/lib/gitlab/config_checker/puma_rugged_checker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ConfigChecker::PumaRuggedChecker do +RSpec.describe Gitlab::ConfigChecker::PumaRuggedChecker do describe '#check' do subject { described_class.check } diff --git a/spec/lib/gitlab/conflict/file_collection_spec.rb b/spec/lib/gitlab/conflict/file_collection_spec.rb index f3cdb1a9e59..6da7f8d530d 100644 --- a/spec/lib/gitlab/conflict/file_collection_spec.rb +++ b/spec/lib/gitlab/conflict/file_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Conflict::FileCollection do +RSpec.describe Gitlab::Conflict::FileCollection do let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start') } let(:file_collection) { described_class.new(merge_request) } diff --git a/spec/lib/gitlab/conflict/file_spec.rb b/spec/lib/gitlab/conflict/file_spec.rb index 966648bcc5a..b54fe40bb5f 100644 --- a/spec/lib/gitlab/conflict/file_spec.rb +++ b/spec/lib/gitlab/conflict/file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Conflict::File do +RSpec.describe Gitlab::Conflict::File do include GitHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/content_security_policy/config_loader_spec.rb b/spec/lib/gitlab/content_security_policy/config_loader_spec.rb index bbbbf91bd44..a94fd6acd32 100644 --- a/spec/lib/gitlab/content_security_policy/config_loader_spec.rb +++ b/spec/lib/gitlab/content_security_policy/config_loader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ContentSecurityPolicy::ConfigLoader do +RSpec.describe Gitlab::ContentSecurityPolicy::ConfigLoader do let(:policy) { ActionDispatch::ContentSecurityPolicy.new } let(:csp_config) do { diff --git a/spec/lib/gitlab/contributions_calendar_spec.rb b/spec/lib/gitlab/contributions_calendar_spec.rb index 97742a3e815..67b2ea7a1d4 100644 --- a/spec/lib/gitlab/contributions_calendar_spec.rb +++ b/spec/lib/gitlab/contributions_calendar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ContributionsCalendar do +RSpec.describe Gitlab::ContributionsCalendar do let(:contributor) { create(:user) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/cross_project_access/check_collection_spec.rb b/spec/lib/gitlab/cross_project_access/check_collection_spec.rb index 1aa5480b670..178188f5555 100644 --- a/spec/lib/gitlab/cross_project_access/check_collection_spec.rb +++ b/spec/lib/gitlab/cross_project_access/check_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CrossProjectAccess::CheckCollection do +RSpec.describe Gitlab::CrossProjectAccess::CheckCollection do subject(:collection) { described_class.new } describe '#add_collection' do diff --git a/spec/lib/gitlab/cross_project_access/check_info_spec.rb b/spec/lib/gitlab/cross_project_access/check_info_spec.rb index 7d2471b6327..5327030daf0 100644 --- a/spec/lib/gitlab/cross_project_access/check_info_spec.rb +++ b/spec/lib/gitlab/cross_project_access/check_info_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CrossProjectAccess::CheckInfo do +RSpec.describe Gitlab::CrossProjectAccess::CheckInfo do let(:dummy_controller) { double } before do diff --git a/spec/lib/gitlab/cross_project_access/class_methods_spec.rb b/spec/lib/gitlab/cross_project_access/class_methods_spec.rb index 17d265542dd..cc2c431fc07 100644 --- a/spec/lib/gitlab/cross_project_access/class_methods_spec.rb +++ b/spec/lib/gitlab/cross_project_access/class_methods_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CrossProjectAccess::ClassMethods do +RSpec.describe Gitlab::CrossProjectAccess::ClassMethods do let(:dummy_class) do Class.new do extend Gitlab::CrossProjectAccess::ClassMethods diff --git a/spec/lib/gitlab/cross_project_access_spec.rb b/spec/lib/gitlab/cross_project_access_spec.rb index ce18d207413..fb72b85f161 100644 --- a/spec/lib/gitlab/cross_project_access_spec.rb +++ b/spec/lib/gitlab/cross_project_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CrossProjectAccess do +RSpec.describe Gitlab::CrossProjectAccess do let(:super_class) { Class.new } let(:descendant_class) { Class.new(super_class) } let(:current_instance) { described_class.new } diff --git a/spec/lib/gitlab/crypto_helper_spec.rb b/spec/lib/gitlab/crypto_helper_spec.rb index 71bbeccb17b..c07089d8ef0 100644 --- a/spec/lib/gitlab/crypto_helper_spec.rb +++ b/spec/lib/gitlab/crypto_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CryptoHelper do +RSpec.describe Gitlab::CryptoHelper do describe '.sha256' do it 'generates SHA256 digest Base46 encoded' do digest = described_class.sha256('some-value') diff --git a/spec/lib/gitlab/current_settings_spec.rb b/spec/lib/gitlab/current_settings_spec.rb index bfd9980ee9c..fd4e8bc1cd0 100644 --- a/spec/lib/gitlab/current_settings_spec.rb +++ b/spec/lib/gitlab/current_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CurrentSettings do +RSpec.describe Gitlab::CurrentSettings do before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') end diff --git a/spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb index 3eea791d61a..056c1b5bc9f 100644 --- a/spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/base_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::BaseEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::BaseEventFetcher do let(:max_events) { 2 } let(:project) { create(:project, :repository) } let(:user) { create(:user, :admin) } diff --git a/spec/lib/gitlab/cycle_analytics/code_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/code_event_fetcher_spec.rb index 326a41a3af7..a1a173abe57 100644 --- a/spec/lib/gitlab/cycle_analytics/code_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/code_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::CodeEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::CodeEventFetcher do let(:stage_name) { :code } it_behaves_like 'default query config' do diff --git a/spec/lib/gitlab/cycle_analytics/code_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/code_stage_spec.rb index 9a4193b09f5..afab19de2ab 100644 --- a/spec/lib/gitlab/cycle_analytics/code_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/code_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::CodeStage do +RSpec.describe Gitlab::CycleAnalytics::CodeStage do let(:stage_name) { :code } let(:project) { create(:project) } diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb index 9eee7e89062..246003cde84 100644 --- a/spec/lib/gitlab/cycle_analytics/events_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'cycle analytics events' do +RSpec.describe 'cycle analytics events' do let(:project) { create(:project, :repository) } let(:from_date) { 10.days.ago } let(:user) { create(:user, :admin) } diff --git a/spec/lib/gitlab/cycle_analytics/issue_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/issue_event_fetcher_spec.rb index a72e2952782..7a49ee53e8f 100644 --- a/spec/lib/gitlab/cycle_analytics/issue_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/issue_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::IssueEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::IssueEventFetcher do let(:stage_name) { :issue } it_behaves_like 'default query config' diff --git a/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb index 021d31bf160..9ec71e6ed72 100644 --- a/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/issue_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::IssueStage do +RSpec.describe Gitlab::CycleAnalytics::IssueStage do let(:stage_name) { :issue } let(:project) { create(:project) } let(:issue_1) { create(:issue, project: project, created_at: 90.minutes.ago) } diff --git a/spec/lib/gitlab/cycle_analytics/permissions_spec.rb b/spec/lib/gitlab/cycle_analytics/permissions_spec.rb index 2896e973a43..3fd48993e5f 100644 --- a/spec/lib/gitlab/cycle_analytics/permissions_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/permissions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::Permissions do +RSpec.describe Gitlab::CycleAnalytics::Permissions do let(:project) { create(:project, public_builds: false) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/cycle_analytics/plan_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/plan_event_fetcher_spec.rb index 587f185b970..bc14a772d34 100644 --- a/spec/lib/gitlab/cycle_analytics/plan_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/plan_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::PlanEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::PlanEventFetcher do let(:stage_name) { :plan } it_behaves_like 'default query config' do diff --git a/spec/lib/gitlab/cycle_analytics/plan_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/plan_stage_spec.rb index e391fa6b999..66d00edacb7 100644 --- a/spec/lib/gitlab/cycle_analytics/plan_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/plan_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::PlanStage do +RSpec.describe Gitlab::CycleAnalytics::PlanStage do let(:stage_name) { :plan } let(:project) { create(:project) } let!(:issue_1) { create(:issue, project: project, created_at: 90.minutes.ago) } diff --git a/spec/lib/gitlab/cycle_analytics/production_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/production_event_fetcher_spec.rb index aeca72e8c91..86b07a95cbb 100644 --- a/spec/lib/gitlab/cycle_analytics/production_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/production_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::ProductionEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::ProductionEventFetcher do let(:stage_name) { :production } it_behaves_like 'default query config' diff --git a/spec/lib/gitlab/cycle_analytics/production_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/production_stage_spec.rb index aeeae291e2e..73b17194f72 100644 --- a/spec/lib/gitlab/cycle_analytics/production_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/production_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::ProductionStage do +RSpec.describe Gitlab::CycleAnalytics::ProductionStage do let(:stage_name) { 'Total' } it_behaves_like 'base stage' diff --git a/spec/lib/gitlab/cycle_analytics/review_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/review_event_fetcher_spec.rb index 3eb62b45e6f..fe13cc6b065 100644 --- a/spec/lib/gitlab/cycle_analytics/review_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/review_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::ReviewEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::ReviewEventFetcher do let(:stage_name) { :review } it_behaves_like 'default query config' diff --git a/spec/lib/gitlab/cycle_analytics/review_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/review_stage_spec.rb index 14100ee6f73..cdd1cca6837 100644 --- a/spec/lib/gitlab/cycle_analytics/review_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/review_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::ReviewStage do +RSpec.describe Gitlab::CycleAnalytics::ReviewStage do let(:stage_name) { :review } let(:project) { create(:project) } let(:issue_1) { create(:issue, project: project, created_at: 90.minutes.ago) } diff --git a/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb b/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb index ccc99017e37..9ece24074e7 100644 --- a/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/stage_summary_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::StageSummary do +RSpec.describe Gitlab::CycleAnalytics::StageSummary do let(:project) { create(:project, :repository) } let(:options) { { from: 1.day.ago, current_user: user } } let(:user) { create(:user, :admin) } diff --git a/spec/lib/gitlab/cycle_analytics/staging_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/staging_event_fetcher_spec.rb index 525f1608a70..bdf1b99c4c9 100644 --- a/spec/lib/gitlab/cycle_analytics/staging_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/staging_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::StagingEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::StagingEventFetcher do let(:stage_name) { :staging } it_behaves_like 'default query config' do diff --git a/spec/lib/gitlab/cycle_analytics/staging_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/staging_stage_spec.rb index 930892edd31..69e42adb139 100644 --- a/spec/lib/gitlab/cycle_analytics/staging_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/staging_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::StagingStage do +RSpec.describe Gitlab::CycleAnalytics::StagingStage do let(:stage_name) { :staging } let(:project) { create(:project) } diff --git a/spec/lib/gitlab/cycle_analytics/summary/value_spec.rb b/spec/lib/gitlab/cycle_analytics/summary/value_spec.rb index d9bdfa92a04..c955b288500 100644 --- a/spec/lib/gitlab/cycle_analytics/summary/value_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/summary/value_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::Summary::Value do +RSpec.describe Gitlab::CycleAnalytics::Summary::Value do describe Gitlab::CycleAnalytics::Summary::Value::None do it 'returns `-`' do expect(described_class.new.to_s).to eq('-') diff --git a/spec/lib/gitlab/cycle_analytics/test_event_fetcher_spec.rb b/spec/lib/gitlab/cycle_analytics/test_event_fetcher_spec.rb index d550f083600..1277385d0b4 100644 --- a/spec/lib/gitlab/cycle_analytics/test_event_fetcher_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/test_event_fetcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::TestEventFetcher do +RSpec.describe Gitlab::CycleAnalytics::TestEventFetcher do let(:stage_name) { :test } it_behaves_like 'default query config' do diff --git a/spec/lib/gitlab/cycle_analytics/test_stage_spec.rb b/spec/lib/gitlab/cycle_analytics/test_stage_spec.rb index 56e90520e72..9a207d32167 100644 --- a/spec/lib/gitlab/cycle_analytics/test_stage_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/test_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::TestStage do +RSpec.describe Gitlab::CycleAnalytics::TestStage do let(:stage_name) { :test } let(:project) { create(:project) } let(:stage_options) { { from: 2.days.ago, current_user: project.creator, project: project } } diff --git a/spec/lib/gitlab/cycle_analytics/updater_spec.rb b/spec/lib/gitlab/cycle_analytics/updater_spec.rb index 67f386f9144..f7095cffc19 100644 --- a/spec/lib/gitlab/cycle_analytics/updater_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/updater_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::Updater do +RSpec.describe Gitlab::CycleAnalytics::Updater do describe 'updates authors' do let(:user) { create(:user) } let(:events) { [{ 'author_id' => user.id }] } diff --git a/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb b/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb index 41ce9355708..9ebdacb16de 100644 --- a/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb +++ b/spec/lib/gitlab/cycle_analytics/usage_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::CycleAnalytics::UsageData do +RSpec.describe Gitlab::CycleAnalytics::UsageData do describe '#to_json' do before do # Since git commits only have second precision, round up to the diff --git a/spec/lib/gitlab/daemon_spec.rb b/spec/lib/gitlab/daemon_spec.rb index cf1f089c577..075a1e414c7 100644 --- a/spec/lib/gitlab/daemon_spec.rb +++ b/spec/lib/gitlab/daemon_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Daemon do +RSpec.describe Gitlab::Daemon do subject { described_class.new } before do diff --git a/spec/lib/gitlab/danger/changelog_spec.rb b/spec/lib/gitlab/danger/changelog_spec.rb index 130a4708cec..3e9990a45fe 100644 --- a/spec/lib/gitlab/danger/changelog_spec.rb +++ b/spec/lib/gitlab/danger/changelog_spec.rb @@ -6,7 +6,7 @@ require_relative 'danger_spec_helper' require 'gitlab/danger/changelog' -describe Gitlab::Danger::Changelog do +RSpec.describe Gitlab::Danger::Changelog do using RSpec::Parameterized::TableSyntax include DangerSpecHelper diff --git a/spec/lib/gitlab/danger/commit_linter_spec.rb b/spec/lib/gitlab/danger/commit_linter_spec.rb index e57ccd12fa5..3924e20c243 100644 --- a/spec/lib/gitlab/danger/commit_linter_spec.rb +++ b/spec/lib/gitlab/danger/commit_linter_spec.rb @@ -6,7 +6,7 @@ require_relative 'danger_spec_helper' require 'gitlab/danger/commit_linter' -describe Gitlab::Danger::CommitLinter do +RSpec.describe Gitlab::Danger::CommitLinter do using RSpec::Parameterized::TableSyntax let(:total_files_changed) { 2 } diff --git a/spec/lib/gitlab/danger/emoji_checker_spec.rb b/spec/lib/gitlab/danger/emoji_checker_spec.rb index 0cdc18ce626..6092c751e1c 100644 --- a/spec/lib/gitlab/danger/emoji_checker_spec.rb +++ b/spec/lib/gitlab/danger/emoji_checker_spec.rb @@ -5,7 +5,7 @@ require 'rspec-parameterized' require 'gitlab/danger/emoji_checker' -describe Gitlab::Danger::EmojiChecker do +RSpec.describe Gitlab::Danger::EmojiChecker do using RSpec::Parameterized::TableSyntax describe '#includes_text_emoji?' do diff --git a/spec/lib/gitlab/danger/helper_spec.rb b/spec/lib/gitlab/danger/helper_spec.rb index 809064a540c..29de2b99477 100644 --- a/spec/lib/gitlab/danger/helper_spec.rb +++ b/spec/lib/gitlab/danger/helper_spec.rb @@ -6,7 +6,7 @@ require_relative 'danger_spec_helper' require 'gitlab/danger/helper' -describe Gitlab::Danger::Helper do +RSpec.describe Gitlab::Danger::Helper do using RSpec::Parameterized::TableSyntax include DangerSpecHelper diff --git a/spec/lib/gitlab/danger/roulette_spec.rb b/spec/lib/gitlab/danger/roulette_spec.rb index a9ea2dd1d62..272666fceac 100644 --- a/spec/lib/gitlab/danger/roulette_spec.rb +++ b/spec/lib/gitlab/danger/roulette_spec.rb @@ -5,7 +5,7 @@ require 'webmock/rspec' require 'gitlab/danger/roulette' -describe Gitlab::Danger::Roulette do +RSpec.describe Gitlab::Danger::Roulette do let(:backend_maintainer) do { username: 'backend-maintainer', diff --git a/spec/lib/gitlab/danger/teammate_spec.rb b/spec/lib/gitlab/danger/teammate_spec.rb index 497d1271787..cdc4c5feb4f 100644 --- a/spec/lib/gitlab/danger/teammate_spec.rb +++ b/spec/lib/gitlab/danger/teammate_spec.rb @@ -6,7 +6,7 @@ require 'rspec-parameterized' require 'gitlab/danger/teammate' -describe Gitlab::Danger::Teammate do +RSpec.describe Gitlab::Danger::Teammate do subject { described_class.new(options.stringify_keys) } let(:options) { { username: 'luigi', projects: projects, role: role } } diff --git a/spec/lib/gitlab/data_builder/build_spec.rb b/spec/lib/gitlab/data_builder/build_spec.rb index da27125c9a6..cfaaf849b09 100644 --- a/spec/lib/gitlab/data_builder/build_spec.rb +++ b/spec/lib/gitlab/data_builder/build_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Build do +RSpec.describe Gitlab::DataBuilder::Build do let(:runner) { create(:ci_runner, :instance) } let(:user) { create(:user) } let(:build) { create(:ci_build, :running, runner: runner, user: user) } diff --git a/spec/lib/gitlab/data_builder/deployment_spec.rb b/spec/lib/gitlab/data_builder/deployment_spec.rb index 42d7329494d..57bde6262a9 100644 --- a/spec/lib/gitlab/data_builder/deployment_spec.rb +++ b/spec/lib/gitlab/data_builder/deployment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Deployment do +RSpec.describe Gitlab::DataBuilder::Deployment do describe '.build' do it 'returns the object kind for a deployment' do deployment = build(:deployment) diff --git a/spec/lib/gitlab/data_builder/note_spec.rb b/spec/lib/gitlab/data_builder/note_spec.rb index 4b799c23de8..90ca5430526 100644 --- a/spec/lib/gitlab/data_builder/note_spec.rb +++ b/spec/lib/gitlab/data_builder/note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Note do +RSpec.describe Gitlab::DataBuilder::Note do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:data) { described_class.build(note, user) } diff --git a/spec/lib/gitlab/data_builder/pipeline_spec.rb b/spec/lib/gitlab/data_builder/pipeline_spec.rb index 519f5873d75..4e0cc8a1fa9 100644 --- a/spec/lib/gitlab/data_builder/pipeline_spec.rb +++ b/spec/lib/gitlab/data_builder/pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Pipeline do +RSpec.describe Gitlab::DataBuilder::Pipeline do let(:user) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/data_builder/push_spec.rb b/spec/lib/gitlab/data_builder/push_spec.rb index cbc03fc38eb..7eb81a880bf 100644 --- a/spec/lib/gitlab/data_builder/push_spec.rb +++ b/spec/lib/gitlab/data_builder/push_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DataBuilder::Push do +RSpec.describe Gitlab::DataBuilder::Push do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/data_builder/wiki_page_spec.rb b/spec/lib/gitlab/data_builder/wiki_page_spec.rb index ae338e30a69..ec768cf9719 100644 --- a/spec/lib/gitlab/data_builder/wiki_page_spec.rb +++ b/spec/lib/gitlab/data_builder/wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DataBuilder::WikiPage do +RSpec.describe Gitlab::DataBuilder::WikiPage do let_it_be(:project) { create(:project, :repository, :wiki_repo) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/database/batch_count_spec.rb b/spec/lib/gitlab/database/batch_count_spec.rb index e7cb53f2dbd..656501dbf56 100644 --- a/spec/lib/gitlab/database/batch_count_spec.rb +++ b/spec/lib/gitlab/database/batch_count_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::BatchCount do +RSpec.describe Gitlab::Database::BatchCount do let_it_be(:fallback) { ::Gitlab::Database::BatchCounter::FALLBACK } let_it_be(:small_batch_size) { ::Gitlab::Database::BatchCounter::MIN_REQUIRED_BATCH_SIZE - 1 } let(:model) { Issue } diff --git a/spec/lib/gitlab/database/connection_timer_spec.rb b/spec/lib/gitlab/database/connection_timer_spec.rb index c9e9d770343..2b6746bae07 100644 --- a/spec/lib/gitlab/database/connection_timer_spec.rb +++ b/spec/lib/gitlab/database/connection_timer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::ConnectionTimer do +RSpec.describe Gitlab::Database::ConnectionTimer do let(:current_clock_value) { 1234.56 } before do diff --git a/spec/lib/gitlab/database/count/exact_count_strategy_spec.rb b/spec/lib/gitlab/database/count/exact_count_strategy_spec.rb index 111833a506a..390620379d6 100644 --- a/spec/lib/gitlab/database/count/exact_count_strategy_spec.rb +++ b/spec/lib/gitlab/database/count/exact_count_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::Count::ExactCountStrategy do +RSpec.describe Gitlab::Database::Count::ExactCountStrategy do before do create_list(:project, 3) create(:identity) diff --git a/spec/lib/gitlab/database/count/reltuples_count_strategy_spec.rb b/spec/lib/gitlab/database/count/reltuples_count_strategy_spec.rb index 08032d19d14..324ed498abc 100644 --- a/spec/lib/gitlab/database/count/reltuples_count_strategy_spec.rb +++ b/spec/lib/gitlab/database/count/reltuples_count_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::Count::ReltuplesCountStrategy do +RSpec.describe Gitlab::Database::Count::ReltuplesCountStrategy do before do create_list(:project, 3) create(:identity) diff --git a/spec/lib/gitlab/database/count/tablesample_count_strategy_spec.rb b/spec/lib/gitlab/database/count/tablesample_count_strategy_spec.rb index 0c480709c22..e488bf5ee4c 100644 --- a/spec/lib/gitlab/database/count/tablesample_count_strategy_spec.rb +++ b/spec/lib/gitlab/database/count/tablesample_count_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::Count::TablesampleCountStrategy do +RSpec.describe Gitlab::Database::Count::TablesampleCountStrategy do before do create_list(:project, 3) create(:identity) diff --git a/spec/lib/gitlab/database/count_spec.rb b/spec/lib/gitlab/database/count_spec.rb index 2469ce482e7..d65413c2a00 100644 --- a/spec/lib/gitlab/database/count_spec.rb +++ b/spec/lib/gitlab/database/count_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::Count do +RSpec.describe Gitlab::Database::Count do before do create_list(:project, 3) create(:identity) diff --git a/spec/lib/gitlab/database/grant_spec.rb b/spec/lib/gitlab/database/grant_spec.rb index 02697eb2a16..23aec85d1d0 100644 --- a/spec/lib/gitlab/database/grant_spec.rb +++ b/spec/lib/gitlab/database/grant_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::Grant do +RSpec.describe Gitlab::Database::Grant do describe '.create_and_execute_trigger' do it 'returns true when the user can create and execute a trigger' do # We assume the DB/user is set up correctly so that triggers can be diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index 1f725687bdc..12f97d23a6b 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::MigrationHelpers do +RSpec.describe Gitlab::Database::MigrationHelpers do let(:model) do ActiveRecord::Migration.new.extend(described_class) end diff --git a/spec/lib/gitlab/database/multi_threaded_migration_spec.rb b/spec/lib/gitlab/database/multi_threaded_migration_spec.rb index 53c001fbc1b..78dd9e88064 100644 --- a/spec/lib/gitlab/database/multi_threaded_migration_spec.rb +++ b/spec/lib/gitlab/database/multi_threaded_migration_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::MultiThreadedMigration do +RSpec.describe Gitlab::Database::MultiThreadedMigration do let(:migration) do Class.new { include Gitlab::Database::MultiThreadedMigration }.new end diff --git a/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb b/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb index dee1d7df1a9..034bf966db7 100644 --- a/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb +++ b/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::ObsoleteIgnoredColumns do +RSpec.describe Gitlab::Database::ObsoleteIgnoredColumns do before do stub_const('Testing', Module.new) stub_const('Testing::MyBase', Class.new(ActiveRecord::Base)) diff --git a/spec/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers_spec.rb b/spec/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers_spec.rb index 9cec77b434d..efa9c83b2d2 100644 --- a/spec/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers_spec.rb +++ b/spec/lib/gitlab/database/partitioning_migration_helpers/foreign_key_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers do +RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::ForeignKeyHelpers do include TriggerHelpers let(:model) do diff --git a/spec/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key_spec.rb b/spec/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key_spec.rb index 77f71676252..a58c37f111d 100644 --- a/spec/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key_spec.rb +++ b/spec/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::PartitioningMigrationHelpers::PartitionedForeignKey do +RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::PartitionedForeignKey do let(:foreign_key) do described_class.new( to_table: 'issues', diff --git a/spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb b/spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb index c78c143f2f8..db7a65742c5 100644 --- a/spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb +++ b/spec/lib/gitlab/database/partitioning_migration_helpers/table_management_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers do +RSpec.describe Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers do include PartitioningHelpers include TriggerHelpers diff --git a/spec/lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin_spec.rb b/spec/lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin_spec.rb index 0523066b593..8b3a0ceb804 100644 --- a/spec/lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin_spec.rb +++ b/spec/lib/gitlab/database/postgresql_adapter/force_disconnectable_mixin_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin do +RSpec.describe Gitlab::Database::PostgresqlAdapter::ForceDisconnectableMixin do describe 'checking in a connection to the pool' do let(:model) do Class.new(ActiveRecord::Base) do diff --git a/spec/lib/gitlab/database/postgresql_adapter/schema_versions_copy_mixin_spec.rb b/spec/lib/gitlab/database/postgresql_adapter/schema_versions_copy_mixin_spec.rb index 968dfc1ea43..c6333e4a4dc 100644 --- a/spec/lib/gitlab/database/postgresql_adapter/schema_versions_copy_mixin_spec.rb +++ b/spec/lib/gitlab/database/postgresql_adapter/schema_versions_copy_mixin_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::PostgresqlAdapter::SchemaVersionsCopyMixin do +RSpec.describe Gitlab::Database::PostgresqlAdapter::SchemaVersionsCopyMixin do let(:schema_migration) { double('schem_migration', table_name: table_name, all_versions: versions) } let(:versions) { %w(5 2 1000 200 4 93 2) } let(:table_name) { "schema_migrations" } diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb index fae57996fb6..76b1be1e497 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete do +RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete do let(:migration) { FakeRenameReservedPathMigrationV1.new } let(:subject) { described_class.new(['the-path'], migration) } diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb index 46fc48ab3fc..e222a29c6a1 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :delete do +RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameNamespaces, :delete do let(:migration) { FakeRenameReservedPathMigrationV1.new } let(:subject) { described_class.new(['the-path'], migration) } let(:namespace) { create(:group, name: 'the-path') } diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb index 1ccdb1d9447..3799fe3c316 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :delete do +RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameProjects, :delete do let(:migration) { FakeRenameReservedPathMigrationV1.new } let(:subject) { described_class.new(['the-path'], migration) } let(:project) do diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb index 56767c21ab7..3b2d3ab1354 100644 --- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb +++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -shared_examples 'renames child namespaces' do |type| +RSpec.shared_examples 'renames child namespaces' do |type| it 'renames namespaces' do rename_namespaces = double expect(described_class::RenameNamespaces) @@ -15,7 +15,7 @@ shared_examples 'renames child namespaces' do |type| end end -describe Gitlab::Database::RenameReservedPathsMigration::V1, :delete do +RSpec.describe Gitlab::Database::RenameReservedPathsMigration::V1, :delete do let(:subject) { FakeRenameReservedPathMigrationV1.new } before do diff --git a/spec/lib/gitlab/database/schema_cleaner_spec.rb b/spec/lib/gitlab/database/schema_cleaner_spec.rb index adaeb85d52d..1303ad7a311 100644 --- a/spec/lib/gitlab/database/schema_cleaner_spec.rb +++ b/spec/lib/gitlab/database/schema_cleaner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::SchemaCleaner do +RSpec.describe Gitlab::Database::SchemaCleaner do let(:example_schema) { fixture_file(File.join('gitlab', 'database', 'structure_example.sql')) } let(:io) { StringIO.new } diff --git a/spec/lib/gitlab/database/sha_attribute_spec.rb b/spec/lib/gitlab/database/sha_attribute_spec.rb index 15695bc8069..1b855625a6c 100644 --- a/spec/lib/gitlab/database/sha_attribute_spec.rb +++ b/spec/lib/gitlab/database/sha_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::ShaAttribute do +RSpec.describe Gitlab::Database::ShaAttribute do let(:sha) do '9a573a369a5bfbb9a4a36e98852c21af8a44ea8b' end diff --git a/spec/lib/gitlab/database/with_lock_retries_spec.rb b/spec/lib/gitlab/database/with_lock_retries_spec.rb index d7eee594631..70cbddbb7b7 100644 --- a/spec/lib/gitlab/database/with_lock_retries_spec.rb +++ b/spec/lib/gitlab/database/with_lock_retries_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database::WithLockRetries do +RSpec.describe Gitlab::Database::WithLockRetries do let(:env) { {} } let(:logger) { Gitlab::Database::WithLockRetries::NULL_LOGGER } let(:subject) { described_class.new(env: env, logger: logger, timing_configuration: timing_configuration) } diff --git a/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb b/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb index e6321d48e11..fdf16069381 100644 --- a/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb +++ b/spec/lib/gitlab/database_importers/common_metrics/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DatabaseImporters::CommonMetrics::Importer do +RSpec.describe Gitlab::DatabaseImporters::CommonMetrics::Importer do subject { described_class.new } context "does import common_metrics.yml" do diff --git a/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb b/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb index 37d6fcdab58..67da59d6477 100644 --- a/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb +++ b/spec/lib/gitlab/database_importers/common_metrics/prometheus_metric_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetric do +RSpec.describe Gitlab::DatabaseImporters::CommonMetrics::PrometheusMetric do it 'group enum equals ::PrometheusMetric' do expect(described_class.groups).to eq(::PrometheusMetric.groups) end diff --git a/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb b/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb index 97f4a7eec75..a3661bbe49a 100644 --- a/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb +++ b/spec/lib/gitlab/database_importers/instance_administrators/create_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DatabaseImporters::InstanceAdministrators::CreateGroup do +RSpec.describe Gitlab::DatabaseImporters::InstanceAdministrators::CreateGroup do describe '#execute' do let(:result) { subject.execute } diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb index 923f620a81d..ca9f9ab915f 100644 --- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb +++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do +RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do describe '#execute' do let(:result) { subject.execute } diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/delete_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/delete_service_spec.rb index 89d816c0cf7..9d514bcc661 100644 --- a/spec/lib/gitlab/database_importers/self_monitoring/project/delete_service_spec.rb +++ b/spec/lib/gitlab/database_importers/self_monitoring/project/delete_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do +RSpec.describe Gitlab::DatabaseImporters::SelfMonitoring::Project::DeleteService do describe '#execute' do let!(:application_setting) { create(:application_setting) } let(:result) { subject.execute } diff --git a/spec/lib/gitlab/database_spec.rb b/spec/lib/gitlab/database_spec.rb index b99f311de29..b47ce374c8e 100644 --- a/spec/lib/gitlab/database_spec.rb +++ b/spec/lib/gitlab/database_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Database do +RSpec.describe Gitlab::Database do before do stub_const('MigrationTest', Class.new { include Gitlab::Database }) end diff --git a/spec/lib/gitlab/dependency_linker/base_linker_spec.rb b/spec/lib/gitlab/dependency_linker/base_linker_spec.rb index 1466ce2dfcc..678d4a90e8d 100644 --- a/spec/lib/gitlab/dependency_linker/base_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/base_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::BaseLinker do +RSpec.describe Gitlab::DependencyLinker::BaseLinker do let(:linker_class) do Class.new(described_class) do def link_dependencies diff --git a/spec/lib/gitlab/dependency_linker/cargo_toml_linker_spec.rb b/spec/lib/gitlab/dependency_linker/cargo_toml_linker_spec.rb index 86d5bc93bf7..8068fa30367 100644 --- a/spec/lib/gitlab/dependency_linker/cargo_toml_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/cargo_toml_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::CargoTomlLinker do +RSpec.describe Gitlab::DependencyLinker::CargoTomlLinker do describe '.support?' do it 'supports Cargo.toml' do expect(described_class.support?('Cargo.toml')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb b/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb index 6d61edaa870..52ddba24458 100644 --- a/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/cartfile_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::CartfileLinker do +RSpec.describe Gitlab::DependencyLinker::CartfileLinker do describe '.support?' do it 'supports Cartfile' do expect(described_class.support?('Cartfile')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb index cc1f09628ef..c24d6a44d9b 100644 --- a/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/composer_json_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::ComposerJsonLinker do +RSpec.describe Gitlab::DependencyLinker::ComposerJsonLinker do describe '.support?' do it 'supports composer.json' do expect(described_class.support?('composer.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb b/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb index c6b6dfa77cb..00e95dea224 100644 --- a/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/gemfile_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::GemfileLinker do +RSpec.describe Gitlab::DependencyLinker::GemfileLinker do describe '.support?' do it 'supports Gemfile' do expect(described_class.support?('Gemfile')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb b/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb index c1cbfa31684..ae82dd51c95 100644 --- a/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/gemspec_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::GemspecLinker do +RSpec.describe Gitlab::DependencyLinker::GemspecLinker do describe '.support?' do it 'supports *.gemspec' do expect(described_class.support?('gitlab_git.gemspec')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb index 7128689e362..c1ed030c548 100644 --- a/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/godeps_json_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::GodepsJsonLinker do +RSpec.describe Gitlab::DependencyLinker::GodepsJsonLinker do describe '.support?' do it 'supports Godeps.json' do expect(described_class.support?('Godeps.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb index eb0c5e0675a..cdfc0e89bc7 100644 --- a/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/package_json_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::PackageJsonLinker do +RSpec.describe Gitlab::DependencyLinker::PackageJsonLinker do describe '.support?' do it 'supports package.json' do expect(described_class.support?('package.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/parser/gemfile_spec.rb b/spec/lib/gitlab/dependency_linker/parser/gemfile_spec.rb index 5b69ef5af24..15f580a3a60 100644 --- a/spec/lib/gitlab/dependency_linker/parser/gemfile_spec.rb +++ b/spec/lib/gitlab/dependency_linker/parser/gemfile_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::Parser::Gemfile do +RSpec.describe Gitlab::DependencyLinker::Parser::Gemfile do describe '#parse' do let(:file_content) do <<-CONTENT.strip_heredoc diff --git a/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb b/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb index 77326e73505..8e536c00ea6 100644 --- a/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/podfile_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::PodfileLinker do +RSpec.describe Gitlab::DependencyLinker::PodfileLinker do describe '.support?' do it 'supports Podfile' do expect(described_class.support?('Podfile')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb b/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb index d522a08cdd9..1f81049a41e 100644 --- a/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/podspec_json_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::PodspecJsonLinker do +RSpec.describe Gitlab::DependencyLinker::PodspecJsonLinker do describe '.support?' do it 'supports *.podspec.json' do expect(described_class.support?('Reachability.podspec.json')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb b/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb index baabd0c0460..132b5b21d85 100644 --- a/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/podspec_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::PodspecLinker do +RSpec.describe Gitlab::DependencyLinker::PodspecLinker do describe '.support?' do it 'supports *.podspec' do expect(described_class.support?('Reachability.podspec')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb b/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb index 04ac5f10479..e59756cb7bc 100644 --- a/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker/requirements_txt_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker::RequirementsTxtLinker do +RSpec.describe Gitlab::DependencyLinker::RequirementsTxtLinker do describe '.support?' do it 'supports requirements.txt' do expect(described_class.support?('requirements.txt')).to be_truthy diff --git a/spec/lib/gitlab/dependency_linker_spec.rb b/spec/lib/gitlab/dependency_linker_spec.rb index acd4376615c..2daa8df815d 100644 --- a/spec/lib/gitlab/dependency_linker_spec.rb +++ b/spec/lib/gitlab/dependency_linker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DependencyLinker do +RSpec.describe Gitlab::DependencyLinker do describe '.link' do it 'links using GemfileLinker' do blob_name = 'Gemfile' diff --git a/spec/lib/gitlab/devise_failure_spec.rb b/spec/lib/gitlab/devise_failure_spec.rb index eee05c7befd..a452de59795 100644 --- a/spec/lib/gitlab/devise_failure_spec.rb +++ b/spec/lib/gitlab/devise_failure_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DeviseFailure do +RSpec.describe Gitlab::DeviseFailure do let(:env) do { 'REQUEST_URI' => 'http://test.host/', diff --git a/spec/lib/gitlab/diff/diff_refs_spec.rb b/spec/lib/gitlab/diff/diff_refs_spec.rb index 33a7cf5ae12..c1ee34ba874 100644 --- a/spec/lib/gitlab/diff/diff_refs_spec.rb +++ b/spec/lib/gitlab/diff/diff_refs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::DiffRefs do +RSpec.describe Gitlab::Diff::DiffRefs do let(:project) { create(:project, :repository) } describe '#==' do diff --git a/spec/lib/gitlab/diff/file_collection/commit_spec.rb b/spec/lib/gitlab/diff/file_collection/commit_spec.rb index 34ed22b8941..6c109e96a53 100644 --- a/spec/lib/gitlab/diff/file_collection/commit_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::FileCollection::Commit do +RSpec.describe Gitlab::Diff::FileCollection::Commit do let(:project) { create(:project, :repository) } it_behaves_like 'diff statistics' do diff --git a/spec/lib/gitlab/diff/file_collection/compare_spec.rb b/spec/lib/gitlab/diff/file_collection/compare_spec.rb index f330f299ac1..168d58e584e 100644 --- a/spec/lib/gitlab/diff/file_collection/compare_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/compare_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::FileCollection::Compare do +RSpec.describe Gitlab::Diff::FileCollection::Compare do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb index 7e945d1d140..bd60c24859c 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::FileCollection::MergeRequestDiffBatch do +RSpec.describe Gitlab::Diff::FileCollection::MergeRequestDiffBatch do let(:merge_request) { create(:merge_request) } let(:batch_page) { 1 } let(:batch_size) { 10 } diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb index c2b6ca4164c..a5e714c90fc 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::FileCollection::MergeRequestDiff do +RSpec.describe Gitlab::Diff::FileCollection::MergeRequestDiff do let(:merge_request) { create(:merge_request) } let(:diffable) { merge_request.merge_request_diff } let(:subject) { described_class.new(diffable, diff_options: nil) } diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb index 8dbedcf26b9..94abfcf079a 100644 --- a/spec/lib/gitlab/diff/file_spec.rb +++ b/spec/lib/gitlab/diff/file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::File do +RSpec.describe Gitlab::Diff::File do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb b/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb index 3f88f39ba92..579776d44aa 100644 --- a/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb +++ b/spec/lib/gitlab/diff/formatters/image_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Formatters::ImageFormatter do +RSpec.describe Gitlab::Diff::Formatters::ImageFormatter do let(:base_attrs) do { base_sha: 123, diff --git a/spec/lib/gitlab/diff/formatters/text_formatter_spec.rb b/spec/lib/gitlab/diff/formatters/text_formatter_spec.rb index 50dd597c5a7..41877a16ebf 100644 --- a/spec/lib/gitlab/diff/formatters/text_formatter_spec.rb +++ b/spec/lib/gitlab/diff/formatters/text_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Formatters::TextFormatter do +RSpec.describe Gitlab::Diff::Formatters::TextFormatter do let!(:base) do { base_sha: 123, diff --git a/spec/lib/gitlab/diff/highlight_cache_spec.rb b/spec/lib/gitlab/diff/highlight_cache_spec.rb index 3c128aad976..80cc10051c4 100644 --- a/spec/lib/gitlab/diff/highlight_cache_spec.rb +++ b/spec/lib/gitlab/diff/highlight_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::Diff::HighlightCache, :clean_gitlab_redis_cache do let(:merge_request) { create(:merge_request_with_diffs) } let(:diff_hash) do { ".gitignore-false-false-false" => diff --git a/spec/lib/gitlab/diff/highlight_spec.rb b/spec/lib/gitlab/diff/highlight_spec.rb index ff4ec75358e..283437e7fbd 100644 --- a/spec/lib/gitlab/diff/highlight_spec.rb +++ b/spec/lib/gitlab/diff/highlight_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Highlight do +RSpec.describe Gitlab::Diff::Highlight do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb b/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb index a668bb464a4..60f7f3a103f 100644 --- a/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb +++ b/spec/lib/gitlab/diff/inline_diff_markdown_marker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::InlineDiffMarkdownMarker do +RSpec.describe Gitlab::Diff::InlineDiffMarkdownMarker do describe '#mark' do let(:raw) { "abc 'def'" } let(:inline_diffs) { [2..5] } diff --git a/spec/lib/gitlab/diff/inline_diff_marker_spec.rb b/spec/lib/gitlab/diff/inline_diff_marker_spec.rb index 26b99870b31..6820a7df95e 100644 --- a/spec/lib/gitlab/diff/inline_diff_marker_spec.rb +++ b/spec/lib/gitlab/diff/inline_diff_marker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::InlineDiffMarker do +RSpec.describe Gitlab::Diff::InlineDiffMarker do describe '#mark' do let(:inline_diffs) { [2..5] } let(:raw) { "abc 'def'" } diff --git a/spec/lib/gitlab/diff/inline_diff_spec.rb b/spec/lib/gitlab/diff/inline_diff_spec.rb index fdbee3b4230..35284e952f7 100644 --- a/spec/lib/gitlab/diff/inline_diff_spec.rb +++ b/spec/lib/gitlab/diff/inline_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::InlineDiff do +RSpec.describe Gitlab::Diff::InlineDiff do describe '.for_lines' do let(:diff) do <<-EOF.strip_heredoc diff --git a/spec/lib/gitlab/diff/line_mapper_spec.rb b/spec/lib/gitlab/diff/line_mapper_spec.rb index 6a86f885c3b..1c1f8201a81 100644 --- a/spec/lib/gitlab/diff/line_mapper_spec.rb +++ b/spec/lib/gitlab/diff/line_mapper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::LineMapper do +RSpec.describe Gitlab::Diff::LineMapper do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/line_spec.rb b/spec/lib/gitlab/diff/line_spec.rb index 7961bec9d57..e10a50afde9 100644 --- a/spec/lib/gitlab/diff/line_spec.rb +++ b/spec/lib/gitlab/diff/line_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Line do +RSpec.describe Gitlab::Diff::Line do shared_examples 'line object initialized by hash' do it 'round-trips correctly with to_hash' do expect(described_class.safe_init_from_hash(line.to_hash).to_hash) diff --git a/spec/lib/gitlab/diff/lines_unfolder_spec.rb b/spec/lib/gitlab/diff/lines_unfolder_spec.rb index ebcbe1fb1a0..b891f9e8285 100644 --- a/spec/lib/gitlab/diff/lines_unfolder_spec.rb +++ b/spec/lib/gitlab/diff/lines_unfolder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::LinesUnfolder do +RSpec.describe Gitlab::Diff::LinesUnfolder do let(:raw_diff) do <<-DIFF.strip_heredoc @@ -7,9 +7,6 @@ diff --git a/spec/lib/gitlab/diff/parallel_diff_spec.rb b/spec/lib/gitlab/diff/parallel_diff_spec.rb index d275bf2c223..f574d7ec707 100644 --- a/spec/lib/gitlab/diff/parallel_diff_spec.rb +++ b/spec/lib/gitlab/diff/parallel_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::ParallelDiff do +RSpec.describe Gitlab::Diff::ParallelDiff do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/parser_spec.rb b/spec/lib/gitlab/diff/parser_spec.rb index 00a446c4e20..7448ae0b2ea 100644 --- a/spec/lib/gitlab/diff/parser_spec.rb +++ b/spec/lib/gitlab/diff/parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Parser do +RSpec.describe Gitlab::Diff::Parser do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/position_collection_spec.rb b/spec/lib/gitlab/diff/position_collection_spec.rb index dd8434ab10b..b1478c774f1 100644 --- a/spec/lib/gitlab/diff/position_collection_spec.rb +++ b/spec/lib/gitlab/diff/position_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::PositionCollection do +RSpec.describe Gitlab::Diff::PositionCollection do let(:merge_request) { build(:merge_request) } let(:text_position) do diff --git a/spec/lib/gitlab/diff/position_spec.rb b/spec/lib/gitlab/diff/position_spec.rb index b32a2c59bb9..a7f6ea0cbfb 100644 --- a/spec/lib/gitlab/diff/position_spec.rb +++ b/spec/lib/gitlab/diff/position_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Position do +RSpec.describe Gitlab::Diff::Position do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb b/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb index e33d7d80361..7dceb64b776 100644 --- a/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb +++ b/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::PositionTracer::ImageStrategy do +RSpec.describe Gitlab::Diff::PositionTracer::ImageStrategy do include PositionTracerHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb b/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb index 46fb6c566b4..d9f384fb47f 100644 --- a/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb +++ b/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::PositionTracer::LineStrategy do +RSpec.describe Gitlab::Diff::PositionTracer::LineStrategy do # Douwe's diary New York City, 2016-06-28 # -------------------------------------------------------------------------- # diff --git a/spec/lib/gitlab/diff/position_tracer_spec.rb b/spec/lib/gitlab/diff/position_tracer_spec.rb index 47d78e0b18c..fc649812b0a 100644 --- a/spec/lib/gitlab/diff/position_tracer_spec.rb +++ b/spec/lib/gitlab/diff/position_tracer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::PositionTracer do +RSpec.describe Gitlab::Diff::PositionTracer do include PositionTracerHelpers subject do diff --git a/spec/lib/gitlab/diff/suggestion_diff_spec.rb b/spec/lib/gitlab/diff/suggestion_diff_spec.rb index 0d4fe33bc47..9546c581112 100644 --- a/spec/lib/gitlab/diff/suggestion_diff_spec.rb +++ b/spec/lib/gitlab/diff/suggestion_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::SuggestionDiff do +RSpec.describe Gitlab::Diff::SuggestionDiff do describe '#diff_lines' do let(:from_content) do <<-BLOB.strip_heredoc diff --git a/spec/lib/gitlab/diff/suggestion_spec.rb b/spec/lib/gitlab/diff/suggestion_spec.rb index d7ca0e0a522..5a5c5555818 100644 --- a/spec/lib/gitlab/diff/suggestion_spec.rb +++ b/spec/lib/gitlab/diff/suggestion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::Suggestion do +RSpec.describe Gitlab::Diff::Suggestion do shared_examples 'correct suggestion raw content' do it 'returns correct raw data' do expect(suggestion.to_hash).to include(from_content: expected_lines.join, diff --git a/spec/lib/gitlab/diff/suggestions_parser_spec.rb b/spec/lib/gitlab/diff/suggestions_parser_spec.rb index 1f2af42f6e7..5efce414dc8 100644 --- a/spec/lib/gitlab/diff/suggestions_parser_spec.rb +++ b/spec/lib/gitlab/diff/suggestions_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Diff::SuggestionsParser do +RSpec.describe Gitlab::Diff::SuggestionsParser do describe '.parse' do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.project } diff --git a/spec/lib/gitlab/discussions_diff/file_collection_spec.rb b/spec/lib/gitlab/discussions_diff/file_collection_spec.rb index a13727b62ea..f85a68ada15 100644 --- a/spec/lib/gitlab/discussions_diff/file_collection_spec.rb +++ b/spec/lib/gitlab/discussions_diff/file_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DiscussionsDiff::FileCollection do +RSpec.describe Gitlab::DiscussionsDiff::FileCollection do let(:merge_request) { create(:merge_request) } let!(:diff_note_a) { create(:diff_note_on_merge_request, project: merge_request.project, noteable: merge_request) } let!(:diff_note_b) { create(:diff_note_on_merge_request, project: merge_request.project, noteable: merge_request) } diff --git a/spec/lib/gitlab/discussions_diff/highlight_cache_spec.rb b/spec/lib/gitlab/discussions_diff/highlight_cache_spec.rb index 97d3a49ea90..9f10811d765 100644 --- a/spec/lib/gitlab/discussions_diff/highlight_cache_spec.rb +++ b/spec/lib/gitlab/discussions_diff/highlight_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DiscussionsDiff::HighlightCache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::DiscussionsDiff::HighlightCache, :clean_gitlab_redis_cache do def fake_file(offset) { text: 'foo', diff --git a/spec/lib/gitlab/downtime_check/message_spec.rb b/spec/lib/gitlab/downtime_check/message_spec.rb index 2beb5a19a32..2d82836db33 100644 --- a/spec/lib/gitlab/downtime_check/message_spec.rb +++ b/spec/lib/gitlab/downtime_check/message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DowntimeCheck::Message do +RSpec.describe Gitlab::DowntimeCheck::Message do describe '#to_s' do it 'returns an ANSI formatted String for an offline migration' do message = described_class.new('foo.rb', true, 'hello') diff --git a/spec/lib/gitlab/downtime_check_spec.rb b/spec/lib/gitlab/downtime_check_spec.rb index 5a5e34961a4..761519425f6 100644 --- a/spec/lib/gitlab/downtime_check_spec.rb +++ b/spec/lib/gitlab/downtime_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::DowntimeCheck do +RSpec.describe Gitlab::DowntimeCheck do subject { described_class.new } let(:path) { 'foo.rb' } diff --git a/spec/lib/gitlab/elasticsearch/logs/lines_spec.rb b/spec/lib/gitlab/elasticsearch/logs/lines_spec.rb index 45a262c0e77..f93c1aa1974 100644 --- a/spec/lib/gitlab/elasticsearch/logs/lines_spec.rb +++ b/spec/lib/gitlab/elasticsearch/logs/lines_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Elasticsearch::Logs::Lines do +RSpec.describe Gitlab::Elasticsearch::Logs::Lines do let(:client) { Elasticsearch::Transport::Client } let(:es_message_1) { { timestamp: "2019-12-13T14:35:34.034Z", pod: "production-6866bc8974-m4sk4", message: "10.8.2.1 - - [25/Oct/2019:08:03:22 UTC] \"GET / HTTP/1.1\" 200 13" } } diff --git a/spec/lib/gitlab/elasticsearch/logs/pods_spec.rb b/spec/lib/gitlab/elasticsearch/logs/pods_spec.rb index c2c3074e965..07fa0980d36 100644 --- a/spec/lib/gitlab/elasticsearch/logs/pods_spec.rb +++ b/spec/lib/gitlab/elasticsearch/logs/pods_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Elasticsearch::Logs::Pods do +RSpec.describe Gitlab::Elasticsearch::Logs::Pods do let(:client) { Elasticsearch::Transport::Client } let(:es_query) { Gitlab::Json.parse(fixture_file('lib/elasticsearch/pods_query.json'), symbolize_names: true) } diff --git a/spec/lib/gitlab/email/attachment_uploader_spec.rb b/spec/lib/gitlab/email/attachment_uploader_spec.rb index 5104e0a3f8f..6beadb6e1a5 100644 --- a/spec/lib/gitlab/email/attachment_uploader_spec.rb +++ b/spec/lib/gitlab/email/attachment_uploader_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Email::AttachmentUploader do +RSpec.describe Gitlab::Email::AttachmentUploader do describe "#execute" do let(:project) { create(:project) } let(:message_raw) { fixture_file("emails/attachment.eml") } diff --git a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb index 7833b9f387d..ee2173a9c8d 100644 --- a/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_issue_handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Handler::CreateIssueHandler do +RSpec.describe Gitlab::Email::Handler::CreateIssueHandler do include_context :email_shared_context it_behaves_like :reply_processing_shared_examples diff --git a/spec/lib/gitlab/email/handler/create_merge_request_handler_spec.rb b/spec/lib/gitlab/email/handler/create_merge_request_handler_spec.rb index 9f5413f9607..75d5fc040cb 100644 --- a/spec/lib/gitlab/email/handler/create_merge_request_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_merge_request_handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Handler::CreateMergeRequestHandler do +RSpec.describe Gitlab::Email::Handler::CreateMergeRequestHandler do include_context :email_shared_context it_behaves_like :reply_processing_shared_examples diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb index af963e1b695..f7e1d891403 100644 --- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Handler::CreateNoteHandler do +RSpec.describe Gitlab::Email::Handler::CreateNoteHandler do include_context :email_shared_context it_behaves_like :reply_processing_shared_examples diff --git a/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb b/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb index dcddd00df59..13ad9ddd8ef 100644 --- a/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/unsubscribe_handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Handler::UnsubscribeHandler do +RSpec.describe Gitlab::Email::Handler::UnsubscribeHandler do include_context :email_shared_context before do diff --git a/spec/lib/gitlab/email/handler_spec.rb b/spec/lib/gitlab/email/handler_spec.rb index 6dbf069f07c..477965db999 100644 --- a/spec/lib/gitlab/email/handler_spec.rb +++ b/spec/lib/gitlab/email/handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Handler do +RSpec.describe Gitlab::Email::Handler do let(:email) { Mail.new { body 'email' } } describe '.for' do diff --git a/spec/lib/gitlab/email/hook/additional_headers_interceptor_spec.rb b/spec/lib/gitlab/email/hook/additional_headers_interceptor_spec.rb index 65e4e27d56f..deaa086d689 100644 --- a/spec/lib/gitlab/email/hook/additional_headers_interceptor_spec.rb +++ b/spec/lib/gitlab/email/hook/additional_headers_interceptor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Hook::AdditionalHeadersInterceptor do +RSpec.describe Gitlab::Email::Hook::AdditionalHeadersInterceptor do let(:mail) do ActionMailer::Base.mail(to: 'test@mail.com', from: 'info@mail.com', body: 'hello') end diff --git a/spec/lib/gitlab/email/hook/delivery_metrics_observer_spec.rb b/spec/lib/gitlab/email/hook/delivery_metrics_observer_spec.rb index 24da47c42ac..73a0573be26 100644 --- a/spec/lib/gitlab/email/hook/delivery_metrics_observer_spec.rb +++ b/spec/lib/gitlab/email/hook/delivery_metrics_observer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Hook::DeliveryMetricsObserver do +RSpec.describe Gitlab::Email::Hook::DeliveryMetricsObserver do let(:email) do ActionMailer::Base.mail(to: 'test@example.com', from: 'info@example.com', diff --git a/spec/lib/gitlab/email/hook/disable_email_interceptor_spec.rb b/spec/lib/gitlab/email/hook/disable_email_interceptor_spec.rb index c8ed12523d0..47f6015c6f8 100644 --- a/spec/lib/gitlab/email/hook/disable_email_interceptor_spec.rb +++ b/spec/lib/gitlab/email/hook/disable_email_interceptor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Hook::DisableEmailInterceptor do +RSpec.describe Gitlab::Email::Hook::DisableEmailInterceptor do before do Mail.register_interceptor(described_class) end diff --git a/spec/lib/gitlab/email/hook/smime_signature_interceptor_spec.rb b/spec/lib/gitlab/email/hook/smime_signature_interceptor_spec.rb index 31ba48e9df1..56cf58dcf92 100644 --- a/spec/lib/gitlab/email/hook/smime_signature_interceptor_spec.rb +++ b/spec/lib/gitlab/email/hook/smime_signature_interceptor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Hook::SmimeSignatureInterceptor do +RSpec.describe Gitlab::Email::Hook::SmimeSignatureInterceptor do include SmimeHelper # certs generation is an expensive operation and they are used read-only, diff --git a/spec/lib/gitlab/email/message/repository_push_spec.rb b/spec/lib/gitlab/email/message/repository_push_spec.rb index 9e95d31f41c..10586527239 100644 --- a/spec/lib/gitlab/email/message/repository_push_spec.rb +++ b/spec/lib/gitlab/email/message/repository_push_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Message::RepositoryPush do +RSpec.describe Gitlab::Email::Message::RepositoryPush do include RepoHelpers let!(:group) { create(:group, name: 'my_group') } diff --git a/spec/lib/gitlab/email/receiver_spec.rb b/spec/lib/gitlab/email/receiver_spec.rb index d860968ab98..592d3f3f0e4 100644 --- a/spec/lib/gitlab/email/receiver_spec.rb +++ b/spec/lib/gitlab/email/receiver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Receiver do +RSpec.describe Gitlab::Email::Receiver do include_context :email_shared_context shared_examples 'correctly finds the mail key' do diff --git a/spec/lib/gitlab/email/reply_parser_spec.rb b/spec/lib/gitlab/email/reply_parser_spec.rb index 646575b2edd..575ff7f357b 100644 --- a/spec/lib/gitlab/email/reply_parser_spec.rb +++ b/spec/lib/gitlab/email/reply_parser_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" # Inspired in great part by Discourse's Email::Receiver -describe Gitlab::Email::ReplyParser do +RSpec.describe Gitlab::Email::ReplyParser do describe '#execute' do def test_parse_body(mail_string, params = {}) described_class.new(Mail::Message.new(mail_string), params).execute diff --git a/spec/lib/gitlab/email/smime/certificate_spec.rb b/spec/lib/gitlab/email/smime/certificate_spec.rb index 07b8c1e4de1..e4a085d971b 100644 --- a/spec/lib/gitlab/email/smime/certificate_spec.rb +++ b/spec/lib/gitlab/email/smime/certificate_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Smime::Certificate do +RSpec.describe Gitlab::Email::Smime::Certificate do include SmimeHelper # cert generation is an expensive operation and they are used read-only, diff --git a/spec/lib/gitlab/email/smime/signer_spec.rb b/spec/lib/gitlab/email/smime/signer_spec.rb index d891b86da08..217c0d62950 100644 --- a/spec/lib/gitlab/email/smime/signer_spec.rb +++ b/spec/lib/gitlab/email/smime/signer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Email::Smime::Signer do +RSpec.describe Gitlab::Email::Smime::Signer do include SmimeHelper let_it_be(:root_ca) { generate_root } diff --git a/spec/lib/gitlab/encoding_helper_spec.rb b/spec/lib/gitlab/encoding_helper_spec.rb index e6dfd8728aa..5394c04c6ba 100644 --- a/spec/lib/gitlab/encoding_helper_spec.rb +++ b/spec/lib/gitlab/encoding_helper_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::EncodingHelper do +RSpec.describe Gitlab::EncodingHelper do let(:ext_class) { Class.new { extend Gitlab::EncodingHelper } } let(:binary_string) { File.read(Rails.root + "spec/fixtures/dk.png") } diff --git a/spec/lib/gitlab/error_tracking/stack_trace_highlight_decorator_spec.rb b/spec/lib/gitlab/error_tracking/stack_trace_highlight_decorator_spec.rb index d553fb4848b..5c496d653b2 100644 --- a/spec/lib/gitlab/error_tracking/stack_trace_highlight_decorator_spec.rb +++ b/spec/lib/gitlab/error_tracking/stack_trace_highlight_decorator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ErrorTracking::StackTraceHighlightDecorator do +RSpec.describe Gitlab::ErrorTracking::StackTraceHighlightDecorator do let(:error_event) { build(:error_tracking_error_event) } describe '.decorate' do diff --git a/spec/lib/gitlab/error_tracking_spec.rb b/spec/lib/gitlab/error_tracking_spec.rb index c40369f5965..b3d31db44dd 100644 --- a/spec/lib/gitlab/error_tracking_spec.rb +++ b/spec/lib/gitlab/error_tracking_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'raven/transports/dummy' -describe Gitlab::ErrorTracking do +RSpec.describe Gitlab::ErrorTracking do let(:exception) { RuntimeError.new('boom') } let(:issue_url) { 'http://gitlab.com/gitlab-org/gitlab-foss/issues/1' } diff --git a/spec/lib/gitlab/etag_caching/middleware_spec.rb b/spec/lib/gitlab/etag_caching/middleware_spec.rb index 5e9df555241..361b2329e15 100644 --- a/spec/lib/gitlab/etag_caching/middleware_spec.rb +++ b/spec/lib/gitlab/etag_caching/middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::EtagCaching::Middleware do +RSpec.describe Gitlab::EtagCaching::Middleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:app_status_code) { 200 } diff --git a/spec/lib/gitlab/etag_caching/router_spec.rb b/spec/lib/gitlab/etag_caching/router_spec.rb index d9eeb5b9a2b..3e939e588ad 100644 --- a/spec/lib/gitlab/etag_caching/router_spec.rb +++ b/spec/lib/gitlab/etag_caching/router_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::EtagCaching::Router do +RSpec.describe Gitlab::EtagCaching::Router do it 'matches issue notes endpoint' do result = described_class.match( '/my-group/and-subgroup/here-comes-the-project/noteable/issue/1/notes' diff --git a/spec/lib/gitlab/exclusive_lease_helpers/sleeping_lock_spec.rb b/spec/lib/gitlab/exclusive_lease_helpers/sleeping_lock_spec.rb index 8917eeec56f..f74fbf1206f 100644 --- a/spec/lib/gitlab/exclusive_lease_helpers/sleeping_lock_spec.rb +++ b/spec/lib/gitlab/exclusive_lease_helpers/sleeping_lock_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExclusiveLeaseHelpers::SleepingLock, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::ExclusiveLeaseHelpers::SleepingLock, :clean_gitlab_redis_shared_state do include ::ExclusiveLeaseHelpers let(:timeout) { 1.second } diff --git a/spec/lib/gitlab/exclusive_lease_helpers_spec.rb b/spec/lib/gitlab/exclusive_lease_helpers_spec.rb index 9914518cda5..01e2fe8ce17 100644 --- a/spec/lib/gitlab/exclusive_lease_helpers_spec.rb +++ b/spec/lib/gitlab/exclusive_lease_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::ExclusiveLeaseHelpers, :clean_gitlab_redis_shared_state do include ::ExclusiveLeaseHelpers let(:class_instance) { (Class.new { include ::Gitlab::ExclusiveLeaseHelpers }).new } diff --git a/spec/lib/gitlab/exclusive_lease_spec.rb b/spec/lib/gitlab/exclusive_lease_spec.rb index 2c0bb23a0b6..e730ddd6577 100644 --- a/spec/lib/gitlab/exclusive_lease_spec.rb +++ b/spec/lib/gitlab/exclusive_lease_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExclusiveLease, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::ExclusiveLease, :clean_gitlab_redis_shared_state do let(:unique_key) { SecureRandom.hex(10) } describe '#try_obtain' do diff --git a/spec/lib/gitlab/experimentation_spec.rb b/spec/lib/gitlab/experimentation_spec.rb index f6e6c031624..a6408aeae8b 100644 --- a/spec/lib/gitlab/experimentation_spec.rb +++ b/spec/lib/gitlab/experimentation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Experimentation do +RSpec.describe Gitlab::Experimentation do before do stub_const('Gitlab::Experimentation::EXPERIMENTS', { test_experiment: { diff --git a/spec/lib/gitlab/external_authorization/access_spec.rb b/spec/lib/gitlab/external_authorization/access_spec.rb index 8a08b2a6275..4bb81230ac0 100644 --- a/spec/lib/gitlab/external_authorization/access_spec.rb +++ b/spec/lib/gitlab/external_authorization/access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::ExternalAuthorization::Access, :clean_gitlab_redis_cache do subject(:access) { described_class.new(build(:user), 'dummy_label') } describe '#loaded?' do diff --git a/spec/lib/gitlab/external_authorization/cache_spec.rb b/spec/lib/gitlab/external_authorization/cache_spec.rb index 1f217249f97..9037c04cf2b 100644 --- a/spec/lib/gitlab/external_authorization/cache_spec.rb +++ b/spec/lib/gitlab/external_authorization/cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExternalAuthorization::Cache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::ExternalAuthorization::Cache, :clean_gitlab_redis_cache do let(:user) { build_stubbed(:user) } let(:cache_key) { "external_authorization:user-#{user.id}:label-dummy_label" } diff --git a/spec/lib/gitlab/external_authorization/client_spec.rb b/spec/lib/gitlab/external_authorization/client_spec.rb index e28a155a47f..473b57441fa 100644 --- a/spec/lib/gitlab/external_authorization/client_spec.rb +++ b/spec/lib/gitlab/external_authorization/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExternalAuthorization::Client do +RSpec.describe Gitlab::ExternalAuthorization::Client do let(:user) { build(:user, email: 'dummy_user@example.com') } let(:dummy_url) { 'https://dummy.net/' } diff --git a/spec/lib/gitlab/external_authorization/logger_spec.rb b/spec/lib/gitlab/external_authorization/logger_spec.rb index 380e765309c..167ce500911 100644 --- a/spec/lib/gitlab/external_authorization/logger_spec.rb +++ b/spec/lib/gitlab/external_authorization/logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExternalAuthorization::Logger do +RSpec.describe Gitlab::ExternalAuthorization::Logger do let(:request_time) { Time.parse('2018-03-26 20:22:15') } def fake_access(has_access, user, load_type = :request) diff --git a/spec/lib/gitlab/external_authorization/response_spec.rb b/spec/lib/gitlab/external_authorization/response_spec.rb index 5ce3325ef77..11f83feb76f 100644 --- a/spec/lib/gitlab/external_authorization/response_spec.rb +++ b/spec/lib/gitlab/external_authorization/response_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExternalAuthorization::Response do +RSpec.describe Gitlab::ExternalAuthorization::Response do let(:excon_response) { double } subject(:response) { described_class.new(excon_response) } diff --git a/spec/lib/gitlab/external_authorization_spec.rb b/spec/lib/gitlab/external_authorization_spec.rb index 97055e7b3f9..76025d70e9a 100644 --- a/spec/lib/gitlab/external_authorization_spec.rb +++ b/spec/lib/gitlab/external_authorization_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ExternalAuthorization, :request_store do +RSpec.describe Gitlab::ExternalAuthorization, :request_store do include ExternalAuthorizationServiceHelpers let(:user) { build(:user) } diff --git a/spec/lib/gitlab/fake_application_settings_spec.rb b/spec/lib/gitlab/fake_application_settings_spec.rb index 6a872185713..ec32afcfb7b 100644 --- a/spec/lib/gitlab/fake_application_settings_spec.rb +++ b/spec/lib/gitlab/fake_application_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FakeApplicationSettings do +RSpec.describe Gitlab::FakeApplicationSettings do let(:defaults) do described_class.defaults.merge( foobar: 'asdf', diff --git a/spec/lib/gitlab/file_detector_spec.rb b/spec/lib/gitlab/file_detector_spec.rb index 5bf70ef898a..8c0c56ea2c3 100644 --- a/spec/lib/gitlab/file_detector_spec.rb +++ b/spec/lib/gitlab/file_detector_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FileDetector do +RSpec.describe Gitlab::FileDetector do describe '.types_in_paths' do it 'returns the file types for the given paths' do expect(described_class.types_in_paths(%w(README.md CHANGELOG VERSION VERSION))) diff --git a/spec/lib/gitlab/file_finder_spec.rb b/spec/lib/gitlab/file_finder_spec.rb index 90aa759671a..36fb4c48fb2 100644 --- a/spec/lib/gitlab/file_finder_spec.rb +++ b/spec/lib/gitlab/file_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FileFinder do +RSpec.describe Gitlab::FileFinder do describe '#find' do let(:project) { create(:project, :public, :repository) } diff --git a/spec/lib/gitlab/file_hook_spec.rb b/spec/lib/gitlab/file_hook_spec.rb index fda3583289b..7f40d9ae772 100644 --- a/spec/lib/gitlab/file_hook_spec.rb +++ b/spec/lib/gitlab/file_hook_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FileHook do +RSpec.describe Gitlab::FileHook do let(:file_hook) { Rails.root.join('file_hooks', 'test.rb') } let(:tmp_file) { Tempfile.new('file_hook-dump') } diff --git a/spec/lib/gitlab/file_markdown_link_builder_spec.rb b/spec/lib/gitlab/file_markdown_link_builder_spec.rb index de0ac9733e6..ea21bda12d3 100644 --- a/spec/lib/gitlab/file_markdown_link_builder_spec.rb +++ b/spec/lib/gitlab/file_markdown_link_builder_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::FileMarkdownLinkBuilder do +RSpec.describe Gitlab::FileMarkdownLinkBuilder do let(:custom_class) do Class.new do include Gitlab::FileMarkdownLinkBuilder diff --git a/spec/lib/gitlab/file_type_detection_spec.rb b/spec/lib/gitlab/file_type_detection_spec.rb index 2f1fc57c559..ba5e7cfabf2 100644 --- a/spec/lib/gitlab/file_type_detection_spec.rb +++ b/spec/lib/gitlab/file_type_detection_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::FileTypeDetection do +RSpec.describe Gitlab::FileTypeDetection do describe '.extension_match?' do let(:extensions) { %w[foo bar] } diff --git a/spec/lib/gitlab/fogbugz_import/client_spec.rb b/spec/lib/gitlab/fogbugz_import/client_spec.rb index ca6f374476c..560cb98ccfd 100644 --- a/spec/lib/gitlab/fogbugz_import/client_spec.rb +++ b/spec/lib/gitlab/fogbugz_import/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FogbugzImport::Client do +RSpec.describe Gitlab::FogbugzImport::Client do let(:client) { described_class.new(uri: '', token: '') } let(:one_user) { { 'people' => { 'person' => { "ixPerson" => "2", "sFullName" => "James" } } } } let(:two_users) { { 'people' => { 'person' => [one_user, { "ixPerson" => "3" }] } } } diff --git a/spec/lib/gitlab/fogbugz_import/importer_spec.rb b/spec/lib/gitlab/fogbugz_import/importer_spec.rb index 9e67047eeda..d2be3e3f6b1 100644 --- a/spec/lib/gitlab/fogbugz_import/importer_spec.rb +++ b/spec/lib/gitlab/fogbugz_import/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FogbugzImport::Importer do +RSpec.describe Gitlab::FogbugzImport::Importer do let(:project) { create(:project_empty_repo) } let(:importer) { described_class.new(project) } let(:repo) do diff --git a/spec/lib/gitlab/fogbugz_import/project_creator_spec.rb b/spec/lib/gitlab/fogbugz_import/project_creator_spec.rb index 503fe897e29..6b8bb2229a9 100644 --- a/spec/lib/gitlab/fogbugz_import/project_creator_spec.rb +++ b/spec/lib/gitlab/fogbugz_import/project_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::FogbugzImport::ProjectCreator do +RSpec.describe Gitlab::FogbugzImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do diff --git a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb index 335135696ef..1c9004262c5 100644 --- a/spec/lib/gitlab/gfm/reference_rewriter_spec.rb +++ b/spec/lib/gitlab/gfm/reference_rewriter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Gfm::ReferenceRewriter do +RSpec.describe Gitlab::Gfm::ReferenceRewriter do let_it_be(:group) { create(:group) } let_it_be(:user) { create(:user) } diff --git a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb index 7279399d1b8..5b78acc3b1d 100644 --- a/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb +++ b/spec/lib/gitlab/gfm/uploads_rewriter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Gfm::UploadsRewriter do +RSpec.describe Gitlab::Gfm::UploadsRewriter do let(:user) { create(:user) } let(:old_project) { create(:project) } let(:new_project) { create(:project) } diff --git a/spec/lib/gitlab/git/attributes_at_ref_parser_spec.rb b/spec/lib/gitlab/git/attributes_at_ref_parser_spec.rb index 6c4f650fa83..96cd70b4ff1 100644 --- a/spec/lib/gitlab/git/attributes_at_ref_parser_spec.rb +++ b/spec/lib/gitlab/git/attributes_at_ref_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::AttributesAtRefParser, :seed_helper do +RSpec.describe Gitlab::Git::AttributesAtRefParser, :seed_helper do let(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/git/attributes_parser_spec.rb b/spec/lib/gitlab/git/attributes_parser_spec.rb index 45db4acd3ac..4bc39921e85 100644 --- a/spec/lib/gitlab/git/attributes_parser_spec.rb +++ b/spec/lib/gitlab/git/attributes_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::AttributesParser, :seed_helper do +RSpec.describe Gitlab::Git::AttributesParser, :seed_helper do let(:attributes_path) { File.join(SEED_STORAGE_PATH, 'with-git-attributes.git', 'info', 'attributes') } let(:data) { File.read(attributes_path) } diff --git a/spec/lib/gitlab/git/blame_spec.rb b/spec/lib/gitlab/git/blame_spec.rb index 9b2d6fa3bcb..67d7b37dd45 100644 --- a/spec/lib/gitlab/git/blame_spec.rb +++ b/spec/lib/gitlab/git/blame_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Blame, :seed_helper do +RSpec.describe Gitlab::Git::Blame, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } let(:blame) do Gitlab::Git::Blame.new(repository, SeedRepo::Commit::ID, "CONTRIBUTING.md") diff --git a/spec/lib/gitlab/git/blob_spec.rb b/spec/lib/gitlab/git/blob_spec.rb index 46d9b78c14b..fb4510a78de 100644 --- a/spec/lib/gitlab/git/blob_spec.rb +++ b/spec/lib/gitlab/git/blob_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Blob, :seed_helper do +RSpec.describe Gitlab::Git::Blob, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } let(:rugged) do Rugged::Repository.new(File.join(TestEnv.repos_path, TEST_REPO_PATH)) diff --git a/spec/lib/gitlab/git/branch_spec.rb b/spec/lib/gitlab/git/branch_spec.rb index cb3f4df2dbd..bac1b4c57f9 100644 --- a/spec/lib/gitlab/git/branch_spec.rb +++ b/spec/lib/gitlab/git/branch_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Branch, :seed_helper do +RSpec.describe Gitlab::Git::Branch, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } let(:rugged) do Rugged::Repository.new(File.join(TestEnv.repos_path, repository.relative_path)) diff --git a/spec/lib/gitlab/git/bundle_file_spec.rb b/spec/lib/gitlab/git/bundle_file_spec.rb index e88e163a03f..701febadc1b 100644 --- a/spec/lib/gitlab/git/bundle_file_spec.rb +++ b/spec/lib/gitlab/git/bundle_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::BundleFile do +RSpec.describe Gitlab::Git::BundleFile do describe '.check!' do let(:valid_bundle) { Tempfile.new } let(:valid_bundle_path) { valid_bundle.path } diff --git a/spec/lib/gitlab/git/changes_spec.rb b/spec/lib/gitlab/git/changes_spec.rb index 7f56d30cb48..310be7a3731 100644 --- a/spec/lib/gitlab/git/changes_spec.rb +++ b/spec/lib/gitlab/git/changes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::Changes do +RSpec.describe Gitlab::Git::Changes do let(:changes) { described_class.new } describe '#includes_branches?' do diff --git a/spec/lib/gitlab/git/commit_spec.rb b/spec/lib/gitlab/git/commit_spec.rb index edd367673fb..27943fba60c 100644 --- a/spec/lib/gitlab/git/commit_spec.rb +++ b/spec/lib/gitlab/git/commit_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Commit, :seed_helper do +RSpec.describe Gitlab::Git::Commit, :seed_helper do include GitHelpers let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } @@ -560,7 +560,7 @@ describe Gitlab::Git::Commit, :seed_helper do end skip 'move this test to gitaly-ruby' do - describe '#init_from_rugged' do + RSpec.describe '#init_from_rugged' do let(:gitlab_commit) { described_class.new(repository, rugged_commit) } subject { gitlab_commit } diff --git a/spec/lib/gitlab/git/compare_spec.rb b/spec/lib/gitlab/git/compare_spec.rb index 6136df57acb..51043355ede 100644 --- a/spec/lib/gitlab/git/compare_spec.rb +++ b/spec/lib/gitlab/git/compare_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Compare, :seed_helper do +RSpec.describe Gitlab::Git::Compare, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } let(:compare) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, straight: false) } let(:compare_straight) { Gitlab::Git::Compare.new(repository, SeedRepo::BigCommit::ID, SeedRepo::Commit::ID, straight: true) } diff --git a/spec/lib/gitlab/git/conflict/file_spec.rb b/spec/lib/gitlab/git/conflict/file_spec.rb index 0ee9ff93e87..454a48a1d3a 100644 --- a/spec/lib/gitlab/git/conflict/file_spec.rb +++ b/spec/lib/gitlab/git/conflict/file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::Conflict::File do +RSpec.describe Gitlab::Git::Conflict::File do let(:conflict) { { theirs: { path: 'foo', mode: 33188 }, ours: { path: 'foo', mode: 33188 } } } let(:invalid_content) { described_class.new(nil, nil, conflict, (+"a\xC4\xFC").force_encoding(Encoding::ASCII_8BIT)) } let(:valid_content) { described_class.new(nil, nil, conflict, (+"Espa\xC3\xB1a").force_encoding(Encoding::ASCII_8BIT)) } diff --git a/spec/lib/gitlab/git/conflict/parser_spec.rb b/spec/lib/gitlab/git/conflict/parser_spec.rb index 92ea44394b1..67bd48256ce 100644 --- a/spec/lib/gitlab/git/conflict/parser_spec.rb +++ b/spec/lib/gitlab/git/conflict/parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::Conflict::Parser do +RSpec.describe Gitlab::Git::Conflict::Parser do describe '.parse' do def parse_text(text) described_class.parse(text, our_path: 'README.md', their_path: 'README.md') diff --git a/spec/lib/gitlab/git/cross_repo_comparer_spec.rb b/spec/lib/gitlab/git/cross_repo_comparer_spec.rb index 8b37b6d1667..1c49486b7b1 100644 --- a/spec/lib/gitlab/git/cross_repo_comparer_spec.rb +++ b/spec/lib/gitlab/git/cross_repo_comparer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::CrossRepoComparer do +RSpec.describe Gitlab::Git::CrossRepoComparer do let(:source_project) { create(:project, :repository) } let(:target_project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/git/diff_collection_spec.rb b/spec/lib/gitlab/git/diff_collection_spec.rb index 6aa4f884d20..6da07ce84a1 100644 --- a/spec/lib/gitlab/git/diff_collection_spec.rb +++ b/spec/lib/gitlab/git/diff_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::DiffCollection, :seed_helper do +RSpec.describe Gitlab::Git::DiffCollection, :seed_helper do before do stub_const('MutatingConstantIterator', Class.new) diff --git a/spec/lib/gitlab/git/diff_spec.rb b/spec/lib/gitlab/git/diff_spec.rb index ff54d7fbcd3..91688c31f5e 100644 --- a/spec/lib/gitlab/git/diff_spec.rb +++ b/spec/lib/gitlab/git/diff_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Diff, :seed_helper do +RSpec.describe Gitlab::Git::Diff, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } let(:gitaly_diff) do Gitlab::GitalyClient::Diff.new( diff --git a/spec/lib/gitlab/git/diff_stats_collection_spec.rb b/spec/lib/gitlab/git/diff_stats_collection_spec.rb index 46bff68e12a..f2fe03829be 100644 --- a/spec/lib/gitlab/git/diff_stats_collection_spec.rb +++ b/spec/lib/gitlab/git/diff_stats_collection_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::DiffStatsCollection do +RSpec.describe Gitlab::Git::DiffStatsCollection do let(:stats_a) do Gitaly::DiffStats.new(additions: 10, deletions: 15, path: 'foo') end diff --git a/spec/lib/gitlab/git/gitmodules_parser_spec.rb b/spec/lib/gitlab/git/gitmodules_parser_spec.rb index 58d1d2c71da..0e386c7f3d1 100644 --- a/spec/lib/gitlab/git/gitmodules_parser_spec.rb +++ b/spec/lib/gitlab/git/gitmodules_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::GitmodulesParser do +RSpec.describe Gitlab::Git::GitmodulesParser do it 'parses a .gitmodules file correctly' do data = <<~GITMODULES [submodule "vendor/libgit2"] diff --git a/spec/lib/gitlab/git/hook_env_spec.rb b/spec/lib/gitlab/git/hook_env_spec.rb index 22b016cee3e..c8f9218916e 100644 --- a/spec/lib/gitlab/git/hook_env_spec.rb +++ b/spec/lib/gitlab/git/hook_env_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::HookEnv do +RSpec.describe Gitlab::Git::HookEnv do let(:gl_repository) { 'project-123' } describe ".set" do diff --git a/spec/lib/gitlab/git/keep_around_spec.rb b/spec/lib/gitlab/git/keep_around_spec.rb index 04ccf86cd28..44c3caf3f8d 100644 --- a/spec/lib/gitlab/git/keep_around_spec.rb +++ b/spec/lib/gitlab/git/keep_around_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::KeepAround do +RSpec.describe Gitlab::Git::KeepAround do include RepoHelpers let(:repository) { create(:project, :repository).repository } diff --git a/spec/lib/gitlab/git/lfs_changes_spec.rb b/spec/lib/gitlab/git/lfs_changes_spec.rb index adc63401b89..286c5b98771 100644 --- a/spec/lib/gitlab/git/lfs_changes_spec.rb +++ b/spec/lib/gitlab/git/lfs_changes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::LfsChanges do +RSpec.describe Gitlab::Git::LfsChanges do let_it_be(:project) { create(:project, :repository) } let(:newrev) { '54fcc214b94e78d7a41a9a8fe6d87a5e59500e51' } let(:blob_object_id) { '0c304a93cb8430108629bbbcaa27db3343299bc0' } diff --git a/spec/lib/gitlab/git/lfs_pointer_file_spec.rb b/spec/lib/gitlab/git/lfs_pointer_file_spec.rb index 8bb26ed4854..f45c7cccca0 100644 --- a/spec/lib/gitlab/git/lfs_pointer_file_spec.rb +++ b/spec/lib/gitlab/git/lfs_pointer_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::LfsPointerFile do +RSpec.describe Gitlab::Git::LfsPointerFile do let(:data) { "1234\n" } subject { described_class.new(data) } diff --git a/spec/lib/gitlab/git/merge_base_spec.rb b/spec/lib/gitlab/git/merge_base_spec.rb index d92b13c5023..1410e44a220 100644 --- a/spec/lib/gitlab/git/merge_base_spec.rb +++ b/spec/lib/gitlab/git/merge_base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::MergeBase do +RSpec.describe Gitlab::Git::MergeBase do let_it_be(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/git/object_pool_spec.rb b/spec/lib/gitlab/git/object_pool_spec.rb index ebeb7b7b633..c8fbc674c73 100644 --- a/spec/lib/gitlab/git/object_pool_spec.rb +++ b/spec/lib/gitlab/git/object_pool_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::ObjectPool do +RSpec.describe Gitlab::Git::ObjectPool do include RepoHelpers let(:pool_repository) { create(:pool_repository) } diff --git a/spec/lib/gitlab/git/patches/collection_spec.rb b/spec/lib/gitlab/git/patches/collection_spec.rb index 080be141c59..eb92f4663c8 100644 --- a/spec/lib/gitlab/git/patches/collection_spec.rb +++ b/spec/lib/gitlab/git/patches/collection_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Git::Patches::Collection do +RSpec.describe Gitlab::Git::Patches::Collection do let(:patches_folder) { Rails.root.join('spec/fixtures/patchfiles') } let(:patch_content1) do File.read(File.join(patches_folder, "0001-This-does-not-apply-to-the-feature-branch.patch")) diff --git a/spec/lib/gitlab/git/patches/commit_patches_spec.rb b/spec/lib/gitlab/git/patches/commit_patches_spec.rb index 760112155ce..cd1e03a6de0 100644 --- a/spec/lib/gitlab/git/patches/commit_patches_spec.rb +++ b/spec/lib/gitlab/git/patches/commit_patches_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Git::Patches::CommitPatches do +RSpec.describe Gitlab::Git::Patches::CommitPatches do describe '#commit' do let(:patches) do patches_folder = Rails.root.join('spec/fixtures/patchfiles') diff --git a/spec/lib/gitlab/git/patches/patch_spec.rb b/spec/lib/gitlab/git/patches/patch_spec.rb index 7466e853b65..629f43d3636 100644 --- a/spec/lib/gitlab/git/patches/patch_spec.rb +++ b/spec/lib/gitlab/git/patches/patch_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Git::Patches::Patch do +RSpec.describe Gitlab::Git::Patches::Patch do let(:patches_folder) { Rails.root.join('spec/fixtures/patchfiles') } let(:patch_content) do File.read(File.join(patches_folder, "0001-This-does-not-apply-to-the-feature-branch.patch")) diff --git a/spec/lib/gitlab/git/pre_receive_error_spec.rb b/spec/lib/gitlab/git/pre_receive_error_spec.rb index cb539261671..bf4530c8945 100644 --- a/spec/lib/gitlab/git/pre_receive_error_spec.rb +++ b/spec/lib/gitlab/git/pre_receive_error_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::PreReceiveError do +RSpec.describe Gitlab::Git::PreReceiveError do Gitlab::Git::PreReceiveError::SAFE_MESSAGE_PREFIXES.each do |prefix| context "error messages prefixed with #{prefix}" do it 'accepts only errors lines with the prefix' do diff --git a/spec/lib/gitlab/git/push_spec.rb b/spec/lib/gitlab/git/push_spec.rb index c09e8a085df..0f52f10c0a6 100644 --- a/spec/lib/gitlab/git/push_spec.rb +++ b/spec/lib/gitlab/git/push_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::Push do +RSpec.describe Gitlab::Git::Push do let_it_be(:project) { create(:project, :repository) } let(:oldrev) { project.commit('HEAD~2').id } let(:newrev) { project.commit.id } diff --git a/spec/lib/gitlab/git/raw_diff_change_spec.rb b/spec/lib/gitlab/git/raw_diff_change_spec.rb index 79b2fc21011..f894ae1d98b 100644 --- a/spec/lib/gitlab/git/raw_diff_change_spec.rb +++ b/spec/lib/gitlab/git/raw_diff_change_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::RawDiffChange do +RSpec.describe Gitlab::Git::RawDiffChange do let(:raw_change) { } let(:change) { described_class.new(raw_change) } diff --git a/spec/lib/gitlab/git/remote_mirror_spec.rb b/spec/lib/gitlab/git/remote_mirror_spec.rb index edef91b8bc6..423c4aa9620 100644 --- a/spec/lib/gitlab/git/remote_mirror_spec.rb +++ b/spec/lib/gitlab/git/remote_mirror_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::RemoteMirror do +RSpec.describe Gitlab::Git::RemoteMirror do describe '#update' do let(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/git/remote_repository_spec.rb b/spec/lib/gitlab/git/remote_repository_spec.rb index b53eee293f0..84c17234ae4 100644 --- a/spec/lib/gitlab/git/remote_repository_spec.rb +++ b/spec/lib/gitlab/git/remote_repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::RemoteRepository, :seed_helper do +RSpec.describe Gitlab::Git::RemoteRepository, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } subject { described_class.new(repository) } diff --git a/spec/lib/gitlab/git/repository_cleaner_spec.rb b/spec/lib/gitlab/git/repository_cleaner_spec.rb index b387d1033d3..9f1bf9e48ee 100644 --- a/spec/lib/gitlab/git/repository_cleaner_spec.rb +++ b/spec/lib/gitlab/git/repository_cleaner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::RepositoryCleaner do +RSpec.describe Gitlab::Git::RepositoryCleaner do include HttpIOHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 183e6e8d044..e24cdbc75f0 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Repository, :seed_helper do +RSpec.describe Gitlab::Git::Repository, :seed_helper do include Gitlab::EncodingHelper include RepoHelpers using RSpec::Parameterized::TableSyntax diff --git a/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb b/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb index 8339006fe9f..4f6a3fb823e 100644 --- a/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb +++ b/spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'json' require 'tempfile' -describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do +RSpec.describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do let(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:feature_flag_name) { 'feature-flag-name' } diff --git a/spec/lib/gitlab/git/tag_spec.rb b/spec/lib/gitlab/git/tag_spec.rb index 6d3b239c38f..f83ccc6cae0 100644 --- a/spec/lib/gitlab/git/tag_spec.rb +++ b/spec/lib/gitlab/git/tag_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Tag, :seed_helper do +RSpec.describe Gitlab::Git::Tag, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } describe '#tags' do diff --git a/spec/lib/gitlab/git/tree_spec.rb b/spec/lib/gitlab/git/tree_spec.rb index b254dd3f036..5ef964ac3c1 100644 --- a/spec/lib/gitlab/git/tree_spec.rb +++ b/spec/lib/gitlab/git/tree_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Git::Tree, :seed_helper do +RSpec.describe Gitlab::Git::Tree, :seed_helper do let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') } shared_examples :repo do diff --git a/spec/lib/gitlab/git/user_spec.rb b/spec/lib/gitlab/git/user_spec.rb index 6761413320a..4414195ebf4 100644 --- a/spec/lib/gitlab/git/user_spec.rb +++ b/spec/lib/gitlab/git/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::User do +RSpec.describe Gitlab::Git::User do let(:username) { 'janedoe' } let(:name) { 'Jane Doé' } let(:email) { 'janedoé@example.com' } diff --git a/spec/lib/gitlab/git/util_spec.rb b/spec/lib/gitlab/git/util_spec.rb index 81918f036f9..a0237c821b5 100644 --- a/spec/lib/gitlab/git/util_spec.rb +++ b/spec/lib/gitlab/git/util_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::Util do +RSpec.describe Gitlab::Git::Util do describe '#count_lines' do [ ["", 0], diff --git a/spec/lib/gitlab/git/wiki_spec.rb b/spec/lib/gitlab/git/wiki_spec.rb index 8bae2e8125e..a88097705f6 100644 --- a/spec/lib/gitlab/git/wiki_spec.rb +++ b/spec/lib/gitlab/git/wiki_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::Wiki do +RSpec.describe Gitlab::Git::Wiki do using RSpec::Parameterized::TableSyntax let(:project) { create(:project) } diff --git a/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb b/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb index a4489cca443..e448277b307 100644 --- a/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb +++ b/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git::WrapsGitalyErrors do +RSpec.describe Gitlab::Git::WrapsGitalyErrors do subject(:wrapper) do klazz = Class.new { include Gitlab::Git::WrapsGitalyErrors } klazz.new diff --git a/spec/lib/gitlab/git_access_design_spec.rb b/spec/lib/gitlab/git_access_design_spec.rb index d816608f7e5..ee25f6c2979 100644 --- a/spec/lib/gitlab/git_access_design_spec.rb +++ b/spec/lib/gitlab/git_access_design_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::GitAccessDesign do +RSpec.describe Gitlab::GitAccessDesign do include DesignManagementTestHelpers let_it_be(:project) { create(:project) } diff --git a/spec/lib/gitlab/git_access_snippet_spec.rb b/spec/lib/gitlab/git_access_snippet_spec.rb index 48b425a8ec5..3b8b5fd82c6 100644 --- a/spec/lib/gitlab/git_access_snippet_spec.rb +++ b/spec/lib/gitlab/git_access_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitAccessSnippet do +RSpec.describe Gitlab::GitAccessSnippet do include ProjectHelpers include TermsHelper include_context 'ProjectPolicyTable context' diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb index 7c09fc5cc79..01691f87092 100644 --- a/spec/lib/gitlab/git_access_spec.rb +++ b/spec/lib/gitlab/git_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitAccess do +RSpec.describe Gitlab::GitAccess do include TermsHelper include GitHelpers diff --git a/spec/lib/gitlab/git_access_wiki_spec.rb b/spec/lib/gitlab/git_access_wiki_spec.rb index e42570804a8..738269e4a14 100644 --- a/spec/lib/gitlab/git_access_wiki_spec.rb +++ b/spec/lib/gitlab/git_access_wiki_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitAccessWiki do +RSpec.describe Gitlab::GitAccessWiki do let(:access) { described_class.new(user, project, 'web', authentication_abilities: authentication_abilities, redirected_path: redirected_path) } let(:project) { create(:project, :wiki_repo) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/git_post_receive_spec.rb b/spec/lib/gitlab/git_post_receive_spec.rb index 0e25a616810..45d536a437f 100644 --- a/spec/lib/gitlab/git_post_receive_spec.rb +++ b/spec/lib/gitlab/git_post_receive_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::GitPostReceive do +RSpec.describe ::Gitlab::GitPostReceive do let_it_be(:project) { create(:project, :repository) } subject { described_class.new(project, "project-#{project.id}", changes.dup, {}) } diff --git a/spec/lib/gitlab/git_ref_validator_spec.rb b/spec/lib/gitlab/git_ref_validator_spec.rb index 28cc13f02de..6938ad51189 100644 --- a/spec/lib/gitlab/git_ref_validator_spec.rb +++ b/spec/lib/gitlab/git_ref_validator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitRefValidator do +RSpec.describe Gitlab::GitRefValidator do using RSpec::Parameterized::TableSyntax describe '.validate' do diff --git a/spec/lib/gitlab/git_spec.rb b/spec/lib/gitlab/git_spec.rb index d6d12b84724..784d25f55c1 100644 --- a/spec/lib/gitlab/git_spec.rb +++ b/spec/lib/gitlab/git_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Git do +RSpec.describe Gitlab::Git do let(:committer_email) { 'user@example.org' } let(:committer_name) { 'John Doe' } diff --git a/spec/lib/gitlab/gitaly_client/blob_service_spec.rb b/spec/lib/gitlab/gitaly_client/blob_service_spec.rb index e609acc8fb0..037734f1b13 100644 --- a/spec/lib/gitlab/gitaly_client/blob_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/blob_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::BlobService do +RSpec.describe Gitlab::GitalyClient::BlobService do let(:project) { create(:project, :repository) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } diff --git a/spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb b/spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb index e88b86c71f2..e0c3e8d4b40 100644 --- a/spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb +++ b/spec/lib/gitlab/gitaly_client/blobs_stitcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::BlobsStitcher do +RSpec.describe Gitlab::GitalyClient::BlobsStitcher do describe 'enumeration' do it 'combines segregated blob messages together' do messages = [ diff --git a/spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb b/spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb index 07f53797b2a..3381c69ea0d 100644 --- a/spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/cleanup_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::CleanupService do +RSpec.describe Gitlab::GitalyClient::CleanupService do let(:project) { create(:project) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } diff --git a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb index d33e67040b2..afd63a0dbf2 100644 --- a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::CommitService do +RSpec.describe Gitlab::GitalyClient::CommitService do let(:project) { create(:project, :repository) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } diff --git a/spec/lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb b/spec/lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb index db734b1c129..0bb8628af6c 100644 --- a/spec/lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb +++ b/spec/lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::ConflictFilesStitcher do +RSpec.describe Gitlab::GitalyClient::ConflictFilesStitcher do describe 'enumeration' do it 'combines segregated ConflictFile messages together' do target_project = create(:project, :repository) diff --git a/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb b/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb index f19bcae2470..b016e8bdf5a 100644 --- a/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/conflicts_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::ConflictsService do +RSpec.describe Gitlab::GitalyClient::ConflictsService do let(:project) { create(:project, :repository) } let(:target_project) { create(:project, :repository) } let(:source_repository) { project.repository.raw } diff --git a/spec/lib/gitlab/gitaly_client/diff_spec.rb b/spec/lib/gitlab/gitaly_client/diff_spec.rb index d86497da7f5..230322faecd 100644 --- a/spec/lib/gitlab/gitaly_client/diff_spec.rb +++ b/spec/lib/gitlab/gitaly_client/diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::Diff do +RSpec.describe Gitlab::GitalyClient::Diff do let(:diff_fields) do { to_path: ".gitmodules", diff --git a/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb b/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb index c9d42ad32cf..113c47b4f2c 100644 --- a/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb +++ b/spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::DiffStitcher do +RSpec.describe Gitlab::GitalyClient::DiffStitcher do describe 'enumeration' do it 'combines segregated diff messages together' do diff_1 = OpenStruct.new( diff --git a/spec/lib/gitlab/gitaly_client/health_check_service_spec.rb b/spec/lib/gitlab/gitaly_client/health_check_service_spec.rb index 615bc80fff2..0855544d11e 100644 --- a/spec/lib/gitlab/gitaly_client/health_check_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/health_check_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::HealthCheckService do +RSpec.describe Gitlab::GitalyClient::HealthCheckService do let(:project) { create(:project) } let(:storage_name) { project.repository_storage } diff --git a/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb b/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb index 0e0c3d329b5..15eebf62a39 100644 --- a/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/object_pool_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::ObjectPoolService do +RSpec.describe Gitlab::GitalyClient::ObjectPoolService do let(:pool_repository) { create(:pool_repository) } let(:project) { create(:project, :repository) } let(:raw_repository) { project.repository.raw } diff --git a/spec/lib/gitlab/gitaly_client/operation_service_spec.rb b/spec/lib/gitlab/gitaly_client/operation_service_spec.rb index 45701b501bb..f0fa41f8308 100644 --- a/spec/lib/gitlab/gitaly_client/operation_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/operation_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::OperationService do +RSpec.describe Gitlab::GitalyClient::OperationService do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository) } let(:repository) { project.repository.raw } diff --git a/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb b/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb index 9b5c751e0ec..5f90745f4e0 100644 --- a/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/praefect_info_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::PraefectInfoService do +RSpec.describe Gitlab::GitalyClient::PraefectInfoService do let(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:gitaly_repository) { repository.gitaly_repository } diff --git a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb index b0b6544a278..a4c6e30bba8 100644 --- a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::RefService do +RSpec.describe Gitlab::GitalyClient::RefService do let(:project) { create(:project, :repository) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } diff --git a/spec/lib/gitlab/gitaly_client/remote_service_spec.rb b/spec/lib/gitlab/gitaly_client/remote_service_spec.rb index 2bddec739fc..6d1f55a3416 100644 --- a/spec/lib/gitlab/gitaly_client/remote_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/remote_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::RemoteService do +RSpec.describe Gitlab::GitalyClient::RemoteService do let(:project) { create(:project) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } diff --git a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb index 5f4147f6ff6..c7ea0a95596 100644 --- a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::RepositoryService do +RSpec.describe Gitlab::GitalyClient::RepositoryService do using RSpec::Parameterized::TableSyntax let(:project) { create(:project) } diff --git a/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb b/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb index a6b29489df3..0c4c8de52ae 100644 --- a/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb +++ b/spec/lib/gitlab/gitaly_client/storage_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::StorageSettings do +RSpec.describe Gitlab::GitalyClient::StorageSettings do describe "#initialize" do context 'when the storage contains no path' do it 'raises an error' do diff --git a/spec/lib/gitlab/gitaly_client/util_spec.rb b/spec/lib/gitlab/gitaly_client/util_spec.rb index f31b7c349ff..b6589a08f7d 100644 --- a/spec/lib/gitlab/gitaly_client/util_spec.rb +++ b/spec/lib/gitlab/gitaly_client/util_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::Util do +RSpec.describe Gitlab::GitalyClient::Util do describe '.repository' do let(:repository_storage) { 'default' } let(:relative_path) { 'my/repo.git' } diff --git a/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb b/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb index cb04f9a1637..a06f8459963 100644 --- a/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/wiki_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitalyClient::WikiService do +RSpec.describe Gitlab::GitalyClient::WikiService do let(:project) { create(:project) } let(:storage_name) { project.repository_storage } let(:relative_path) { project.disk_path + '.git' } diff --git a/spec/lib/gitlab/gitaly_client_spec.rb b/spec/lib/gitlab/gitaly_client_spec.rb index c2b989c2fdc..b70dc8fb6b0 100644 --- a/spec/lib/gitlab/gitaly_client_spec.rb +++ b/spec/lib/gitlab/gitaly_client_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' # We stub Gitaly in `spec/support/gitaly.rb` for other tests. We don't want # those stubs while testing the GitalyClient itself. -describe Gitlab::GitalyClient do +RSpec.describe Gitlab::GitalyClient do let(:sample_cert) { Rails.root.join('spec/fixtures/clusters/sample_cert.pem').to_s } before do diff --git a/spec/lib/gitlab/github_import/bulk_importing_spec.rb b/spec/lib/gitlab/github_import/bulk_importing_spec.rb index 3266ec4ab50..63dce51c5da 100644 --- a/spec/lib/gitlab/github_import/bulk_importing_spec.rb +++ b/spec/lib/gitlab/github_import/bulk_importing_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::BulkImporting do +RSpec.describe Gitlab::GithubImport::BulkImporting do let(:importer) do Class.new { include(Gitlab::GithubImport::BulkImporting) }.new end diff --git a/spec/lib/gitlab/github_import/client_spec.rb b/spec/lib/gitlab/github_import/client_spec.rb index 3b269d64b07..7cff6ed1388 100644 --- a/spec/lib/gitlab/github_import/client_spec.rb +++ b/spec/lib/gitlab/github_import/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Client do +RSpec.describe Gitlab::GithubImport::Client do describe '#parallel?' do it 'returns true when the client is running in parallel mode' do client = described_class.new('foo', parallel: true) diff --git a/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb b/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb index 66909976b43..9eea85526f5 100644 --- a/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::DiffNoteImporter do +RSpec.describe Gitlab::GithubImport::Importer::DiffNoteImporter do let(:project) { create(:project) } let(:client) { double(:client) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/github_import/importer/diff_notes_importer_spec.rb b/spec/lib/gitlab/github_import/importer/diff_notes_importer_spec.rb index 23ed21294e3..7750e508713 100644 --- a/spec/lib/gitlab/github_import/importer/diff_notes_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/diff_notes_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::DiffNotesImporter do +RSpec.describe Gitlab::GithubImport::Importer::DiffNotesImporter do let(:project) { double(:project, id: 4, import_source: 'foo/bar') } let(:client) { double(:client) } diff --git a/spec/lib/gitlab/github_import/importer/issue_and_label_links_importer_spec.rb b/spec/lib/gitlab/github_import/importer/issue_and_label_links_importer_spec.rb index 399e2d9a563..49a76fb5e6b 100644 --- a/spec/lib/gitlab/github_import/importer/issue_and_label_links_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/issue_and_label_links_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::IssueAndLabelLinksImporter do +RSpec.describe Gitlab::GithubImport::Importer::IssueAndLabelLinksImporter do describe '#execute' do it 'imports an issue and its labels' do issue = double(:issue) diff --git a/spec/lib/gitlab/github_import/importer/issue_importer_spec.rb b/spec/lib/gitlab/github_import/importer/issue_importer_spec.rb index 0f2ba99f816..fb826c987e1 100644 --- a/spec/lib/gitlab/github_import/importer/issue_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/issue_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::IssueImporter, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::Importer::IssueImporter, :clean_gitlab_redis_cache do let(:project) { create(:project) } let(:client) { double(:client) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/github_import/importer/issues_importer_spec.rb b/spec/lib/gitlab/github_import/importer/issues_importer_spec.rb index 8920ef9fedb..2c2b6a2aff0 100644 --- a/spec/lib/gitlab/github_import/importer/issues_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/issues_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::IssuesImporter do +RSpec.describe Gitlab::GithubImport::Importer::IssuesImporter do let(:project) { double(:project, id: 4, import_source: 'foo/bar') } let(:client) { double(:client) } let(:created_at) { Time.new(2017, 1, 1, 12, 00) } diff --git a/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb b/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb index 9c02b0e280f..4d3245fc988 100644 --- a/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::LabelLinksImporter do +RSpec.describe Gitlab::GithubImport::Importer::LabelLinksImporter do let(:project) { create(:project) } let(:client) { double(:client) } let(:issue) do diff --git a/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb b/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb index 16326da9ca4..0010b959a49 100644 --- a/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::LabelsImporter, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::Importer::LabelsImporter, :clean_gitlab_redis_cache do let(:project) { create(:project, import_source: 'foo/bar') } let(:client) { double(:client) } let(:importer) { described_class.new(project, client) } diff --git a/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb b/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb index a02b620f131..add554992f1 100644 --- a/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/lfs_object_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::LfsObjectImporter do +RSpec.describe Gitlab::GithubImport::Importer::LfsObjectImporter do let(:project) { create(:project) } let(:lfs_attributes) do { diff --git a/spec/lib/gitlab/github_import/importer/lfs_objects_importer_spec.rb b/spec/lib/gitlab/github_import/importer/lfs_objects_importer_spec.rb index bec039a48eb..1f7b14661c2 100644 --- a/spec/lib/gitlab/github_import/importer/lfs_objects_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/lfs_objects_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::LfsObjectsImporter do +RSpec.describe Gitlab::GithubImport::Importer::LfsObjectsImporter do let(:project) { double(:project, id: 4, import_source: 'foo/bar') } let(:client) { double(:client) } let(:download_link) { "http://www.gitlab.com/lfs_objects/oid" } diff --git a/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb b/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb index 294599c02f4..dad1efc5a8d 100644 --- a/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::MilestonesImporter, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::Importer::MilestonesImporter, :clean_gitlab_redis_cache do let(:project) { create(:project, import_source: 'foo/bar') } let(:client) { double(:client) } let(:importer) { described_class.new(project, client) } diff --git a/spec/lib/gitlab/github_import/importer/note_importer_spec.rb b/spec/lib/gitlab/github_import/importer/note_importer_spec.rb index 816041b771b..3bb57e152fe 100644 --- a/spec/lib/gitlab/github_import/importer/note_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/note_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::NoteImporter do +RSpec.describe Gitlab::GithubImport::Importer::NoteImporter do let(:client) { double(:client) } let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/github_import/importer/notes_importer_spec.rb b/spec/lib/gitlab/github_import/importer/notes_importer_spec.rb index 128f8f95fa0..3782dab5ee3 100644 --- a/spec/lib/gitlab/github_import/importer/notes_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/notes_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::NotesImporter do +RSpec.describe Gitlab::GithubImport::Importer::NotesImporter do let(:project) { double(:project, id: 4, import_source: 'foo/bar') } let(:client) { double(:client) } diff --git a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb index bffae9e2ba0..46850618945 100644 --- a/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/pull_request_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::Importer::PullRequestImporter, :clean_gitlab_redis_cache do let(:project) { create(:project, :repository) } let(:client) { double(:client) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb index 526a5589743..05ac0248ec9 100644 --- a/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::PullRequestsImporter do +RSpec.describe Gitlab::GithubImport::Importer::PullRequestsImporter do let(:project) { create(:project, import_source: 'foo/bar') } let(:client) { double(:client) } diff --git a/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb b/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb index f8d53208619..1a25824bc8a 100644 --- a/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/releases_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::ReleasesImporter do +RSpec.describe Gitlab::GithubImport::Importer::ReleasesImporter do let(:project) { create(:project) } let(:client) { double(:client) } let(:importer) { described_class.new(project, client) } diff --git a/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb b/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb index e26ac7bf81e..65dba2711b9 100644 --- a/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Importer::RepositoryImporter do +RSpec.describe Gitlab::GithubImport::Importer::RepositoryImporter do let(:repository) { double(:repository) } let(:import_state) { double(:import_state) } let(:client) { double(:client) } diff --git a/spec/lib/gitlab/github_import/issuable_finder_spec.rb b/spec/lib/gitlab/github_import/issuable_finder_spec.rb index 55add863d43..f009b61ad89 100644 --- a/spec/lib/gitlab/github_import/issuable_finder_spec.rb +++ b/spec/lib/gitlab/github_import/issuable_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::IssuableFinder, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::IssuableFinder, :clean_gitlab_redis_cache do let(:project) { double(:project, id: 4) } let(:issue) do double(:issue, issuable_type: MergeRequest, iid: 1) diff --git a/spec/lib/gitlab/github_import/label_finder_spec.rb b/spec/lib/gitlab/github_import/label_finder_spec.rb index bb946a15a2d..452f3c896a4 100644 --- a/spec/lib/gitlab/github_import/label_finder_spec.rb +++ b/spec/lib/gitlab/github_import/label_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::LabelFinder, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::LabelFinder, :clean_gitlab_redis_cache do let(:project) { create(:project) } let(:finder) { described_class.new(project) } let!(:bug) { create(:label, project: project, name: 'Bug') } diff --git a/spec/lib/gitlab/github_import/markdown_text_spec.rb b/spec/lib/gitlab/github_import/markdown_text_spec.rb index a1216db7aac..4995caa0733 100644 --- a/spec/lib/gitlab/github_import/markdown_text_spec.rb +++ b/spec/lib/gitlab/github_import/markdown_text_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::MarkdownText do +RSpec.describe Gitlab::GithubImport::MarkdownText do describe '.format' do it 'formats the text' do author = double(:author, login: 'Alice') diff --git a/spec/lib/gitlab/github_import/milestone_finder_spec.rb b/spec/lib/gitlab/github_import/milestone_finder_spec.rb index ecb533b7e39..419184d6115 100644 --- a/spec/lib/gitlab/github_import/milestone_finder_spec.rb +++ b/spec/lib/gitlab/github_import/milestone_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::MilestoneFinder, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::MilestoneFinder, :clean_gitlab_redis_cache do let!(:project) { create(:project) } let!(:milestone) { create(:milestone, project: project) } let(:finder) { described_class.new(project) } diff --git a/spec/lib/gitlab/github_import/page_counter_spec.rb b/spec/lib/gitlab/github_import/page_counter_spec.rb index 95125c9c22f..a1305b714b5 100644 --- a/spec/lib/gitlab/github_import/page_counter_spec.rb +++ b/spec/lib/gitlab/github_import/page_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::PageCounter, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::PageCounter, :clean_gitlab_redis_cache do let(:project) { double(:project, id: 1) } let(:counter) { described_class.new(project, :issues) } diff --git a/spec/lib/gitlab/github_import/parallel_importer_spec.rb b/spec/lib/gitlab/github_import/parallel_importer_spec.rb index a8d5cc58bd5..06304bf84ca 100644 --- a/spec/lib/gitlab/github_import/parallel_importer_spec.rb +++ b/spec/lib/gitlab/github_import/parallel_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::ParallelImporter do +RSpec.describe Gitlab::GithubImport::ParallelImporter do describe '.async?' do it 'returns true' do expect(described_class).to be_async diff --git a/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb b/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb index a6ae99b395c..578743be96b 100644 --- a/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb +++ b/spec/lib/gitlab/github_import/parallel_scheduling_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::ParallelScheduling do +RSpec.describe Gitlab::GithubImport::ParallelScheduling do let(:importer_class) do Class.new do include(Gitlab::GithubImport::ParallelScheduling) diff --git a/spec/lib/gitlab/github_import/representation/diff_note_spec.rb b/spec/lib/gitlab/github_import/representation/diff_note_spec.rb index e743a87cdd1..7e540674258 100644 --- a/spec/lib/gitlab/github_import/representation/diff_note_spec.rb +++ b/spec/lib/gitlab/github_import/representation/diff_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::DiffNote do +RSpec.describe Gitlab::GithubImport::Representation::DiffNote do let(:hunk) do '@@ -1 +1 @@ -Hello diff --git a/spec/lib/gitlab/github_import/representation/expose_attribute_spec.rb b/spec/lib/gitlab/github_import/representation/expose_attribute_spec.rb index e3b48df4ae9..d40be0e841c 100644 --- a/spec/lib/gitlab/github_import/representation/expose_attribute_spec.rb +++ b/spec/lib/gitlab/github_import/representation/expose_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::ExposeAttribute do +RSpec.describe Gitlab::GithubImport::Representation::ExposeAttribute do it 'defines a getter method that returns an attribute value' do klass = Class.new do include Gitlab::GithubImport::Representation::ExposeAttribute diff --git a/spec/lib/gitlab/github_import/representation/issue_spec.rb b/spec/lib/gitlab/github_import/representation/issue_spec.rb index 741a912e53b..3d306a4a3a3 100644 --- a/spec/lib/gitlab/github_import/representation/issue_spec.rb +++ b/spec/lib/gitlab/github_import/representation/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::Issue do +RSpec.describe Gitlab::GithubImport::Representation::Issue do let(:created_at) { Time.new(2017, 1, 1, 12, 00) } let(:updated_at) { Time.new(2017, 1, 1, 12, 15) } diff --git a/spec/lib/gitlab/github_import/representation/note_spec.rb b/spec/lib/gitlab/github_import/representation/note_spec.rb index a171a38bc9e..112bb7eb908 100644 --- a/spec/lib/gitlab/github_import/representation/note_spec.rb +++ b/spec/lib/gitlab/github_import/representation/note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::Note do +RSpec.describe Gitlab::GithubImport::Representation::Note do let(:created_at) { Time.new(2017, 1, 1, 12, 00) } let(:updated_at) { Time.new(2017, 1, 1, 12, 15) } diff --git a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb index b6dcd098c9c..370eac1d993 100644 --- a/spec/lib/gitlab/github_import/representation/pull_request_spec.rb +++ b/spec/lib/gitlab/github_import/representation/pull_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::PullRequest do +RSpec.describe Gitlab::GithubImport::Representation::PullRequest do let(:created_at) { Time.new(2017, 1, 1, 12, 00) } let(:updated_at) { Time.new(2017, 1, 1, 12, 15) } let(:merged_at) { Time.new(2017, 1, 1, 12, 17) } diff --git a/spec/lib/gitlab/github_import/representation/to_hash_spec.rb b/spec/lib/gitlab/github_import/representation/to_hash_spec.rb index 9c47349b376..2770e5c5397 100644 --- a/spec/lib/gitlab/github_import/representation/to_hash_spec.rb +++ b/spec/lib/gitlab/github_import/representation/to_hash_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::ToHash do +RSpec.describe Gitlab::GithubImport::Representation::ToHash do describe '#to_hash' do let(:user) { double(:user, attributes: { login: 'alice' }) } diff --git a/spec/lib/gitlab/github_import/representation/user_spec.rb b/spec/lib/gitlab/github_import/representation/user_spec.rb index a7ad6bda3ad..14204886e9b 100644 --- a/spec/lib/gitlab/github_import/representation/user_spec.rb +++ b/spec/lib/gitlab/github_import/representation/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation::User do +RSpec.describe Gitlab::GithubImport::Representation::User do shared_examples 'a User' do it 'returns an instance of User' do expect(user).to be_an_instance_of(described_class) diff --git a/spec/lib/gitlab/github_import/representation_spec.rb b/spec/lib/gitlab/github_import/representation_spec.rb index 76753a0ff21..58c10c4a775 100644 --- a/spec/lib/gitlab/github_import/representation_spec.rb +++ b/spec/lib/gitlab/github_import/representation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::Representation do +RSpec.describe Gitlab::GithubImport::Representation do describe '.symbolize_hash' do it 'returns a Hash with the keys as Symbols' do hash = described_class.symbolize_hash('number' => 10) diff --git a/spec/lib/gitlab/github_import/sequential_importer_spec.rb b/spec/lib/gitlab/github_import/sequential_importer_spec.rb index 256155dea03..fe13fcd2568 100644 --- a/spec/lib/gitlab/github_import/sequential_importer_spec.rb +++ b/spec/lib/gitlab/github_import/sequential_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::SequentialImporter do +RSpec.describe Gitlab::GithubImport::SequentialImporter do describe '#execute' do it 'imports a project in sequence' do repository = double(:repository) diff --git a/spec/lib/gitlab/github_import/user_finder_spec.rb b/spec/lib/gitlab/github_import/user_finder_spec.rb index 8764ebef32b..0dd2bd4df45 100644 --- a/spec/lib/gitlab/github_import/user_finder_spec.rb +++ b/spec/lib/gitlab/github_import/user_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport::UserFinder, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::GithubImport::UserFinder, :clean_gitlab_redis_cache do let(:project) { create(:project) } let(:client) { double(:client) } let(:finder) { described_class.new(project, client) } diff --git a/spec/lib/gitlab/github_import_spec.rb b/spec/lib/gitlab/github_import_spec.rb index 290d66243aa..1a690b81d2b 100644 --- a/spec/lib/gitlab/github_import_spec.rb +++ b/spec/lib/gitlab/github_import_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GithubImport do +RSpec.describe Gitlab::GithubImport do let(:project) { double(:project) } describe '.new_client_for' do diff --git a/spec/lib/gitlab/gitlab_import/client_spec.rb b/spec/lib/gitlab/gitlab_import/client_spec.rb index 6e4e88093bb..7f57d5fbf1b 100644 --- a/spec/lib/gitlab/gitlab_import/client_spec.rb +++ b/spec/lib/gitlab/gitlab_import/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitlabImport::Client do +RSpec.describe Gitlab::GitlabImport::Client do include ImportSpecHelper let(:token) { '123456' } diff --git a/spec/lib/gitlab/gitlab_import/importer_spec.rb b/spec/lib/gitlab/gitlab_import/importer_spec.rb index 2db1ddcfd0a..eb4c404e454 100644 --- a/spec/lib/gitlab/gitlab_import/importer_spec.rb +++ b/spec/lib/gitlab/gitlab_import/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitlabImport::Importer do +RSpec.describe Gitlab::GitlabImport::Importer do include ImportSpecHelper describe '#execute' do diff --git a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb index c7ef978df37..44bcfb93c51 100644 --- a/spec/lib/gitlab/gitlab_import/project_creator_spec.rb +++ b/spec/lib/gitlab/gitlab_import/project_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GitlabImport::ProjectCreator do +RSpec.describe Gitlab::GitlabImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do { diff --git a/spec/lib/gitlab/gl_repository/identifier_spec.rb b/spec/lib/gitlab/gl_repository/identifier_spec.rb index c36f296702e..d21e29f0898 100644 --- a/spec/lib/gitlab/gl_repository/identifier_spec.rb +++ b/spec/lib/gitlab/gl_repository/identifier_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GlRepository::Identifier do +RSpec.describe Gitlab::GlRepository::Identifier do let_it_be(:project) { create(:project) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } diff --git a/spec/lib/gitlab/gl_repository/repo_type_spec.rb b/spec/lib/gitlab/gl_repository/repo_type_spec.rb index f5270104d2f..e920fc7cd3b 100644 --- a/spec/lib/gitlab/gl_repository/repo_type_spec.rb +++ b/spec/lib/gitlab/gl_repository/repo_type_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::GlRepository::RepoType do +RSpec.describe Gitlab::GlRepository::RepoType do let_it_be(:project) { create(:project) } let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) } let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) } diff --git a/spec/lib/gitlab/gl_repository_spec.rb b/spec/lib/gitlab/gl_repository_spec.rb index 413540b4db8..f90103ee6f7 100644 --- a/spec/lib/gitlab/gl_repository_spec.rb +++ b/spec/lib/gitlab/gl_repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::GlRepository do +RSpec.describe ::Gitlab::GlRepository do describe '.parse' do let_it_be(:project) { create(:project, :repository) } let_it_be(:snippet) { create(:personal_snippet) } diff --git a/spec/lib/gitlab/global_id_spec.rb b/spec/lib/gitlab/global_id_spec.rb index 719743ed5dc..b46e88bab08 100644 --- a/spec/lib/gitlab/global_id_spec.rb +++ b/spec/lib/gitlab/global_id_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GlobalId do +RSpec.describe Gitlab::GlobalId do describe '.build' do let_it_be(:object) { create(:issue) } diff --git a/spec/lib/gitlab/gon_helper_spec.rb b/spec/lib/gitlab/gon_helper_spec.rb index 7b0e0d01257..95db6b2b4e0 100644 --- a/spec/lib/gitlab/gon_helper_spec.rb +++ b/spec/lib/gitlab/gon_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GonHelper do +RSpec.describe Gitlab::GonHelper do let(:helper) do Class.new do include Gitlab::GonHelper diff --git a/spec/lib/gitlab/google_code_import/client_spec.rb b/spec/lib/gitlab/google_code_import/client_spec.rb index fb1c7085017..402d2169432 100644 --- a/spec/lib/gitlab/google_code_import/client_spec.rb +++ b/spec/lib/gitlab/google_code_import/client_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::GoogleCodeImport::Client do +RSpec.describe Gitlab::GoogleCodeImport::Client do let(:raw_data) { Gitlab::Json.parse(fixture_file("GoogleCodeProjectHosting.json")) } subject { described_class.new(raw_data) } diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb index 3118671bb5e..f681e3c9f31 100644 --- a/spec/lib/gitlab/google_code_import/importer_spec.rb +++ b/spec/lib/gitlab/google_code_import/importer_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::GoogleCodeImport::Importer do +RSpec.describe Gitlab::GoogleCodeImport::Importer do let(:mapped_user) { create(:user, username: "thilo123") } let(:raw_data) { Gitlab::Json.parse(fixture_file("GoogleCodeProjectHosting.json")) } let(:client) { Gitlab::GoogleCodeImport::Client.new(raw_data) } diff --git a/spec/lib/gitlab/google_code_import/project_creator_spec.rb b/spec/lib/gitlab/google_code_import/project_creator_spec.rb index 2353c24f77b..4be2e16c116 100644 --- a/spec/lib/gitlab/google_code_import/project_creator_spec.rb +++ b/spec/lib/gitlab/google_code_import/project_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GoogleCodeImport::ProjectCreator do +RSpec.describe Gitlab::GoogleCodeImport::ProjectCreator do let(:user) { create(:user) } let(:repo) do Gitlab::GoogleCodeImport::Repository.new( diff --git a/spec/lib/gitlab/gpg/commit_spec.rb b/spec/lib/gitlab/gpg/commit_spec.rb index ea0a6e1b967..55102554508 100644 --- a/spec/lib/gitlab/gpg/commit_spec.rb +++ b/spec/lib/gitlab/gpg/commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Gpg::Commit do +RSpec.describe Gitlab::Gpg::Commit do describe '#signature' do shared_examples 'returns the cached signature on second call' do it 'returns the cached signature on second call' do diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index c7b9775f642..72c6c8efb5e 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Gpg do +RSpec.describe Gitlab::Gpg do describe '.fingerprints_from_key' do before do # make sure that each method is using the temporary keychain @@ -244,7 +244,7 @@ describe Gitlab::Gpg do end end -describe Gitlab::Gpg::CurrentKeyChain do +RSpec.describe Gitlab::Gpg::CurrentKeyChain do around do |example| Gitlab::Gpg.using_tmp_keychain do example.run diff --git a/spec/lib/gitlab/grape_logging/formatters/lograge_with_timestamp_spec.rb b/spec/lib/gitlab/grape_logging/formatters/lograge_with_timestamp_spec.rb index 84f23bb2ad9..e5d0adcfd5f 100644 --- a/spec/lib/gitlab/grape_logging/formatters/lograge_with_timestamp_spec.rb +++ b/spec/lib/gitlab/grape_logging/formatters/lograge_with_timestamp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GrapeLogging::Formatters::LogrageWithTimestamp do +RSpec.describe Gitlab::GrapeLogging::Formatters::LogrageWithTimestamp do let(:log_entry) do { status: 200, diff --git a/spec/lib/gitlab/grape_logging/loggers/cloudflare_logger_spec.rb b/spec/lib/gitlab/grape_logging/loggers/cloudflare_logger_spec.rb index 922a433d7ac..f683f98f019 100644 --- a/spec/lib/gitlab/grape_logging/loggers/cloudflare_logger_spec.rb +++ b/spec/lib/gitlab/grape_logging/loggers/cloudflare_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GrapeLogging::Loggers::CloudflareLogger do +RSpec.describe Gitlab::GrapeLogging::Loggers::CloudflareLogger do subject { described_class.new } describe "#parameters" do diff --git a/spec/lib/gitlab/grape_logging/loggers/exception_logger_spec.rb b/spec/lib/gitlab/grape_logging/loggers/exception_logger_spec.rb index cc9535d4d2c..bcb1f6c5af7 100644 --- a/spec/lib/gitlab/grape_logging/loggers/exception_logger_spec.rb +++ b/spec/lib/gitlab/grape_logging/loggers/exception_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GrapeLogging::Loggers::ExceptionLogger do +RSpec.describe Gitlab::GrapeLogging::Loggers::ExceptionLogger do let(:mock_request) { OpenStruct.new(env: {}) } let(:response_body) { nil } diff --git a/spec/lib/gitlab/grape_logging/loggers/perf_logger_spec.rb b/spec/lib/gitlab/grape_logging/loggers/perf_logger_spec.rb index 09ba4b89a1a..95e3af34174 100644 --- a/spec/lib/gitlab/grape_logging/loggers/perf_logger_spec.rb +++ b/spec/lib/gitlab/grape_logging/loggers/perf_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GrapeLogging::Loggers::PerfLogger do +RSpec.describe Gitlab::GrapeLogging::Loggers::PerfLogger do subject { described_class.new } describe ".parameters" do diff --git a/spec/lib/gitlab/grape_logging/loggers/queue_duration_logger_spec.rb b/spec/lib/gitlab/grape_logging/loggers/queue_duration_logger_spec.rb index 17c0659327d..e68c1446502 100644 --- a/spec/lib/gitlab/grape_logging/loggers/queue_duration_logger_spec.rb +++ b/spec/lib/gitlab/grape_logging/loggers/queue_duration_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GrapeLogging::Loggers::QueueDurationLogger do +RSpec.describe Gitlab::GrapeLogging::Loggers::QueueDurationLogger do subject { described_class.new } describe ".parameters" do diff --git a/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb b/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb index c1dab5feb91..efe6c27c463 100644 --- a/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb +++ b/spec/lib/gitlab/graphql/authorize/authorize_field_service_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' # Also see spec/graphql/features/authorization_spec.rb for # integration tests of AuthorizeFieldService -describe Gitlab::Graphql::Authorize::AuthorizeFieldService do +RSpec.describe Gitlab::Graphql::Authorize::AuthorizeFieldService do def type(type_authorizations = []) Class.new(Types::BaseObject) do graphql_name 'TestType' diff --git a/spec/lib/gitlab/graphql/authorize/authorize_resource_spec.rb b/spec/lib/gitlab/graphql/authorize/authorize_resource_spec.rb index 67cb064b966..83873081a98 100644 --- a/spec/lib/gitlab/graphql/authorize/authorize_resource_spec.rb +++ b/spec/lib/gitlab/graphql/authorize/authorize_resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Authorize::AuthorizeResource do +RSpec.describe Gitlab::Graphql::Authorize::AuthorizeResource do let(:fake_class) do Class.new do include Gitlab::Graphql::Authorize::AuthorizeResource diff --git a/spec/lib/gitlab/graphql/calls_gitaly/instrumentation_spec.rb b/spec/lib/gitlab/graphql/calls_gitaly/instrumentation_spec.rb index d93ce464a92..f16767f7d14 100644 --- a/spec/lib/gitlab/graphql/calls_gitaly/instrumentation_spec.rb +++ b/spec/lib/gitlab/graphql/calls_gitaly/instrumentation_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Graphql::CallsGitaly::Instrumentation do +RSpec.describe Gitlab::Graphql::CallsGitaly::Instrumentation do subject { described_class.new } describe '#calls_gitaly_check' do diff --git a/spec/lib/gitlab/graphql/copy_field_description_spec.rb b/spec/lib/gitlab/graphql/copy_field_description_spec.rb index e7462c5b954..310b4046b56 100644 --- a/spec/lib/gitlab/graphql/copy_field_description_spec.rb +++ b/spec/lib/gitlab/graphql/copy_field_description_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::CopyFieldDescription do +RSpec.describe Gitlab::Graphql::CopyFieldDescription do subject { Class.new.include(described_class) } describe '.copy_field_description' do diff --git a/spec/lib/gitlab/graphql/docs/renderer_spec.rb b/spec/lib/gitlab/graphql/docs/renderer_spec.rb index 87079a1786c..81ef7fcda97 100644 --- a/spec/lib/gitlab/graphql/docs/renderer_spec.rb +++ b/spec/lib/gitlab/graphql/docs/renderer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Docs::Renderer do +RSpec.describe Gitlab::Graphql::Docs::Renderer do describe '#contents' do # Returns a Schema that uses the given `type` def mock_schema(type) diff --git a/spec/lib/gitlab/graphql/find_argument_in_parent_spec.rb b/spec/lib/gitlab/graphql/find_argument_in_parent_spec.rb index 91e90315b3e..68b24a60a99 100644 --- a/spec/lib/gitlab/graphql/find_argument_in_parent_spec.rb +++ b/spec/lib/gitlab/graphql/find_argument_in_parent_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::FindArgumentInParent do +RSpec.describe Gitlab::Graphql::FindArgumentInParent do describe '#find' do def build_node(parent = nil, args: {}) props = { irep_node: double(arguments: args) } diff --git a/spec/lib/gitlab/graphql/generic_tracing_spec.rb b/spec/lib/gitlab/graphql/generic_tracing_spec.rb index ae92dcc40af..cd116225ecd 100644 --- a/spec/lib/gitlab/graphql/generic_tracing_spec.rb +++ b/spec/lib/gitlab/graphql/generic_tracing_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::GenericTracing do +RSpec.describe Gitlab::Graphql::GenericTracing do let(:graphql_duration_seconds_histogram) { double('Gitlab::Metrics::NullMetric') } it 'updates graphql histogram with expected labels' do diff --git a/spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb b/spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb index b3d57c899d5..ae5d9686c54 100644 --- a/spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb +++ b/spec/lib/gitlab/graphql/loaders/batch_lfs_oid_loader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Loaders::BatchLfsOidLoader do +RSpec.describe Gitlab::Graphql::Loaders::BatchLfsOidLoader do include GraphqlHelpers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/graphql/loaders/batch_model_loader_spec.rb b/spec/lib/gitlab/graphql/loaders/batch_model_loader_spec.rb index 79f9ecb39cf..cf1f00bc176 100644 --- a/spec/lib/gitlab/graphql/loaders/batch_model_loader_spec.rb +++ b/spec/lib/gitlab/graphql/loaders/batch_model_loader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Loaders::BatchModelLoader do +RSpec.describe Gitlab::Graphql::Loaders::BatchModelLoader do describe '#find' do let(:issue) { create(:issue) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/graphql/loaders/batch_project_statistics_loader_spec.rb b/spec/lib/gitlab/graphql/loaders/batch_project_statistics_loader_spec.rb index ec2fcad31e5..7ae28fdcf0f 100644 --- a/spec/lib/gitlab/graphql/loaders/batch_project_statistics_loader_spec.rb +++ b/spec/lib/gitlab/graphql/loaders/batch_project_statistics_loader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Loaders::BatchProjectStatisticsLoader do +RSpec.describe Gitlab::Graphql::Loaders::BatchProjectStatisticsLoader do describe '#find' do it 'only queries once for project statistics' do stats = create_list(:project_statistics, 2) diff --git a/spec/lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader_spec.rb b/spec/lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader_spec.rb index 38931f7ab5e..f73eace274d 100644 --- a/spec/lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader_spec.rb +++ b/spec/lib/gitlab/graphql/loaders/batch_root_storage_statistics_loader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader do +RSpec.describe Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader do describe '#find' do it 'only queries once for project statistics' do stats = create_list(:namespace_root_storage_statistics, 2) diff --git a/spec/lib/gitlab/graphql/markdown_field/resolver_spec.rb b/spec/lib/gitlab/graphql/markdown_field/resolver_spec.rb index b95bcdef188..af604e1c7d5 100644 --- a/spec/lib/gitlab/graphql/markdown_field/resolver_spec.rb +++ b/spec/lib/gitlab/graphql/markdown_field/resolver_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Graphql::MarkdownField::Resolver do +RSpec.describe Gitlab::Graphql::MarkdownField::Resolver do include Gitlab::Routing let(:resolver) { described_class.new(:note) } diff --git a/spec/lib/gitlab/graphql/markdown_field_spec.rb b/spec/lib/gitlab/graphql/markdown_field_spec.rb index 866a20801d3..e3da925376e 100644 --- a/spec/lib/gitlab/graphql/markdown_field_spec.rb +++ b/spec/lib/gitlab/graphql/markdown_field_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Graphql::MarkdownField do +RSpec.describe Gitlab::Graphql::MarkdownField do describe '.markdown_field' do it 'creates the field with some default attributes' do field = class_with_markdown_field(:test_html, null: true, method: :hello).fields['testHtml'] diff --git a/spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb b/spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb index 11cf14523c2..932bcd8cd92 100644 --- a/spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/externally_paginated_array_connection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::ExternallyPaginatedArrayConnection do +RSpec.describe Gitlab::Graphql::Pagination::ExternallyPaginatedArrayConnection do let(:prev_cursor) { 1 } let(:next_cursor) { 6 } let(:values) { [2, 3, 4, 5] } diff --git a/spec/lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition_spec.rb b/spec/lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition_spec.rb index 33dc6bdea97..eecdaa3409f 100644 --- a/spec/lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/keyset/conditions/not_null_condition_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::Keyset::Conditions::NotNullCondition do +RSpec.describe Gitlab::Graphql::Pagination::Keyset::Conditions::NotNullCondition do describe '#build' do let(:operators) { ['>', '>'] } let(:before_or_after) { :after } diff --git a/spec/lib/gitlab/graphql/pagination/keyset/conditions/null_condition_spec.rb b/spec/lib/gitlab/graphql/pagination/keyset/conditions/null_condition_spec.rb index 1c74f2fb0ab..582f96299ec 100644 --- a/spec/lib/gitlab/graphql/pagination/keyset/conditions/null_condition_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/keyset/conditions/null_condition_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::Keyset::Conditions::NullCondition do +RSpec.describe Gitlab::Graphql::Pagination::Keyset::Conditions::NullCondition do describe '#build' do let(:values) { [nil, 500] } let(:operators) { [nil, '>'] } diff --git a/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb b/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb index ed728444b17..65698caac34 100644 --- a/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::Keyset::Connection do +RSpec.describe Gitlab::Graphql::Pagination::Keyset::Connection do let(:nodes) { Project.all.order(id: :asc) } let(:arguments) { {} } let(:query_type) { GraphQL::ObjectType.new } diff --git a/spec/lib/gitlab/graphql/pagination/keyset/order_info_spec.rb b/spec/lib/gitlab/graphql/pagination/keyset/order_info_spec.rb index cb5656d7c00..9f310f30253 100644 --- a/spec/lib/gitlab/graphql/pagination/keyset/order_info_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/keyset/order_info_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::Keyset::OrderInfo do +RSpec.describe Gitlab::Graphql::Pagination::Keyset::OrderInfo do describe '#build_order_list' do let(:order_list) { described_class.build_order_list(relation) } diff --git a/spec/lib/gitlab/graphql/pagination/keyset/query_builder_spec.rb b/spec/lib/gitlab/graphql/pagination/keyset/query_builder_spec.rb index 7fd5b889cf9..31c02fd43e8 100644 --- a/spec/lib/gitlab/graphql/pagination/keyset/query_builder_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/keyset/query_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::Keyset::QueryBuilder do +RSpec.describe Gitlab::Graphql::Pagination::Keyset::QueryBuilder do context 'when number of ordering fields is 0' do it 'raises an error' do expect { described_class.new(Issue.arel_table, [], {}, :after) } diff --git a/spec/lib/gitlab/graphql/pagination/offset_active_record_relation_connection_spec.rb b/spec/lib/gitlab/graphql/pagination/offset_active_record_relation_connection_spec.rb index 931b1e708de..86f35de94ed 100644 --- a/spec/lib/gitlab/graphql/pagination/offset_active_record_relation_connection_spec.rb +++ b/spec/lib/gitlab/graphql/pagination/offset_active_record_relation_connection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection do +RSpec.describe Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection do it 'subclasses from GraphQL::Relay::RelationConnection' do expect(described_class.superclass).to eq GraphQL::Pagination::ActiveRecordRelationConnection end diff --git a/spec/lib/gitlab/graphql/query_analyzers/logger_analyzer_spec.rb b/spec/lib/gitlab/graphql/query_analyzers/logger_analyzer_spec.rb index 66033736e01..b690dfaed8f 100644 --- a/spec/lib/gitlab/graphql/query_analyzers/logger_analyzer_spec.rb +++ b/spec/lib/gitlab/graphql/query_analyzers/logger_analyzer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::QueryAnalyzers::LoggerAnalyzer do +RSpec.describe Gitlab::Graphql::QueryAnalyzers::LoggerAnalyzer do subject { described_class.new } describe '#analyze?' do diff --git a/spec/lib/gitlab/graphql/representation/submodule_tree_entry_spec.rb b/spec/lib/gitlab/graphql/representation/submodule_tree_entry_spec.rb index ed092a846ae..eb56f1f9671 100644 --- a/spec/lib/gitlab/graphql/representation/submodule_tree_entry_spec.rb +++ b/spec/lib/gitlab/graphql/representation/submodule_tree_entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Representation::SubmoduleTreeEntry do +RSpec.describe Gitlab::Graphql::Representation::SubmoduleTreeEntry do let(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb b/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb index d45e690160c..f4eb7b37774 100644 --- a/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb +++ b/spec/lib/gitlab/graphql/representation/tree_entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Representation::TreeEntry do +RSpec.describe Gitlab::Graphql::Representation::TreeEntry do let(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/graphql/timeout_spec.rb b/spec/lib/gitlab/graphql/timeout_spec.rb index 8e04586d0ec..3669a89ba7c 100644 --- a/spec/lib/gitlab/graphql/timeout_spec.rb +++ b/spec/lib/gitlab/graphql/timeout_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphql::Timeout do +RSpec.describe Gitlab::Graphql::Timeout do it 'inherits from ' do expect(described_class.superclass).to eq GraphQL::Schema::Timeout end diff --git a/spec/lib/gitlab/graphql_logger_spec.rb b/spec/lib/gitlab/graphql_logger_spec.rb index 12cb56c78c1..c92666e0663 100644 --- a/spec/lib/gitlab/graphql_logger_spec.rb +++ b/spec/lib/gitlab/graphql_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GraphqlLogger do +RSpec.describe Gitlab::GraphqlLogger do subject { described_class.new('/dev/null') } let(:now) { Time.now } diff --git a/spec/lib/gitlab/graphs/commits_spec.rb b/spec/lib/gitlab/graphs/commits_spec.rb index f92c7fb11a1..79cec2d8705 100644 --- a/spec/lib/gitlab/graphs/commits_spec.rb +++ b/spec/lib/gitlab/graphs/commits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Graphs::Commits do +RSpec.describe Gitlab::Graphs::Commits do let!(:project) { create(:project, :public) } let!(:commit1) { create(:commit, git_commit: RepoHelpers.sample_commit, project: project, committed_date: Time.now) } diff --git a/spec/lib/gitlab/group_search_results_spec.rb b/spec/lib/gitlab/group_search_results_spec.rb index 746f505c877..b6a3c8b5e76 100644 --- a/spec/lib/gitlab/group_search_results_spec.rb +++ b/spec/lib/gitlab/group_search_results_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::GroupSearchResults do +RSpec.describe Gitlab::GroupSearchResults do let(:user) { create(:user) } describe 'user search' do diff --git a/spec/lib/gitlab/hashed_storage/migrator_spec.rb b/spec/lib/gitlab/hashed_storage/migrator_spec.rb index c59b152a982..0549b3128c7 100644 --- a/spec/lib/gitlab/hashed_storage/migrator_spec.rb +++ b/spec/lib/gitlab/hashed_storage/migrator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HashedStorage::Migrator, :redis do +RSpec.describe Gitlab::HashedStorage::Migrator, :redis do describe '#bulk_schedule_migration' do it 'schedules job to HashedStorage::MigratorWorker' do Sidekiq::Testing.fake! do diff --git a/spec/lib/gitlab/health_checks/db_check_spec.rb b/spec/lib/gitlab/health_checks/db_check_spec.rb index 3c1c1e3818d..60ebc596a0f 100644 --- a/spec/lib/gitlab/health_checks/db_check_spec.rb +++ b/spec/lib/gitlab/health_checks/db_check_spec.rb @@ -3,6 +3,6 @@ require 'spec_helper' require_relative './simple_check_shared' -describe Gitlab::HealthChecks::DbCheck do +RSpec.describe Gitlab::HealthChecks::DbCheck do include_examples 'simple_check', 'db_ping', 'Db', '1' end diff --git a/spec/lib/gitlab/health_checks/gitaly_check_spec.rb b/spec/lib/gitlab/health_checks/gitaly_check_spec.rb index d4ce16ce6fc..7c346e3eb69 100644 --- a/spec/lib/gitlab/health_checks/gitaly_check_spec.rb +++ b/spec/lib/gitlab/health_checks/gitaly_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HealthChecks::GitalyCheck do +RSpec.describe Gitlab::HealthChecks::GitalyCheck do let(:result_class) { Gitlab::HealthChecks::Result } let(:repository_storages) { ['default'] } diff --git a/spec/lib/gitlab/health_checks/master_check_spec.rb b/spec/lib/gitlab/health_checks/master_check_spec.rb index dcfc733d5ad..1c1efe178e2 100644 --- a/spec/lib/gitlab/health_checks/master_check_spec.rb +++ b/spec/lib/gitlab/health_checks/master_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative './simple_check_shared' -describe Gitlab::HealthChecks::MasterCheck do +RSpec.describe Gitlab::HealthChecks::MasterCheck do let(:result_class) { Gitlab::HealthChecks::Result } before do diff --git a/spec/lib/gitlab/health_checks/probes/collection_spec.rb b/spec/lib/gitlab/health_checks/probes/collection_spec.rb index d8c411fa27b..3371f3986b6 100644 --- a/spec/lib/gitlab/health_checks/probes/collection_spec.rb +++ b/spec/lib/gitlab/health_checks/probes/collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HealthChecks::Probes::Collection do +RSpec.describe Gitlab::HealthChecks::Probes::Collection do let(:readiness) { described_class.new(*checks) } describe '#execute' do diff --git a/spec/lib/gitlab/health_checks/puma_check_spec.rb b/spec/lib/gitlab/health_checks/puma_check_spec.rb index 93ef81978a8..0bd0965518f 100644 --- a/spec/lib/gitlab/health_checks/puma_check_spec.rb +++ b/spec/lib/gitlab/health_checks/puma_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HealthChecks::PumaCheck do +RSpec.describe Gitlab::HealthChecks::PumaCheck do let(:result_class) { Gitlab::HealthChecks::Result } let(:readiness) { described_class.readiness } let(:metrics) { described_class.metrics } diff --git a/spec/lib/gitlab/health_checks/redis/cache_check_spec.rb b/spec/lib/gitlab/health_checks/redis/cache_check_spec.rb index aaf474d7eeb..c44bd2ed585 100644 --- a/spec/lib/gitlab/health_checks/redis/cache_check_spec.rb +++ b/spec/lib/gitlab/health_checks/redis/cache_check_spec.rb @@ -3,6 +3,6 @@ require 'spec_helper' require_relative '../simple_check_shared' -describe Gitlab::HealthChecks::Redis::CacheCheck do +RSpec.describe Gitlab::HealthChecks::Redis::CacheCheck do include_examples 'simple_check', 'redis_cache_ping', 'RedisCache', 'PONG' end diff --git a/spec/lib/gitlab/health_checks/redis/queues_check_spec.rb b/spec/lib/gitlab/health_checks/redis/queues_check_spec.rb index f4b5e18da2a..3882e7db9d9 100644 --- a/spec/lib/gitlab/health_checks/redis/queues_check_spec.rb +++ b/spec/lib/gitlab/health_checks/redis/queues_check_spec.rb @@ -3,6 +3,6 @@ require 'spec_helper' require_relative '../simple_check_shared' -describe Gitlab::HealthChecks::Redis::QueuesCheck do +RSpec.describe Gitlab::HealthChecks::Redis::QueuesCheck do include_examples 'simple_check', 'redis_queues_ping', 'RedisQueues', 'PONG' end diff --git a/spec/lib/gitlab/health_checks/redis/redis_check_spec.rb b/spec/lib/gitlab/health_checks/redis/redis_check_spec.rb index ae7ee0d0859..43e890a6c4f 100644 --- a/spec/lib/gitlab/health_checks/redis/redis_check_spec.rb +++ b/spec/lib/gitlab/health_checks/redis/redis_check_spec.rb @@ -3,6 +3,6 @@ require 'spec_helper' require_relative '../simple_check_shared' -describe Gitlab::HealthChecks::Redis::RedisCheck do +RSpec.describe Gitlab::HealthChecks::Redis::RedisCheck do include_examples 'simple_check', 'redis_ping', 'Redis', 'PONG' end diff --git a/spec/lib/gitlab/health_checks/redis/shared_state_check_spec.rb b/spec/lib/gitlab/health_checks/redis/shared_state_check_spec.rb index 3e92b072254..25917741a1c 100644 --- a/spec/lib/gitlab/health_checks/redis/shared_state_check_spec.rb +++ b/spec/lib/gitlab/health_checks/redis/shared_state_check_spec.rb @@ -3,6 +3,6 @@ require 'spec_helper' require_relative '../simple_check_shared' -describe Gitlab::HealthChecks::Redis::SharedStateCheck do +RSpec.describe Gitlab::HealthChecks::Redis::SharedStateCheck do include_examples 'simple_check', 'redis_shared_state_ping', 'RedisSharedState', 'PONG' end diff --git a/spec/lib/gitlab/health_checks/simple_check_shared.rb b/spec/lib/gitlab/health_checks/simple_check_shared.rb index 3d0f9b3cf7a..591a11d5ab6 100644 --- a/spec/lib/gitlab/health_checks/simple_check_shared.rb +++ b/spec/lib/gitlab/health_checks/simple_check_shared.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -shared_context 'simple_check' do |metrics_prefix, check_name, success_result| +RSpec.shared_context 'simple_check' do |metrics_prefix, check_name, success_result| describe '#metrics' do subject { described_class.metrics } diff --git a/spec/lib/gitlab/health_checks/unicorn_check_spec.rb b/spec/lib/gitlab/health_checks/unicorn_check_spec.rb index 7c57b6f1ca5..1cc44016002 100644 --- a/spec/lib/gitlab/health_checks/unicorn_check_spec.rb +++ b/spec/lib/gitlab/health_checks/unicorn_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HealthChecks::UnicornCheck do +RSpec.describe Gitlab::HealthChecks::UnicornCheck do let(:result_class) { Gitlab::HealthChecks::Result } let(:readiness) { described_class.readiness } let(:metrics) { described_class.metrics } diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb index 2140cbae488..9271b868e36 100644 --- a/spec/lib/gitlab/highlight_spec.rb +++ b/spec/lib/gitlab/highlight_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Highlight do +RSpec.describe Gitlab::Highlight do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/hook_data/base_builder_spec.rb b/spec/lib/gitlab/hook_data/base_builder_spec.rb index 4c3fd854c09..5d9d9fbffe2 100644 --- a/spec/lib/gitlab/hook_data/base_builder_spec.rb +++ b/spec/lib/gitlab/hook_data/base_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HookData::BaseBuilder do +RSpec.describe Gitlab::HookData::BaseBuilder do describe '#absolute_image_urls' do let(:subclass) do Class.new(described_class) do diff --git a/spec/lib/gitlab/hook_data/issuable_builder_spec.rb b/spec/lib/gitlab/hook_data/issuable_builder_spec.rb index afbc48e9ca2..50f3a4776be 100644 --- a/spec/lib/gitlab/hook_data/issuable_builder_spec.rb +++ b/spec/lib/gitlab/hook_data/issuable_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HookData::IssuableBuilder do +RSpec.describe Gitlab::HookData::IssuableBuilder do let_it_be(:user) { create(:user) } # This shared example requires a `builder` and `user` variable diff --git a/spec/lib/gitlab/hook_data/issue_builder_spec.rb b/spec/lib/gitlab/hook_data/issue_builder_spec.rb index 1f681faa8f7..8a2395d70b2 100644 --- a/spec/lib/gitlab/hook_data/issue_builder_spec.rb +++ b/spec/lib/gitlab/hook_data/issue_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HookData::IssueBuilder do +RSpec.describe Gitlab::HookData::IssueBuilder do let_it_be(:label) { create(:label) } let_it_be(:issue) { create(:labeled_issue, labels: [label], project: label.project) } let(:builder) { described_class.new(issue) } diff --git a/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb b/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb index 67fa0a7426a..fede7f273f1 100644 --- a/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb +++ b/spec/lib/gitlab/hook_data/merge_request_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HookData::MergeRequestBuilder do +RSpec.describe Gitlab::HookData::MergeRequestBuilder do let_it_be(:merge_request) { create(:merge_request) } let(:builder) { described_class.new(merge_request) } diff --git a/spec/lib/gitlab/http_connection_adapter_spec.rb b/spec/lib/gitlab/http_connection_adapter_spec.rb index 1532fd1103e..389bc1a85f4 100644 --- a/spec/lib/gitlab/http_connection_adapter_spec.rb +++ b/spec/lib/gitlab/http_connection_adapter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HTTPConnectionAdapter do +RSpec.describe Gitlab::HTTPConnectionAdapter do include StubRequests describe '#connection' do diff --git a/spec/lib/gitlab/http_io_spec.rb b/spec/lib/gitlab/http_io_spec.rb index e53c361e169..5ba0cb5e686 100644 --- a/spec/lib/gitlab/http_io_spec.rb +++ b/spec/lib/gitlab/http_io_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HttpIO do +RSpec.describe Gitlab::HttpIO do include HttpIOHelpers let(:http_io) { described_class.new(url, size) } diff --git a/spec/lib/gitlab/http_spec.rb b/spec/lib/gitlab/http_spec.rb index 85cfc8e2852..09da94e7559 100644 --- a/spec/lib/gitlab/http_spec.rb +++ b/spec/lib/gitlab/http_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::HTTP do +RSpec.describe Gitlab::HTTP do include StubRequests context 'when allow_local_requests' do diff --git a/spec/lib/gitlab/i18n/metadata_entry_spec.rb b/spec/lib/gitlab/i18n/metadata_entry_spec.rb index 2d8bb538681..2f8816e62cc 100644 --- a/spec/lib/gitlab/i18n/metadata_entry_spec.rb +++ b/spec/lib/gitlab/i18n/metadata_entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::I18n::MetadataEntry do +RSpec.describe Gitlab::I18n::MetadataEntry do describe '#expected_forms' do it 'returns the number of plurals' do data = { diff --git a/spec/lib/gitlab/i18n/po_linter_spec.rb b/spec/lib/gitlab/i18n/po_linter_spec.rb index 2ab363ee45c..5dfc9d3613c 100644 --- a/spec/lib/gitlab/i18n/po_linter_spec.rb +++ b/spec/lib/gitlab/i18n/po_linter_spec.rb @@ -5,7 +5,7 @@ require 'simple_po_parser' # Disabling this cop to allow for multi-language examples in comments # rubocop:disable Style/AsciiComments -describe Gitlab::I18n::PoLinter do +RSpec.describe Gitlab::I18n::PoLinter do let(:linter) { described_class.new(po_path) } let(:po_path) { 'spec/fixtures/valid.po' } diff --git a/spec/lib/gitlab/i18n/translation_entry_spec.rb b/spec/lib/gitlab/i18n/translation_entry_spec.rb index 880da38052e..76879f75bec 100644 --- a/spec/lib/gitlab/i18n/translation_entry_spec.rb +++ b/spec/lib/gitlab/i18n/translation_entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::I18n::TranslationEntry do +RSpec.describe Gitlab::I18n::TranslationEntry do describe '#singular_translation' do it 'returns the normal `msgstr` for translations without plural' do data = { msgid: 'Hello world', msgstr: 'Bonjour monde' } diff --git a/spec/lib/gitlab/i18n_spec.rb b/spec/lib/gitlab/i18n_spec.rb index 2664423af88..592adadc362 100644 --- a/spec/lib/gitlab/i18n_spec.rb +++ b/spec/lib/gitlab/i18n_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::I18n do +RSpec.describe Gitlab::I18n do let(:user) { create(:user, preferred_language: 'es') } describe '.locale=' do diff --git a/spec/lib/gitlab/identifier_spec.rb b/spec/lib/gitlab/identifier_spec.rb index 9c7972d4bde..cc8d68e5c18 100644 --- a/spec/lib/gitlab/identifier_spec.rb +++ b/spec/lib/gitlab/identifier_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Identifier do +RSpec.describe Gitlab::Identifier do let(:identifier) do Class.new { include Gitlab::Identifier }.new end diff --git a/spec/lib/gitlab/import/database_helpers_spec.rb b/spec/lib/gitlab/import/database_helpers_spec.rb index 3ac34455177..d56e05df5d7 100644 --- a/spec/lib/gitlab/import/database_helpers_spec.rb +++ b/spec/lib/gitlab/import/database_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Import::DatabaseHelpers do +RSpec.describe Gitlab::Import::DatabaseHelpers do let(:database_helper) do Class.new do include Gitlab::Import::DatabaseHelpers diff --git a/spec/lib/gitlab/import/merge_request_creator_spec.rb b/spec/lib/gitlab/import/merge_request_creator_spec.rb index 48a57f9b251..9aedca40f1b 100644 --- a/spec/lib/gitlab/import/merge_request_creator_spec.rb +++ b/spec/lib/gitlab/import/merge_request_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Import::MergeRequestCreator do +RSpec.describe Gitlab::Import::MergeRequestCreator do let(:project) { create(:project, :repository) } subject { described_class.new(project) } diff --git a/spec/lib/gitlab/import/merge_request_helpers_spec.rb b/spec/lib/gitlab/import/merge_request_helpers_spec.rb index d81251c4a43..f858ab934bb 100644 --- a/spec/lib/gitlab/import/merge_request_helpers_spec.rb +++ b/spec/lib/gitlab/import/merge_request_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Import::MergeRequestHelpers, type: :helper do +RSpec.describe Gitlab::Import::MergeRequestHelpers, type: :helper do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user) } diff --git a/spec/lib/gitlab/import/metrics_spec.rb b/spec/lib/gitlab/import/metrics_spec.rb index 89ea4db5c6e..0a912427014 100644 --- a/spec/lib/gitlab/import/metrics_spec.rb +++ b/spec/lib/gitlab/import/metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Import::Metrics do +RSpec.describe Gitlab::Import::Metrics do let(:importer) { :test_importer } let(:project) { create(:project) } let(:histogram) { double(:histogram) } diff --git a/spec/lib/gitlab/import/set_async_jid_spec.rb b/spec/lib/gitlab/import/set_async_jid_spec.rb index d2933cfd371..6931a7a953d 100644 --- a/spec/lib/gitlab/import/set_async_jid_spec.rb +++ b/spec/lib/gitlab/import/set_async_jid_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Import::SetAsyncJid do +RSpec.describe Gitlab::Import::SetAsyncJid do describe '.set_jid', :clean_gitlab_redis_shared_state do let(:project) { create(:project, :import_scheduled) } diff --git a/spec/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy_spec.rb b/spec/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy_spec.rb index 1631de393b5..fc794f11499 100644 --- a/spec/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy_spec.rb +++ b/spec/lib/gitlab/import_export/after_export_strategies/base_after_export_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AfterExportStrategies::BaseAfterExportStrategy do +RSpec.describe Gitlab::ImportExport::AfterExportStrategies::BaseAfterExportStrategy do before do allow_next_instance_of(ProjectExportWorker) do |job| allow(job).to receive(:jid).and_return(SecureRandom.hex(8)) diff --git a/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb b/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb index 7792daed99c..38f1d48798b 100644 --- a/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb +++ b/spec/lib/gitlab/import_export/after_export_strategies/web_upload_strategy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do +RSpec.describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do include StubRequests before do diff --git a/spec/lib/gitlab/import_export/after_export_strategy_builder_spec.rb b/spec/lib/gitlab/import_export/after_export_strategy_builder_spec.rb index 9fe9e2eb73d..91a3dce0b4e 100644 --- a/spec/lib/gitlab/import_export/after_export_strategy_builder_spec.rb +++ b/spec/lib/gitlab/import_export/after_export_strategy_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AfterExportStrategyBuilder do +RSpec.describe Gitlab::ImportExport::AfterExportStrategyBuilder do let!(:strategies_namespace) { 'Gitlab::ImportExport::AfterExportStrategies' } describe '.build!' do diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index 1fe4be28d1a..6635d27deb6 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -469,6 +469,7 @@ project: - prometheus_alert_events - self_managed_prometheus_alert_events - software_license_policies +- software_licenses - project_registry - packages - package_files diff --git a/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb b/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb index 65e99c0c3b8..733be7fc226 100644 --- a/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb +++ b/spec/lib/gitlab/import_export/attribute_cleaner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AttributeCleaner do +RSpec.describe Gitlab::ImportExport::AttributeCleaner do let(:relation_class) { double('relation_class').as_null_object } let(:unsafe_hash) do { diff --git a/spec/lib/gitlab/import_export/attribute_configuration_spec.rb b/spec/lib/gitlab/import_export/attribute_configuration_spec.rb index f97dafc6bf9..0581f07dd3f 100644 --- a/spec/lib/gitlab/import_export/attribute_configuration_spec.rb +++ b/spec/lib/gitlab/import_export/attribute_configuration_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' # to be included as part of the export, or blacklist them using the import_export.yml configuration file. # Likewise, new models added to import_export.yml, will need to be added with their correspondent attributes # to this spec. -describe 'Import/Export attribute configuration' do +RSpec.describe 'Import/Export attribute configuration' do include ConfigurationHelper let(:safe_attributes_file) { 'spec/lib/gitlab/import_export/safe_model_attributes.yml' } diff --git a/spec/lib/gitlab/import_export/attributes_finder_spec.rb b/spec/lib/gitlab/import_export/attributes_finder_spec.rb index 3cbc1375d6e..7f6ebf577af 100644 --- a/spec/lib/gitlab/import_export/attributes_finder_spec.rb +++ b/spec/lib/gitlab/import_export/attributes_finder_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::ImportExport::AttributesFinder do +RSpec.describe Gitlab::ImportExport::AttributesFinder do describe '#find_root' do subject { described_class.new(config: config).find_root(model_key) } diff --git a/spec/lib/gitlab/import_export/attributes_permitter_spec.rb b/spec/lib/gitlab/import_export/attributes_permitter_spec.rb index d6217811b9c..0c1b1cd74bf 100644 --- a/spec/lib/gitlab/import_export/attributes_permitter_spec.rb +++ b/spec/lib/gitlab/import_export/attributes_permitter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AttributesPermitter do +RSpec.describe Gitlab::ImportExport::AttributesPermitter do let(:yml_config) do <<-EOF tree: diff --git a/spec/lib/gitlab/import_export/avatar_restorer_spec.rb b/spec/lib/gitlab/import_export/avatar_restorer_spec.rb index 662e1a5eaab..994132239b9 100644 --- a/spec/lib/gitlab/import_export/avatar_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/avatar_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AvatarRestorer do +RSpec.describe Gitlab::ImportExport::AvatarRestorer do include UploadHelpers let(:shared) { project.import_export_shared } diff --git a/spec/lib/gitlab/import_export/avatar_saver_spec.rb b/spec/lib/gitlab/import_export/avatar_saver_spec.rb index d2349e47c0a..334d930c47c 100644 --- a/spec/lib/gitlab/import_export/avatar_saver_spec.rb +++ b/spec/lib/gitlab/import_export/avatar_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::AvatarSaver do +RSpec.describe Gitlab::ImportExport::AvatarSaver do let(:shared) { project.import_export_shared } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:project_with_avatar) { create(:project, avatar: fixture_file_upload("spec/fixtures/dk.png", "image/png")) } diff --git a/spec/lib/gitlab/import_export/base/object_builder_spec.rb b/spec/lib/gitlab/import_export/base/object_builder_spec.rb index e5242ae0bfc..d560c8ea5a7 100644 --- a/spec/lib/gitlab/import_export/base/object_builder_spec.rb +++ b/spec/lib/gitlab/import_export/base/object_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Base::ObjectBuilder do +RSpec.describe Gitlab::ImportExport::Base::ObjectBuilder do let(:project) do create(:project, :repository, :builds_disabled, diff --git a/spec/lib/gitlab/import_export/base/relation_factory_spec.rb b/spec/lib/gitlab/import_export/base/relation_factory_spec.rb index 50d93763ad6..09e6e5a03bb 100644 --- a/spec/lib/gitlab/import_export/base/relation_factory_spec.rb +++ b/spec/lib/gitlab/import_export/base/relation_factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Base::RelationFactory do +RSpec.describe Gitlab::ImportExport::Base::RelationFactory do let(:user) { create(:admin) } let(:project) { create(:project) } let(:members_mapper) { double('members_mapper').as_null_object } diff --git a/spec/lib/gitlab/import_export/command_line_util_spec.rb b/spec/lib/gitlab/import_export/command_line_util_spec.rb index 8e5e0aefac0..b00a2597681 100644 --- a/spec/lib/gitlab/import_export/command_line_util_spec.rb +++ b/spec/lib/gitlab/import_export/command_line_util_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::CommandLineUtil do +RSpec.describe Gitlab::ImportExport::CommandLineUtil do include ExportFileHelper let(:path) { "#{Dir.tmpdir}/symlink_test" } diff --git a/spec/lib/gitlab/import_export/config_spec.rb b/spec/lib/gitlab/import_export/config_spec.rb index f09a29b84db..40cf75779b6 100644 --- a/spec/lib/gitlab/import_export/config_spec.rb +++ b/spec/lib/gitlab/import_export/config_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'rspec-parameterized' -describe Gitlab::ImportExport::Config do +RSpec.describe Gitlab::ImportExport::Config do let(:yaml_file) { described_class.new } describe '#to_h' do diff --git a/spec/lib/gitlab/import_export/design_repo_restorer_spec.rb b/spec/lib/gitlab/import_export/design_repo_restorer_spec.rb index 5662b8af280..b311a02833c 100644 --- a/spec/lib/gitlab/import_export/design_repo_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/design_repo_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::DesignRepoRestorer do +RSpec.describe Gitlab::ImportExport::DesignRepoRestorer do include GitHelpers describe 'bundle a design Git repo' do diff --git a/spec/lib/gitlab/import_export/design_repo_saver_spec.rb b/spec/lib/gitlab/import_export/design_repo_saver_spec.rb index bff48e8b52a..2575d209db5 100644 --- a/spec/lib/gitlab/import_export/design_repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/design_repo_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::DesignRepoSaver do +RSpec.describe Gitlab::ImportExport::DesignRepoSaver do describe 'bundle a design Git repo' do let_it_be(:user) { create(:user) } let_it_be(:design) { create(:design, :with_file, versions_count: 1) } diff --git a/spec/lib/gitlab/import_export/error_spec.rb b/spec/lib/gitlab/import_export/error_spec.rb index 067f7049097..015133a399b 100644 --- a/spec/lib/gitlab/import_export/error_spec.rb +++ b/spec/lib/gitlab/import_export/error_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Error do +RSpec.describe Gitlab::ImportExport::Error do describe '.permission_error' do subject(:error) do described_class.permission_error(user, importable) diff --git a/spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb b/spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb index 916ed692a05..8e048d877a1 100644 --- a/spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb +++ b/spec/lib/gitlab/import_export/fast_hash_serializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::FastHashSerializer do +RSpec.describe Gitlab::ImportExport::FastHashSerializer do # FastHashSerializer#execute generates the hash which is not easily accessible # and includes `JSONBatchRelation` items which are serialized at this point. # Wrapping the result into JSON generating/parsing is for making diff --git a/spec/lib/gitlab/import_export/file_importer_spec.rb b/spec/lib/gitlab/import_export/file_importer_spec.rb index 7c54c5f2da1..47485cc7edb 100644 --- a/spec/lib/gitlab/import_export/file_importer_spec.rb +++ b/spec/lib/gitlab/import_export/file_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::FileImporter do +RSpec.describe Gitlab::ImportExport::FileImporter do include ExportFileHelper let(:shared) { Gitlab::ImportExport::Shared.new(nil) } diff --git a/spec/lib/gitlab/import_export/fork_spec.rb b/spec/lib/gitlab/import_export/fork_spec.rb index bb79331efac..ef7394053b9 100644 --- a/spec/lib/gitlab/import_export/fork_spec.rb +++ b/spec/lib/gitlab/import_export/fork_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'forked project import' do +RSpec.describe 'forked project import' do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/lib/gitlab/import_export/group/legacy_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/group/legacy_tree_restorer_spec.rb index 4c926da1436..bfcd4994995 100644 --- a/spec/lib/gitlab/import_export/group/legacy_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/group/legacy_tree_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Group::LegacyTreeRestorer do +RSpec.describe Gitlab::ImportExport::Group::LegacyTreeRestorer do include ImportExport::CommonUtil let(:shared) { Gitlab::ImportExport::Shared.new(group) } diff --git a/spec/lib/gitlab/import_export/group/legacy_tree_saver_spec.rb b/spec/lib/gitlab/import_export/group/legacy_tree_saver_spec.rb index a0490c255aa..6b324b952dc 100644 --- a/spec/lib/gitlab/import_export/group/legacy_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/group/legacy_tree_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Group::LegacyTreeSaver do +RSpec.describe Gitlab::ImportExport::Group::LegacyTreeSaver do describe 'saves the group tree into a json object' do let(:shared) { Gitlab::ImportExport::Shared.new(group) } let(:group_tree_saver) { described_class.new(group: group, current_user: user, shared: shared) } diff --git a/spec/lib/gitlab/import_export/group/object_builder_spec.rb b/spec/lib/gitlab/import_export/group/object_builder_spec.rb index 781670b0aa5..028bd5463a1 100644 --- a/spec/lib/gitlab/import_export/group/object_builder_spec.rb +++ b/spec/lib/gitlab/import_export/group/object_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Group::ObjectBuilder do +RSpec.describe Gitlab::ImportExport::Group::ObjectBuilder do let(:group) { create(:group) } let(:base_attributes) do { diff --git a/spec/lib/gitlab/import_export/group/relation_factory_spec.rb b/spec/lib/gitlab/import_export/group/relation_factory_spec.rb index 332648d5c89..eb9a3fa9bd8 100644 --- a/spec/lib/gitlab/import_export/group/relation_factory_spec.rb +++ b/spec/lib/gitlab/import_export/group/relation_factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Group::RelationFactory do +RSpec.describe Gitlab::ImportExport::Group::RelationFactory do let(:group) { create(:group) } let(:members_mapper) { double('members_mapper').as_null_object } let(:user) { create(:admin) } diff --git a/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb b/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb index 327f36c664e..6cc16ee9cbb 100644 --- a/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/group/tree_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Group::TreeRestorer do +RSpec.describe Gitlab::ImportExport::Group::TreeRestorer do include ImportExport::CommonUtil describe 'restore group tree' do diff --git a/spec/lib/gitlab/import_export/group/tree_saver_spec.rb b/spec/lib/gitlab/import_export/group/tree_saver_spec.rb index 06e8484a3cb..908896e4891 100644 --- a/spec/lib/gitlab/import_export/group/tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/group/tree_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Group::TreeSaver do +RSpec.describe Gitlab::ImportExport::Group::TreeSaver do describe 'saves the group tree into a json object' do let_it_be(:user) { create(:user) } let_it_be(:group) { setup_groups } diff --git a/spec/lib/gitlab/import_export/hash_util_spec.rb b/spec/lib/gitlab/import_export/hash_util_spec.rb index b97c6665d0e..467342e6e96 100644 --- a/spec/lib/gitlab/import_export/hash_util_spec.rb +++ b/spec/lib/gitlab/import_export/hash_util_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::HashUtil do +RSpec.describe Gitlab::ImportExport::HashUtil do let(:stringified_array) { [{ 'test' => 1 }] } let(:stringified_array_with_date) { [{ 'test_date' => '2016-04-06 06:17:44 +0200' }] } diff --git a/spec/lib/gitlab/import_export/import_export_equivalence_spec.rb b/spec/lib/gitlab/import_export/import_export_equivalence_spec.rb index 95df9cd0e6e..18f2e8f80d7 100644 --- a/spec/lib/gitlab/import_export/import_export_equivalence_spec.rb +++ b/spec/lib/gitlab/import_export/import_export_equivalence_spec.rb @@ -13,7 +13,7 @@ require 'spec_helper' # - randomly generated fields like tokens # # as these are expected to change between import/export cycles. -describe Gitlab::ImportExport do +RSpec.describe Gitlab::ImportExport do include ImportExport::CommonUtil include ConfigurationHelper include ImportExport::ProjectTreeExpectations diff --git a/spec/lib/gitlab/import_export/import_export_spec.rb b/spec/lib/gitlab/import_export/import_export_spec.rb index 300ba66ee5b..62b4717fc96 100644 --- a/spec/lib/gitlab/import_export/import_export_spec.rb +++ b/spec/lib/gitlab/import_export/import_export_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport do +RSpec.describe Gitlab::ImportExport do describe 'export filename' do let(:group) { create(:group, :nested) } let(:project) { create(:project, :public, path: 'project-path', namespace: group) } diff --git a/spec/lib/gitlab/import_export/import_failure_service_spec.rb b/spec/lib/gitlab/import_export/import_failure_service_spec.rb index 324328181e4..c8bb067d40c 100644 --- a/spec/lib/gitlab/import_export/import_failure_service_spec.rb +++ b/spec/lib/gitlab/import_export/import_failure_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::ImportFailureService do +RSpec.describe Gitlab::ImportExport::ImportFailureService do let(:importable) { create(:project, :builds_enabled, :issues_disabled, name: 'project', path: 'project') } let(:label) { create(:label) } let(:subject) { described_class.new(importable) } diff --git a/spec/lib/gitlab/import_export/import_test_coverage_spec.rb b/spec/lib/gitlab/import_export/import_test_coverage_spec.rb index c5a7327332e..9737a0f39fc 100644 --- a/spec/lib/gitlab/import_export/import_test_coverage_spec.rb +++ b/spec/lib/gitlab/import_export/import_test_coverage_spec.rb @@ -7,7 +7,7 @@ require 'spec_helper' # Fixture JSONs we use for testing Import such as # `spec/fixtures/lib/gitlab/import_export/complex/project.json` # should include these relations being non-empty. -describe 'Test coverage of the Project Import' do +RSpec.describe 'Test coverage of the Project Import' do include ConfigurationHelper # `muted_relations` is a technical debt. diff --git a/spec/lib/gitlab/import_export/importer_spec.rb b/spec/lib/gitlab/import_export/importer_spec.rb index 494f7e3a00d..dc44296321c 100644 --- a/spec/lib/gitlab/import_export/importer_spec.rb +++ b/spec/lib/gitlab/import_export/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Importer do +RSpec.describe Gitlab::ImportExport::Importer do let(:user) { create(:user) } let(:test_path) { "#{Dir.tmpdir}/importer_spec" } let(:shared) { project.import_export_shared } diff --git a/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb b/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb index 99932404fd9..9c7f41cbb89 100644 --- a/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb +++ b/spec/lib/gitlab/import_export/json/legacy_reader/file_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative 'shared_example.rb' -describe Gitlab::ImportExport::JSON::LegacyReader::File do +RSpec.describe Gitlab::ImportExport::JSON::LegacyReader::File do it_behaves_like 'import/export json legacy reader' do let(:valid_path) { 'spec/fixtures/lib/gitlab/import_export/light/project.json' } let(:data) { valid_path } diff --git a/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb b/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb index e793dc7339d..d0899accf59 100644 --- a/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb +++ b/spec/lib/gitlab/import_export/json/legacy_reader/hash_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require_relative 'shared_example.rb' -describe Gitlab::ImportExport::JSON::LegacyReader::Hash do +RSpec.describe Gitlab::ImportExport::JSON::LegacyReader::Hash do it_behaves_like 'import/export json legacy reader' do let(:path) { 'spec/fixtures/lib/gitlab/import_export/light/project.json' } diff --git a/spec/lib/gitlab/import_export/json/legacy_writer_spec.rb b/spec/lib/gitlab/import_export/json/legacy_writer_spec.rb index 1f39b26e46a..eb7a2d4aa8b 100644 --- a/spec/lib/gitlab/import_export/json/legacy_writer_spec.rb +++ b/spec/lib/gitlab/import_export/json/legacy_writer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::JSON::LegacyWriter do +RSpec.describe Gitlab::ImportExport::JSON::LegacyWriter do let(:path) { "#{Dir.tmpdir}/legacy_writer_spec/test.json" } subject do diff --git a/spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb b/spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb index 34e8b1ddd59..a347d835428 100644 --- a/spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb +++ b/spec/lib/gitlab/import_export/json/ndjson_reader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::JSON::NdjsonReader do +RSpec.describe Gitlab::ImportExport::JSON::NdjsonReader do include ImportExport::CommonUtil let(:fixture) { 'spec/fixtures/lib/gitlab/import_export/light/tree' } diff --git a/spec/lib/gitlab/import_export/json/ndjson_writer_spec.rb b/spec/lib/gitlab/import_export/json/ndjson_writer_spec.rb index bae3672474c..0af74dee604 100644 --- a/spec/lib/gitlab/import_export/json/ndjson_writer_spec.rb +++ b/spec/lib/gitlab/import_export/json/ndjson_writer_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::ImportExport::JSON::NdjsonWriter do +RSpec.describe Gitlab::ImportExport::JSON::NdjsonWriter do include ImportExport::CommonUtil let(:path) { "#{Dir.tmpdir}/ndjson_writer_spec/tree" } diff --git a/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb b/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb index 30f8280fda3..0d015f0693c 100644 --- a/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb +++ b/spec/lib/gitlab/import_export/json/streaming_serializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::JSON::StreamingSerializer do +RSpec.describe Gitlab::ImportExport::JSON::StreamingSerializer do let_it_be(:user) { create(:user) } let_it_be(:release) { create(:release) } let_it_be(:group) { create(:group) } diff --git a/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb b/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb index 6562aa5b8a6..454cc74b9d4 100644 --- a/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/legacy_relation_tree_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::LegacyRelationTreeSaver do +RSpec.describe Gitlab::ImportExport::LegacyRelationTreeSaver do let(:exportable) { create(:group) } let(:relation_tree_saver) { described_class.new } let(:tree) { {} } diff --git a/spec/lib/gitlab/import_export/lfs_restorer_spec.rb b/spec/lib/gitlab/import_export/lfs_restorer_spec.rb index a932dc3ee4e..a9f7fb72612 100644 --- a/spec/lib/gitlab/import_export/lfs_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/lfs_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::LfsRestorer do +RSpec.describe Gitlab::ImportExport::LfsRestorer do include UploadHelpers let(:export_path) { "#{Dir.tmpdir}/lfs_object_restorer_spec" } diff --git a/spec/lib/gitlab/import_export/lfs_saver_spec.rb b/spec/lib/gitlab/import_export/lfs_saver_spec.rb index e9d06573e70..db76eb9538b 100644 --- a/spec/lib/gitlab/import_export/lfs_saver_spec.rb +++ b/spec/lib/gitlab/import_export/lfs_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::LfsSaver do +RSpec.describe Gitlab::ImportExport::LfsSaver do let(:shared) { project.import_export_shared } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:project) { create(:project) } diff --git a/spec/lib/gitlab/import_export/members_mapper_spec.rb b/spec/lib/gitlab/import_export/members_mapper_spec.rb index 61e893bfb3c..9755e322221 100644 --- a/spec/lib/gitlab/import_export/members_mapper_spec.rb +++ b/spec/lib/gitlab/import_export/members_mapper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::MembersMapper do +RSpec.describe Gitlab::ImportExport::MembersMapper do describe 'map members' do shared_examples 'imports exported members' do let(:user) { create(:admin) } diff --git a/spec/lib/gitlab/import_export/merge_request_parser_spec.rb b/spec/lib/gitlab/import_export/merge_request_parser_spec.rb index 0cdb3c43992..c558c12f581 100644 --- a/spec/lib/gitlab/import_export/merge_request_parser_spec.rb +++ b/spec/lib/gitlab/import_export/merge_request_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::MergeRequestParser do +RSpec.describe Gitlab::ImportExport::MergeRequestParser do include ProjectForksHelper let(:user) { create(:user) } diff --git a/spec/lib/gitlab/import_export/model_configuration_spec.rb b/spec/lib/gitlab/import_export/model_configuration_spec.rb index cfbfe244988..34591122a97 100644 --- a/spec/lib/gitlab/import_export/model_configuration_spec.rb +++ b/spec/lib/gitlab/import_export/model_configuration_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' # Part of the test security suite for the Import/Export feature # Finds if a new model has been added that can potentially be part of the Import/Export # If it finds a new model, it will show a +failure_message+ with the options available. -describe 'Import/Export model configuration' do +RSpec.describe 'Import/Export model configuration' do include ConfigurationHelper let(:all_models_yml) { 'spec/lib/gitlab/import_export/all_models.yml' } diff --git a/spec/lib/gitlab/import_export/project/export_task_spec.rb b/spec/lib/gitlab/import_export/project/export_task_spec.rb index dc8eb54dc14..1048379a5d6 100644 --- a/spec/lib/gitlab/import_export/project/export_task_spec.rb +++ b/spec/lib/gitlab/import_export/project/export_task_spec.rb @@ -2,7 +2,7 @@ require 'rake_helper' -describe Gitlab::ImportExport::Project::ExportTask do +RSpec.describe Gitlab::ImportExport::Project::ExportTask do let_it_be(:username) { 'root' } let(:namespace_path) { username } let_it_be(:user) { create(:user, username: username) } diff --git a/spec/lib/gitlab/import_export/project/import_task_spec.rb b/spec/lib/gitlab/import_export/project/import_task_spec.rb index 7c11161aaa7..90f4501acdc 100644 --- a/spec/lib/gitlab/import_export/project/import_task_spec.rb +++ b/spec/lib/gitlab/import_export/project/import_task_spec.rb @@ -2,7 +2,7 @@ require 'rake_helper' -describe Gitlab::ImportExport::Project::ImportTask, :request_store do +RSpec.describe Gitlab::ImportExport::Project::ImportTask, :request_store do let(:username) { 'root' } let(:namespace_path) { username } let!(:user) { create(:user, username: username) } diff --git a/spec/lib/gitlab/import_export/project/object_builder_spec.rb b/spec/lib/gitlab/import_export/project/object_builder_spec.rb index c9d1410400a..20d882c82be 100644 --- a/spec/lib/gitlab/import_export/project/object_builder_spec.rb +++ b/spec/lib/gitlab/import_export/project/object_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Project::ObjectBuilder do +RSpec.describe Gitlab::ImportExport::Project::ObjectBuilder do let!(:group) { create(:group, :private) } let!(:subgroup) { create(:group, :private, parent: group) } let!(:project) do diff --git a/spec/lib/gitlab/import_export/project/relation_factory_spec.rb b/spec/lib/gitlab/import_export/project/relation_factory_spec.rb index 3339129cb8f..31cf2362628 100644 --- a/spec/lib/gitlab/import_export/project/relation_factory_spec.rb +++ b/spec/lib/gitlab/import_export/project/relation_factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Project::RelationFactory do +RSpec.describe Gitlab::ImportExport::Project::RelationFactory do let(:group) { create(:group) } let(:project) { create(:project, :repository, group: group) } let(:members_mapper) { double('members_mapper').as_null_object } diff --git a/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb index 867dc37c5c5..e43686e632a 100644 --- a/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/project/tree_restorer_spec.rb @@ -6,7 +6,7 @@ def match_mr1_note(content_regex) MergeRequest.find_by(title: 'MR1').notes.select { |n| n.note.match(/#{content_regex}/)}.first end -describe Gitlab::ImportExport::Project::TreeRestorer do +RSpec.describe Gitlab::ImportExport::Project::TreeRestorer do include ImportExport::CommonUtil using RSpec::Parameterized::TableSyntax diff --git a/spec/lib/gitlab/import_export/project/tree_saver_spec.rb b/spec/lib/gitlab/import_export/project/tree_saver_spec.rb index 533d1097928..4f6bc19ebd1 100644 --- a/spec/lib/gitlab/import_export/project/tree_saver_spec.rb +++ b/spec/lib/gitlab/import_export/project/tree_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Project::TreeSaver do +RSpec.describe Gitlab::ImportExport::Project::TreeSaver do let_it_be(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let_it_be(:exportable_path) { 'project' } diff --git a/spec/lib/gitlab/import_export/reader_spec.rb b/spec/lib/gitlab/import_export/reader_spec.rb index e37ad281eb5..8828c7ceb62 100644 --- a/spec/lib/gitlab/import_export/reader_spec.rb +++ b/spec/lib/gitlab/import_export/reader_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::Reader do +RSpec.describe Gitlab::ImportExport::Reader do let(:shared) { Gitlab::ImportExport::Shared.new(nil) } describe '#project_tree' do diff --git a/spec/lib/gitlab/import_export/references_configuration_spec.rb b/spec/lib/gitlab/import_export/references_configuration_spec.rb index 91cf9f964c0..2934d0059ee 100644 --- a/spec/lib/gitlab/import_export/references_configuration_spec.rb +++ b/spec/lib/gitlab/import_export/references_configuration_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' # or to be blacklisted by using the import_export.yml configuration file. # Likewise, new models added to import_export.yml, will need to be added with their correspondent relations # to this spec. -describe 'Import/Export Project configuration' do +RSpec.describe 'Import/Export Project configuration' do include ConfigurationHelper where(:relation_path, :relation_name) do diff --git a/spec/lib/gitlab/import_export/relation_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/relation_tree_restorer_spec.rb index 8fe419da450..ddc96b83208 100644 --- a/spec/lib/gitlab/import_export/relation_tree_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/relation_tree_restorer_spec.rb @@ -9,7 +9,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::RelationTreeRestorer do +RSpec.describe Gitlab::ImportExport::RelationTreeRestorer do include ImportExport::CommonUtil let(:user) { create(:user) } diff --git a/spec/lib/gitlab/import_export/repo_restorer_spec.rb b/spec/lib/gitlab/import_export/repo_restorer_spec.rb index d5839589633..ace4449042e 100644 --- a/spec/lib/gitlab/import_export/repo_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/repo_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::RepoRestorer do +RSpec.describe Gitlab::ImportExport::RepoRestorer do include GitHelpers describe 'bundle a project Git repo' do diff --git a/spec/lib/gitlab/import_export/repo_saver_spec.rb b/spec/lib/gitlab/import_export/repo_saver_spec.rb index a95d661ec3c..73d51000c67 100644 --- a/spec/lib/gitlab/import_export/repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/repo_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::RepoSaver do +RSpec.describe Gitlab::ImportExport::RepoSaver do describe 'bundle a project Git repo' do let_it_be(:user) { create(:user) } let!(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/import_export/saver_spec.rb b/spec/lib/gitlab/import_export/saver_spec.rb index 18e9d7da32d..865c7e57b5a 100644 --- a/spec/lib/gitlab/import_export/saver_spec.rb +++ b/spec/lib/gitlab/import_export/saver_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'fileutils' -describe Gitlab::ImportExport::Saver do +RSpec.describe Gitlab::ImportExport::Saver do let!(:project) { create(:project, :public, name: 'project') } let(:base_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:export_path) { "#{base_path}/project_tree_saver_spec/export" } diff --git a/spec/lib/gitlab/import_export/shared_spec.rb b/spec/lib/gitlab/import_export/shared_spec.rb index 8c16243576d..22f2d4c5077 100644 --- a/spec/lib/gitlab/import_export/shared_spec.rb +++ b/spec/lib/gitlab/import_export/shared_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'fileutils' -describe Gitlab::ImportExport::Shared do +RSpec.describe Gitlab::ImportExport::Shared do let(:project) { build(:project) } subject { project.import_export_shared } diff --git a/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb b/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb index 779b65e33d8..9e6fb478a0c 100644 --- a/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/snippet_repo_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::SnippetRepoRestorer do +RSpec.describe Gitlab::ImportExport::SnippetRepoRestorer do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: user.namespace) } let(:snippet) { create(:project_snippet, project: project, author: user) } diff --git a/spec/lib/gitlab/import_export/snippet_repo_saver_spec.rb b/spec/lib/gitlab/import_export/snippet_repo_saver_spec.rb index 7ad1ff213a1..323ed9a746e 100644 --- a/spec/lib/gitlab/import_export/snippet_repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/snippet_repo_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::SnippetRepoSaver do +RSpec.describe Gitlab::ImportExport::SnippetRepoSaver do describe 'bundle a project Git repo' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, namespace: user.namespace) } diff --git a/spec/lib/gitlab/import_export/snippets_repo_restorer_spec.rb b/spec/lib/gitlab/import_export/snippets_repo_restorer_spec.rb index fdae259c2f1..5283e49cf73 100644 --- a/spec/lib/gitlab/import_export/snippets_repo_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/snippets_repo_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::SnippetsRepoRestorer do +RSpec.describe Gitlab::ImportExport::SnippetsRepoRestorer do include GitHelpers describe 'bundle a snippet Git repo' do diff --git a/spec/lib/gitlab/import_export/snippets_repo_saver_spec.rb b/spec/lib/gitlab/import_export/snippets_repo_saver_spec.rb index 5332990a975..8507c46ec83 100644 --- a/spec/lib/gitlab/import_export/snippets_repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/snippets_repo_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::SnippetsRepoSaver do +RSpec.describe Gitlab::ImportExport::SnippetsRepoSaver do describe 'bundle a project Git repo' do let_it_be(:user) { create(:user) } let!(:project) { create(:project) } diff --git a/spec/lib/gitlab/import_export/uploads_manager_spec.rb b/spec/lib/gitlab/import_export/uploads_manager_spec.rb index e6d6ba840be..33ad0e12c37 100644 --- a/spec/lib/gitlab/import_export/uploads_manager_spec.rb +++ b/spec/lib/gitlab/import_export/uploads_manager_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::UploadsManager do +RSpec.describe Gitlab::ImportExport::UploadsManager do let(:shared) { project.import_export_shared } let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" } let(:project) { create(:project) } diff --git a/spec/lib/gitlab/import_export/uploads_restorer_spec.rb b/spec/lib/gitlab/import_export/uploads_restorer_spec.rb index 077ece87b31..864fd8d72fa 100644 --- a/spec/lib/gitlab/import_export/uploads_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/uploads_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::UploadsRestorer do +RSpec.describe Gitlab::ImportExport::UploadsRestorer do describe 'bundle a project Git repo' do let(:export_path) { "#{Dir.tmpdir}/uploads_saver_spec" } let(:shared) { project.import_export_shared } diff --git a/spec/lib/gitlab/import_export/uploads_saver_spec.rb b/spec/lib/gitlab/import_export/uploads_saver_spec.rb index 8a36caef316..8e9be209f89 100644 --- a/spec/lib/gitlab/import_export/uploads_saver_spec.rb +++ b/spec/lib/gitlab/import_export/uploads_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::UploadsSaver do +RSpec.describe Gitlab::ImportExport::UploadsSaver do describe 'bundle a project Git repo' do let(:export_path) { "#{Dir.tmpdir}/uploads_saver_spec" } let(:file) { fixture_file_upload('spec/fixtures/banana_sample.gif', 'image/gif') } diff --git a/spec/lib/gitlab/import_export/version_checker_spec.rb b/spec/lib/gitlab/import_export/version_checker_spec.rb index befbd1b4c19..8b39330656f 100644 --- a/spec/lib/gitlab/import_export/version_checker_spec.rb +++ b/spec/lib/gitlab/import_export/version_checker_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' include ImportExport::CommonUtil -describe Gitlab::ImportExport::VersionChecker do +RSpec.describe Gitlab::ImportExport::VersionChecker do let!(:shared) { Gitlab::ImportExport::Shared.new(nil) } describe 'bundle a project Git repo' do diff --git a/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb b/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb index 264272d2026..778d0859bf1 100644 --- a/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb +++ b/spec/lib/gitlab/import_export/wiki_repo_saver_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::WikiRepoSaver do +RSpec.describe Gitlab::ImportExport::WikiRepoSaver do describe 'bundle a wiki Git repo' do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :wiki_repo) } diff --git a/spec/lib/gitlab/import_export/wiki_restorer_spec.rb b/spec/lib/gitlab/import_export/wiki_restorer_spec.rb index 33cd3e55393..6c80c410d07 100644 --- a/spec/lib/gitlab/import_export/wiki_restorer_spec.rb +++ b/spec/lib/gitlab/import_export/wiki_restorer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportExport::WikiRestorer do +RSpec.describe Gitlab::ImportExport::WikiRestorer do describe 'restore a wiki Git repo' do let!(:project_with_wiki) { create(:project, :wiki_repo) } let!(:project_without_wiki) { create(:project) } diff --git a/spec/lib/gitlab/import_formatter_spec.rb b/spec/lib/gitlab/import_formatter_spec.rb index e9f63ba5777..fbf00ab92d3 100644 --- a/spec/lib/gitlab/import_formatter_spec.rb +++ b/spec/lib/gitlab/import_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportFormatter do +RSpec.describe Gitlab::ImportFormatter do let(:formatter) { Gitlab::ImportFormatter.new } describe '#comment' do diff --git a/spec/lib/gitlab/import_sources_spec.rb b/spec/lib/gitlab/import_sources_spec.rb index 265241dc2af..0dfd8a2ee50 100644 --- a/spec/lib/gitlab/import_sources_spec.rb +++ b/spec/lib/gitlab/import_sources_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ImportSources do +RSpec.describe Gitlab::ImportSources do describe '.options' do it 'returns a hash' do expected = diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb index 2dd45d18ee9..19d608cf48e 100644 --- a/spec/lib/gitlab/incoming_email_spec.rb +++ b/spec/lib/gitlab/incoming_email_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::IncomingEmail do +RSpec.describe Gitlab::IncomingEmail do describe "self.enabled?" do context "when reply by email is enabled" do before do diff --git a/spec/lib/gitlab/insecure_key_fingerprint_spec.rb b/spec/lib/gitlab/insecure_key_fingerprint_spec.rb index 8d0422bae9f..2f3489edcd8 100644 --- a/spec/lib/gitlab/insecure_key_fingerprint_spec.rb +++ b/spec/lib/gitlab/insecure_key_fingerprint_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::InsecureKeyFingerprint do +RSpec.describe Gitlab::InsecureKeyFingerprint do let(:key) do 'ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn' \ '1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qk' \ diff --git a/spec/lib/gitlab/instrumentation/redis_interceptor_spec.rb b/spec/lib/gitlab/instrumentation/redis_interceptor_spec.rb index 25506d63091..e7e92d74f4b 100644 --- a/spec/lib/gitlab/instrumentation/redis_interceptor_spec.rb +++ b/spec/lib/gitlab/instrumentation/redis_interceptor_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rspec-parameterized' -describe Gitlab::Instrumentation::RedisInterceptor, :clean_gitlab_redis_shared_state, :request_store do +RSpec.describe Gitlab::Instrumentation::RedisInterceptor, :clean_gitlab_redis_shared_state, :request_store do using RSpec::Parameterized::TableSyntax describe 'read and write' do diff --git a/spec/lib/gitlab/instrumentation/redis_spec.rb b/spec/lib/gitlab/instrumentation/redis_spec.rb index 8311c4f5bbb..e927f39cae2 100644 --- a/spec/lib/gitlab/instrumentation/redis_spec.rb +++ b/spec/lib/gitlab/instrumentation/redis_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Instrumentation::Redis do +RSpec.describe Gitlab::Instrumentation::Redis do def stub_storages(method, value) described_class::STORAGES.each do |storage| allow(storage).to receive(method) { value } diff --git a/spec/lib/gitlab/instrumentation_helper_spec.rb b/spec/lib/gitlab/instrumentation_helper_spec.rb index 15d377a16fc..35bbdcdccd6 100644 --- a/spec/lib/gitlab/instrumentation_helper_spec.rb +++ b/spec/lib/gitlab/instrumentation_helper_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rspec-parameterized' -describe Gitlab::InstrumentationHelper do +RSpec.describe Gitlab::InstrumentationHelper do using RSpec::Parameterized::TableSyntax describe '.keys' do diff --git a/spec/lib/gitlab/internal_post_receive/response_spec.rb b/spec/lib/gitlab/internal_post_receive/response_spec.rb index d90b85a41ed..135596c2de3 100644 --- a/spec/lib/gitlab/internal_post_receive/response_spec.rb +++ b/spec/lib/gitlab/internal_post_receive/response_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::InternalPostReceive::Response do +RSpec.describe Gitlab::InternalPostReceive::Response do subject { described_class.new } describe '#add_merge_request_urls' do diff --git a/spec/lib/gitlab/issuable_metadata_spec.rb b/spec/lib/gitlab/issuable_metadata_spec.rb index 1920cecfc29..3ba1d069bc9 100644 --- a/spec/lib/gitlab/issuable_metadata_spec.rb +++ b/spec/lib/gitlab/issuable_metadata_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::IssuableMetadata do +RSpec.describe Gitlab::IssuableMetadata do let(:user) { create(:user) } let!(:project) { create(:project, :public, :repository, creator: user, namespace: user.namespace) } diff --git a/spec/lib/gitlab/issuable_sorter_spec.rb b/spec/lib/gitlab/issuable_sorter_spec.rb index 486e9539b92..60f62062f04 100644 --- a/spec/lib/gitlab/issuable_sorter_spec.rb +++ b/spec/lib/gitlab/issuable_sorter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::IssuableSorter do +RSpec.describe Gitlab::IssuableSorter do let(:namespace1) { build_stubbed(:namespace, id: 1) } let(:project1) { build_stubbed(:project, id: 1, namespace: namespace1) } diff --git a/spec/lib/gitlab/issuables_count_for_state_spec.rb b/spec/lib/gitlab/issuables_count_for_state_spec.rb index 9380aa53470..1c186a8e6ca 100644 --- a/spec/lib/gitlab/issuables_count_for_state_spec.rb +++ b/spec/lib/gitlab/issuables_count_for_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::IssuablesCountForState do +RSpec.describe Gitlab::IssuablesCountForState do let(:finder) do double(:finder, count_by_state: { opened: 2, closed: 1 }) end diff --git a/spec/lib/gitlab/jira_import/base_importer_spec.rb b/spec/lib/gitlab/jira_import/base_importer_spec.rb index cda491393e8..1470bad2c4c 100644 --- a/spec/lib/gitlab/jira_import/base_importer_spec.rb +++ b/spec/lib/gitlab/jira_import/base_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::BaseImporter do +RSpec.describe Gitlab::JiraImport::BaseImporter do include JiraServiceHelper let(:project) { create(:project) } diff --git a/spec/lib/gitlab/jira_import/handle_labels_service_spec.rb b/spec/lib/gitlab/jira_import/handle_labels_service_spec.rb index 0eeff180575..4e2c5afb077 100644 --- a/spec/lib/gitlab/jira_import/handle_labels_service_spec.rb +++ b/spec/lib/gitlab/jira_import/handle_labels_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::HandleLabelsService do +RSpec.describe Gitlab::JiraImport::HandleLabelsService do describe '#execute' do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group) } diff --git a/spec/lib/gitlab/jira_import/issue_serializer_spec.rb b/spec/lib/gitlab/jira_import/issue_serializer_spec.rb index ce38a1234cf..684040f4e4b 100644 --- a/spec/lib/gitlab/jira_import/issue_serializer_spec.rb +++ b/spec/lib/gitlab/jira_import/issue_serializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::IssueSerializer do +RSpec.describe Gitlab::JiraImport::IssueSerializer do describe '#execute' do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group) } diff --git a/spec/lib/gitlab/jira_import/issues_importer_spec.rb b/spec/lib/gitlab/jira_import/issues_importer_spec.rb index 0d790f49450..4a32f0fd3a9 100644 --- a/spec/lib/gitlab/jira_import/issues_importer_spec.rb +++ b/spec/lib/gitlab/jira_import/issues_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::IssuesImporter do +RSpec.describe Gitlab::JiraImport::IssuesImporter do include JiraServiceHelper let_it_be(:user) { create(:user) } diff --git a/spec/lib/gitlab/jira_import/labels_importer_spec.rb b/spec/lib/gitlab/jira_import/labels_importer_spec.rb index 19661ff4e73..db98a83cb3c 100644 --- a/spec/lib/gitlab/jira_import/labels_importer_spec.rb +++ b/spec/lib/gitlab/jira_import/labels_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::LabelsImporter do +RSpec.describe Gitlab::JiraImport::LabelsImporter do include JiraServiceHelper let_it_be(:user) { create(:user) } diff --git a/spec/lib/gitlab/jira_import/metadata_collector_spec.rb b/spec/lib/gitlab/jira_import/metadata_collector_spec.rb index af479810df0..86863d67f25 100644 --- a/spec/lib/gitlab/jira_import/metadata_collector_spec.rb +++ b/spec/lib/gitlab/jira_import/metadata_collector_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::MetadataCollector do +RSpec.describe Gitlab::JiraImport::MetadataCollector do describe '#execute' do let(:key) { 'PROJECT-5' } let(:summary) { 'some title' } diff --git a/spec/lib/gitlab/jira_import/user_mapper_spec.rb b/spec/lib/gitlab/jira_import/user_mapper_spec.rb index c8c8bd3c5b0..576667caeca 100644 --- a/spec/lib/gitlab/jira_import/user_mapper_spec.rb +++ b/spec/lib/gitlab/jira_import/user_mapper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport::UserMapper do +RSpec.describe Gitlab::JiraImport::UserMapper do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group) } let_it_be(:user) { create(:user, email: 'user@example.com') } diff --git a/spec/lib/gitlab/jira_import_spec.rb b/spec/lib/gitlab/jira_import_spec.rb index 5b95891c97e..c8cecb576da 100644 --- a/spec/lib/gitlab/jira_import_spec.rb +++ b/spec/lib/gitlab/jira_import_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JiraImport do +RSpec.describe Gitlab::JiraImport do let(:project_id) { 321 } describe '.validate_project_settings!' do diff --git a/spec/lib/gitlab/job_waiter_spec.rb b/spec/lib/gitlab/job_waiter_spec.rb index da6a6a9149b..4d7c838aa3b 100644 --- a/spec/lib/gitlab/job_waiter_spec.rb +++ b/spec/lib/gitlab/job_waiter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JobWaiter do +RSpec.describe Gitlab::JobWaiter do describe '.notify' do it 'pushes the jid to the named queue' do key = 'gitlab:job_waiter:foo' diff --git a/spec/lib/gitlab/json_cache_spec.rb b/spec/lib/gitlab/json_cache_spec.rb index 9379499f602..563b3d35823 100644 --- a/spec/lib/gitlab/json_cache_spec.rb +++ b/spec/lib/gitlab/json_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JsonCache do +RSpec.describe Gitlab::JsonCache do let_it_be(:broadcast_message) { create(:broadcast_message) } let(:backend) { double('backend').as_null_object } let(:namespace) { 'geo' } diff --git a/spec/lib/gitlab/json_logger_spec.rb b/spec/lib/gitlab/json_logger_spec.rb index 41dafc84ef2..23f7191454a 100644 --- a/spec/lib/gitlab/json_logger_spec.rb +++ b/spec/lib/gitlab/json_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JsonLogger do +RSpec.describe Gitlab::JsonLogger do subject { described_class.new('/dev/null') } let(:now) { Time.now } diff --git a/spec/lib/gitlab/jwt_authenticatable_spec.rb b/spec/lib/gitlab/jwt_authenticatable_spec.rb index 0c1c491b308..36bb46cb250 100644 --- a/spec/lib/gitlab/jwt_authenticatable_spec.rb +++ b/spec/lib/gitlab/jwt_authenticatable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::JwtAuthenticatable do +RSpec.describe Gitlab::JwtAuthenticatable do let(:test_class) do Class.new do include Gitlab::JwtAuthenticatable diff --git a/spec/lib/gitlab/kubernetes/cluster_role_binding_spec.rb b/spec/lib/gitlab/kubernetes/cluster_role_binding_spec.rb index e1106f7496a..02729d53da8 100644 --- a/spec/lib/gitlab/kubernetes/cluster_role_binding_spec.rb +++ b/spec/lib/gitlab/kubernetes/cluster_role_binding_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::ClusterRoleBinding do +RSpec.describe Gitlab::Kubernetes::ClusterRoleBinding do let(:cluster_role_binding) { described_class.new(name, cluster_role_name, subjects) } let(:name) { 'cluster-role-binding-name' } let(:cluster_role_name) { 'cluster-admin' } diff --git a/spec/lib/gitlab/kubernetes/config_map_spec.rb b/spec/lib/gitlab/kubernetes/config_map_spec.rb index 0203772e069..2d0d205ffb1 100644 --- a/spec/lib/gitlab/kubernetes/config_map_spec.rb +++ b/spec/lib/gitlab/kubernetes/config_map_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::ConfigMap do +RSpec.describe Gitlab::Kubernetes::ConfigMap do let(:kubeclient) { double('kubernetes client') } let(:application) { create(:clusters_applications_prometheus) } let(:config_map) { described_class.new(application.name, application.files) } diff --git a/spec/lib/gitlab/kubernetes/config_maps/aws_node_auth_spec.rb b/spec/lib/gitlab/kubernetes/config_maps/aws_node_auth_spec.rb index f701643860a..9c3e41dfbff 100644 --- a/spec/lib/gitlab/kubernetes/config_maps/aws_node_auth_spec.rb +++ b/spec/lib/gitlab/kubernetes/config_maps/aws_node_auth_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::ConfigMaps::AwsNodeAuth do +RSpec.describe Gitlab::Kubernetes::ConfigMaps::AwsNodeAuth do describe '#generate' do let(:role) { 'arn:aws:iam::123456789012:role/node-instance-role' } diff --git a/spec/lib/gitlab/kubernetes/default_namespace_spec.rb b/spec/lib/gitlab/kubernetes/default_namespace_spec.rb index 1fda547f35c..976fe4a0a87 100644 --- a/spec/lib/gitlab/kubernetes/default_namespace_spec.rb +++ b/spec/lib/gitlab/kubernetes/default_namespace_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::DefaultNamespace do +RSpec.describe Gitlab::Kubernetes::DefaultNamespace do let(:generator) { described_class.new(cluster, project: environment.project) } describe '#from_environment_name' do diff --git a/spec/lib/gitlab/kubernetes/generic_secret_spec.rb b/spec/lib/gitlab/kubernetes/generic_secret_spec.rb index fe1d4cc11e6..8b56d76410e 100644 --- a/spec/lib/gitlab/kubernetes/generic_secret_spec.rb +++ b/spec/lib/gitlab/kubernetes/generic_secret_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::GenericSecret do +RSpec.describe Gitlab::Kubernetes::GenericSecret do let(:secret) { described_class.new(name, data, namespace) } let(:name) { 'example-name' } let(:data) { 'example-data' } diff --git a/spec/lib/gitlab/kubernetes/helm/api_spec.rb b/spec/lib/gitlab/kubernetes/helm/api_spec.rb index 0e4179d5887..dabbab27b13 100644 --- a/spec/lib/gitlab/kubernetes/helm/api_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/api_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::API do +RSpec.describe Gitlab::Kubernetes::Helm::API do let(:client) { double('kubernetes client') } let(:helm) { described_class.new(client) } let(:gitlab_namespace) { Gitlab::Kubernetes::Helm::NAMESPACE } diff --git a/spec/lib/gitlab/kubernetes/helm/base_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/base_command_spec.rb index f9bcb8abdb1..57fafaebf98 100644 --- a/spec/lib/gitlab/kubernetes/helm/base_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/base_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::BaseCommand do +RSpec.describe Gitlab::Kubernetes::Helm::BaseCommand do subject(:base_command) do test_class.new(rbac) end diff --git a/spec/lib/gitlab/kubernetes/helm/certificate_spec.rb b/spec/lib/gitlab/kubernetes/helm/certificate_spec.rb index 04649353976..b446c5e1149 100644 --- a/spec/lib/gitlab/kubernetes/helm/certificate_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/certificate_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Kubernetes::Helm::Certificate do +RSpec.describe Gitlab::Kubernetes::Helm::Certificate do describe '.generate_root' do subject { described_class.generate_root } diff --git a/spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb index 2bf8b294821..7b182478cc3 100644 --- a/spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/delete_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::DeleteCommand do +RSpec.describe Gitlab::Kubernetes::Helm::DeleteCommand do subject(:delete_command) { described_class.new(name: app_name, rbac: rbac, files: files, local_tiller_enabled: local_tiller_enabled) } let(:app_name) { 'app-name' } diff --git a/spec/lib/gitlab/kubernetes/helm/init_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/init_command_spec.rb index 61b8eb30b42..c982a417682 100644 --- a/spec/lib/gitlab/kubernetes/helm/init_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/init_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::InitCommand do +RSpec.describe Gitlab::Kubernetes::Helm::InitCommand do subject(:init_command) { described_class.new(name: application.name, files: files, rbac: rbac, local_tiller_enabled: false) } let(:application) { create(:clusters_applications_helm) } diff --git a/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb index 6fc91300f5b..aad350256ec 100644 --- a/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/install_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::InstallCommand do +RSpec.describe Gitlab::Kubernetes::Helm::InstallCommand do subject(:install_command) do described_class.new( name: 'app-name', diff --git a/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb b/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb index 0ad5dc189c0..435c296d5f1 100644 --- a/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Kubernetes::Helm::Parsers::ListV2 do +RSpec.describe Gitlab::Kubernetes::Helm::Parsers::ListV2 do let(:valid_file_contents) do <<~EOF { diff --git a/spec/lib/gitlab/kubernetes/helm/patch_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/patch_command_spec.rb index 8d965a25f84..ea2ade18e37 100644 --- a/spec/lib/gitlab/kubernetes/helm/patch_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/patch_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::PatchCommand do +RSpec.describe Gitlab::Kubernetes::Helm::PatchCommand do let(:files) { { 'ca.pem': 'some file content' } } let(:repository) { 'https://repository.example.com' } let(:rbac) { false } diff --git a/spec/lib/gitlab/kubernetes/helm/pod_spec.rb b/spec/lib/gitlab/kubernetes/helm/pod_spec.rb index a4be233b4bd..12515618152 100644 --- a/spec/lib/gitlab/kubernetes/helm/pod_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/pod_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::Pod do +RSpec.describe Gitlab::Kubernetes::Helm::Pod do describe '#generate' do let(:app) { create(:clusters_applications_prometheus) } let(:command) { app.install_command } diff --git a/spec/lib/gitlab/kubernetes/helm/reset_command_spec.rb b/spec/lib/gitlab/kubernetes/helm/reset_command_spec.rb index 3773c428713..8d386d41ad5 100644 --- a/spec/lib/gitlab/kubernetes/helm/reset_command_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/reset_command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Helm::ResetCommand do +RSpec.describe Gitlab::Kubernetes::Helm::ResetCommand do subject(:reset_command) { described_class.new(name: name, rbac: rbac, files: files, local_tiller_enabled: false) } let(:rbac) { true } diff --git a/spec/lib/gitlab/kubernetes/kube_client_spec.rb b/spec/lib/gitlab/kubernetes/kube_client_spec.rb index 32597aa4f5a..a15be42f393 100644 --- a/spec/lib/gitlab/kubernetes/kube_client_spec.rb +++ b/spec/lib/gitlab/kubernetes/kube_client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::KubeClient do +RSpec.describe Gitlab::Kubernetes::KubeClient do include StubRequests include KubernetesHelpers diff --git a/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb b/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb index b65d7b9fdc6..e80bb3dfb07 100644 --- a/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb +++ b/spec/lib/gitlab/kubernetes/kubectl_cmd_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Kubernetes::KubectlCmd do +RSpec.describe Gitlab::Kubernetes::KubectlCmd do describe '.delete' do it 'constructs string properly' do args = %w(resource_type type --flag-1 --flag-2) diff --git a/spec/lib/gitlab/kubernetes/namespace_spec.rb b/spec/lib/gitlab/kubernetes/namespace_spec.rb index 467b10e21b1..5fe4e008469 100644 --- a/spec/lib/gitlab/kubernetes/namespace_spec.rb +++ b/spec/lib/gitlab/kubernetes/namespace_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Namespace do +RSpec.describe Gitlab::Kubernetes::Namespace do let(:name) { 'a_namespace' } let(:client) { double('kubernetes client') } let(:labels) { nil } diff --git a/spec/lib/gitlab/kubernetes/network_policy_spec.rb b/spec/lib/gitlab/kubernetes/network_policy_spec.rb index 5a920d78436..a8ca15f998b 100644 --- a/spec/lib/gitlab/kubernetes/network_policy_spec.rb +++ b/spec/lib/gitlab/kubernetes/network_policy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::NetworkPolicy do +RSpec.describe Gitlab::Kubernetes::NetworkPolicy do let(:policy) do described_class.new( name: name, diff --git a/spec/lib/gitlab/kubernetes/role_binding_spec.rb b/spec/lib/gitlab/kubernetes/role_binding_spec.rb index 4c200eb545f..3003fe25301 100644 --- a/spec/lib/gitlab/kubernetes/role_binding_spec.rb +++ b/spec/lib/gitlab/kubernetes/role_binding_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::RoleBinding, '#generate' do +RSpec.describe Gitlab::Kubernetes::RoleBinding, '#generate' do let(:role_name) { 'edit' } let(:role_kind) { 'ClusterRole' } let(:namespace) { 'my-namespace' } diff --git a/spec/lib/gitlab/kubernetes/role_spec.rb b/spec/lib/gitlab/kubernetes/role_spec.rb index 3a5cd3b6704..acb9b5d4e8e 100644 --- a/spec/lib/gitlab/kubernetes/role_spec.rb +++ b/spec/lib/gitlab/kubernetes/role_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::Role do +RSpec.describe Gitlab::Kubernetes::Role do let(:role) { described_class.new(name: name, namespace: namespace, rules: rules) } let(:name) { 'example-name' } let(:namespace) { 'example-namespace' } diff --git a/spec/lib/gitlab/kubernetes/service_account_spec.rb b/spec/lib/gitlab/kubernetes/service_account_spec.rb index 0d525966d18..998d1a6d954 100644 --- a/spec/lib/gitlab/kubernetes/service_account_spec.rb +++ b/spec/lib/gitlab/kubernetes/service_account_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::ServiceAccount do +RSpec.describe Gitlab::Kubernetes::ServiceAccount do let(:name) { 'a_service_account' } let(:namespace_name) { 'a_namespace' } let(:service_account) { described_class.new(name, namespace_name) } diff --git a/spec/lib/gitlab/kubernetes/service_account_token_spec.rb b/spec/lib/gitlab/kubernetes/service_account_token_spec.rb index 0d334bed45f..18423fdb2a3 100644 --- a/spec/lib/gitlab/kubernetes/service_account_token_spec.rb +++ b/spec/lib/gitlab/kubernetes/service_account_token_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::ServiceAccountToken do +RSpec.describe Gitlab::Kubernetes::ServiceAccountToken do let(:name) { 'token-name' } let(:service_account_name) { 'a_service_account' } let(:namespace_name) { 'a_namespace' } diff --git a/spec/lib/gitlab/kubernetes/tls_secret_spec.rb b/spec/lib/gitlab/kubernetes/tls_secret_spec.rb index 438a0dc79fc..b40ed3c88c9 100644 --- a/spec/lib/gitlab/kubernetes/tls_secret_spec.rb +++ b/spec/lib/gitlab/kubernetes/tls_secret_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes::TlsSecret do +RSpec.describe Gitlab::Kubernetes::TlsSecret do let(:secret) { described_class.new(name, cert, key, namespace) } let(:name) { 'example-name' } let(:cert) { 'example-cert' } diff --git a/spec/lib/gitlab/kubernetes_spec.rb b/spec/lib/gitlab/kubernetes_spec.rb index 40c3e7d0b3c..eff5c019ad0 100644 --- a/spec/lib/gitlab/kubernetes_spec.rb +++ b/spec/lib/gitlab/kubernetes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Kubernetes do +RSpec.describe Gitlab::Kubernetes do include KubernetesHelpers include described_class diff --git a/spec/lib/gitlab/language_data_spec.rb b/spec/lib/gitlab/language_data_spec.rb index b08150855fe..bb4b0c3855c 100644 --- a/spec/lib/gitlab/language_data_spec.rb +++ b/spec/lib/gitlab/language_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LanguageData do +RSpec.describe Gitlab::LanguageData do describe '#extensions' do before do described_class.clear_extensions! diff --git a/spec/lib/gitlab/language_detection_spec.rb b/spec/lib/gitlab/language_detection_spec.rb index 770fe2f80db..04ad19a04ec 100644 --- a/spec/lib/gitlab/language_detection_spec.rb +++ b/spec/lib/gitlab/language_detection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LanguageDetection do +RSpec.describe Gitlab::LanguageDetection do let_it_be(:project) { create(:project, :repository) } let_it_be(:ruby) { create(:programming_language, name: 'Ruby') } let_it_be(:haskell) { create(:programming_language, name: 'Haskell') } diff --git a/spec/lib/gitlab/lazy_spec.rb b/spec/lib/gitlab/lazy_spec.rb index 19758a18589..3e929cf200a 100644 --- a/spec/lib/gitlab/lazy_spec.rb +++ b/spec/lib/gitlab/lazy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Lazy do +RSpec.describe Gitlab::Lazy do let(:dummy) { double(:dummy) } context 'when not calling any methods' do diff --git a/spec/lib/gitlab/legacy_github_import/branch_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/branch_formatter_spec.rb index e96745f5fbe..1a21ed29ab7 100644 --- a/spec/lib/gitlab/legacy_github_import/branch_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/branch_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::BranchFormatter do +RSpec.describe Gitlab::LegacyGithubImport::BranchFormatter do let(:project) { create(:project, :repository) } let(:commit) { create(:commit, project: project) } let(:repo) { double } diff --git a/spec/lib/gitlab/legacy_github_import/client_spec.rb b/spec/lib/gitlab/legacy_github_import/client_spec.rb index d266b39bd81..0929b90d1f4 100644 --- a/spec/lib/gitlab/legacy_github_import/client_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::Client do +RSpec.describe Gitlab::LegacyGithubImport::Client do let(:token) { '123456' } let(:github_provider) { Settingslogic.new('app_id' => 'asd123', 'app_secret' => 'asd123', 'name' => 'github', 'args' => { 'client_options' => {} }) } let(:wait_for_rate_limit_reset) { true } diff --git a/spec/lib/gitlab/legacy_github_import/comment_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/comment_formatter_spec.rb index 0f03db312ce..85f7666fe85 100644 --- a/spec/lib/gitlab/legacy_github_import/comment_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/comment_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::CommentFormatter do +RSpec.describe Gitlab::LegacyGithubImport::CommentFormatter do let(:client) { double } let(:project) { create(:project) } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } diff --git a/spec/lib/gitlab/legacy_github_import/importer_spec.rb b/spec/lib/gitlab/legacy_github_import/importer_spec.rb index 8cc3fd8efbd..c443944678f 100644 --- a/spec/lib/gitlab/legacy_github_import/importer_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::Importer do +RSpec.describe Gitlab::LegacyGithubImport::Importer do shared_examples 'Gitlab::LegacyGithubImport::Importer#execute' do let(:expected_not_called) { [] } diff --git a/spec/lib/gitlab/legacy_github_import/issuable_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/issuable_formatter_spec.rb index f5bfc379e89..6a51cb6f39d 100644 --- a/spec/lib/gitlab/legacy_github_import/issuable_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/issuable_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::IssuableFormatter do +RSpec.describe Gitlab::LegacyGithubImport::IssuableFormatter do let(:raw_data) do double(number: 42) end diff --git a/spec/lib/gitlab/legacy_github_import/issue_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/issue_formatter_spec.rb index 9a7a34afbe7..4b1e0d2c144 100644 --- a/spec/lib/gitlab/legacy_github_import/issue_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/issue_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::IssueFormatter do +RSpec.describe Gitlab::LegacyGithubImport::IssueFormatter do let(:client) { double } let!(:project) { create(:project, namespace: create(:namespace, path: 'octocat')) } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } diff --git a/spec/lib/gitlab/legacy_github_import/label_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/label_formatter_spec.rb index e56e2772f6a..ab7c8ea4a58 100644 --- a/spec/lib/gitlab/legacy_github_import/label_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/label_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::LabelFormatter do +RSpec.describe Gitlab::LegacyGithubImport::LabelFormatter do let(:project) { create(:project) } let(:raw) { double(name: 'improvements', color: 'e6e6e6') } diff --git a/spec/lib/gitlab/legacy_github_import/milestone_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/milestone_formatter_spec.rb index f5d71888ac9..2ac79c4f5b8 100644 --- a/spec/lib/gitlab/legacy_github_import/milestone_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/milestone_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::MilestoneFormatter do +RSpec.describe Gitlab::LegacyGithubImport::MilestoneFormatter do let(:project) { create(:project) } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } let(:updated_at) { DateTime.strptime('2011-01-27T19:01:12Z') } diff --git a/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb b/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb index b0687474c80..02cc2eba4da 100644 --- a/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/project_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::ProjectCreator do +RSpec.describe Gitlab::LegacyGithubImport::ProjectCreator do let(:user) { create(:user) } let(:namespace) { create(:group) } diff --git a/spec/lib/gitlab/legacy_github_import/pull_request_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/pull_request_formatter_spec.rb index 622210508b9..3e6b9340d0b 100644 --- a/spec/lib/gitlab/legacy_github_import/pull_request_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/pull_request_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::PullRequestFormatter do +RSpec.describe Gitlab::LegacyGithubImport::PullRequestFormatter do let(:client) { double } let(:project) { create(:project, :repository) } let(:source_sha) { create(:commit, project: project).id } diff --git a/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb index 554be57fbec..73b35d3a4e7 100644 --- a/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/release_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::ReleaseFormatter do +RSpec.describe Gitlab::LegacyGithubImport::ReleaseFormatter do let!(:project) { create(:project, namespace: create(:namespace, path: 'octocat')) } let(:octocat) { double(id: 123456, login: 'octocat') } let(:created_at) { DateTime.strptime('2011-01-26T19:01:12Z') } diff --git a/spec/lib/gitlab/legacy_github_import/user_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/user_formatter_spec.rb index 919847fe061..34659030020 100644 --- a/spec/lib/gitlab/legacy_github_import/user_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/user_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::UserFormatter do +RSpec.describe Gitlab::LegacyGithubImport::UserFormatter do let(:client) { double } let(:octocat) { double(id: 123456, login: 'octocat', email: 'octocat@example.com') } diff --git a/spec/lib/gitlab/legacy_github_import/wiki_formatter_spec.rb b/spec/lib/gitlab/legacy_github_import/wiki_formatter_spec.rb index 639fb9d80eb..df443fa3dbb 100644 --- a/spec/lib/gitlab/legacy_github_import/wiki_formatter_spec.rb +++ b/spec/lib/gitlab/legacy_github_import/wiki_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LegacyGithubImport::WikiFormatter do +RSpec.describe Gitlab::LegacyGithubImport::WikiFormatter do let(:project) do create(:project, namespace: create(:namespace, path: 'gitlabhq'), diff --git a/spec/lib/gitlab/lets_encrypt/challenge_spec.rb b/spec/lib/gitlab/lets_encrypt/challenge_spec.rb index fcd92586362..d853275520b 100644 --- a/spec/lib/gitlab/lets_encrypt/challenge_spec.rb +++ b/spec/lib/gitlab/lets_encrypt/challenge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::LetsEncrypt::Challenge do +RSpec.describe ::Gitlab::LetsEncrypt::Challenge do include LetsEncryptHelpers let(:challenge) { described_class.new(acme_challenge_double) } diff --git a/spec/lib/gitlab/lets_encrypt/client_spec.rb b/spec/lib/gitlab/lets_encrypt/client_spec.rb index e86de04b5cf..54b9bd3bfba 100644 --- a/spec/lib/gitlab/lets_encrypt/client_spec.rb +++ b/spec/lib/gitlab/lets_encrypt/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::LetsEncrypt::Client do +RSpec.describe ::Gitlab::LetsEncrypt::Client do include LetsEncryptHelpers let(:client) { described_class.new } diff --git a/spec/lib/gitlab/lets_encrypt/order_spec.rb b/spec/lib/gitlab/lets_encrypt/order_spec.rb index 333fce8e36a..419f9e28871 100644 --- a/spec/lib/gitlab/lets_encrypt/order_spec.rb +++ b/spec/lib/gitlab/lets_encrypt/order_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::LetsEncrypt::Order do +RSpec.describe ::Gitlab::LetsEncrypt::Order do include LetsEncryptHelpers let(:acme_order) { acme_order_double } diff --git a/spec/lib/gitlab/lets_encrypt_spec.rb b/spec/lib/gitlab/lets_encrypt_spec.rb index 2229393fb32..7597359847b 100644 --- a/spec/lib/gitlab/lets_encrypt_spec.rb +++ b/spec/lib/gitlab/lets_encrypt_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::LetsEncrypt do +RSpec.describe ::Gitlab::LetsEncrypt do include LetsEncryptHelpers before do diff --git a/spec/lib/gitlab/lfs_token_spec.rb b/spec/lib/gitlab/lfs_token_spec.rb index 58a3767b242..9b8b2c1417a 100644 --- a/spec/lib/gitlab/lfs_token_spec.rb +++ b/spec/lib/gitlab/lfs_token_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LfsToken, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::LfsToken, :clean_gitlab_redis_shared_state do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be(:deploy_key) { create(:deploy_key) } diff --git a/spec/lib/gitlab/log_timestamp_formatter_spec.rb b/spec/lib/gitlab/log_timestamp_formatter_spec.rb index 1a76d02889b..e06baa2324f 100644 --- a/spec/lib/gitlab/log_timestamp_formatter_spec.rb +++ b/spec/lib/gitlab/log_timestamp_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LogTimestampFormatter do +RSpec.describe Gitlab::LogTimestampFormatter do subject { described_class.new } let(:formatted_timestamp) { Time.now.utc.iso8601(3) } diff --git a/spec/lib/gitlab/logging/cloudflare_helper_spec.rb b/spec/lib/gitlab/logging/cloudflare_helper_spec.rb index 2b73fb7bc1c..87ac438d38d 100644 --- a/spec/lib/gitlab/logging/cloudflare_helper_spec.rb +++ b/spec/lib/gitlab/logging/cloudflare_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Logging::CloudflareHelper do +RSpec.describe Gitlab::Logging::CloudflareHelper do let(:helper) do Class.new do include Gitlab::Logging::CloudflareHelper diff --git a/spec/lib/gitlab/lograge/custom_options_spec.rb b/spec/lib/gitlab/lograge/custom_options_spec.rb index ebf150d21ef..2535664aa34 100644 --- a/spec/lib/gitlab/lograge/custom_options_spec.rb +++ b/spec/lib/gitlab/lograge/custom_options_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Lograge::CustomOptions do +RSpec.describe Gitlab::Lograge::CustomOptions do describe '.call' do let(:params) do { diff --git a/spec/lib/gitlab/loop_helpers_spec.rb b/spec/lib/gitlab/loop_helpers_spec.rb index 7e59b41d5b9..0535cb6068c 100644 --- a/spec/lib/gitlab/loop_helpers_spec.rb +++ b/spec/lib/gitlab/loop_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::LoopHelpers do +RSpec.describe Gitlab::LoopHelpers do let(:class_instance) { (Class.new { include ::Gitlab::LoopHelpers }).new } describe '#loop_until' do diff --git a/spec/lib/gitlab/mail_room/mail_room_spec.rb b/spec/lib/gitlab/mail_room/mail_room_spec.rb index 4b09205a181..ab9a9a035f1 100644 --- a/spec/lib/gitlab/mail_room/mail_room_spec.rb +++ b/spec/lib/gitlab/mail_room/mail_room_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::MailRoom do +RSpec.describe Gitlab::MailRoom do let(:default_port) { 143 } let(:yml_config) do { diff --git a/spec/lib/gitlab/manifest_import/manifest_spec.rb b/spec/lib/gitlab/manifest_import/manifest_spec.rb index c1135f710ea..2e8753b0880 100644 --- a/spec/lib/gitlab/manifest_import/manifest_spec.rb +++ b/spec/lib/gitlab/manifest_import/manifest_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ManifestImport::Manifest do +RSpec.describe Gitlab::ManifestImport::Manifest do let(:file) { File.open(Rails.root.join('spec/fixtures/aosp_manifest.xml')) } let(:manifest) { described_class.new(file) } diff --git a/spec/lib/gitlab/manifest_import/project_creator_spec.rb b/spec/lib/gitlab/manifest_import/project_creator_spec.rb index a8cfcfb41d3..354acf53b7a 100644 --- a/spec/lib/gitlab/manifest_import/project_creator_spec.rb +++ b/spec/lib/gitlab/manifest_import/project_creator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ManifestImport::ProjectCreator do +RSpec.describe Gitlab::ManifestImport::ProjectCreator do let(:group) { create(:group) } let(:user) { create(:user) } let(:repository) do diff --git a/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb b/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb index 5b6c769d6eb..be562d916d3 100644 --- a/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb +++ b/spec/lib/gitlab/markdown_cache/active_record/extension_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::MarkdownCache::ActiveRecord::Extension do +RSpec.describe Gitlab::MarkdownCache::ActiveRecord::Extension do let(:klass) do Class.new(ActiveRecord::Base) do self.table_name = 'issues' diff --git a/spec/lib/gitlab/markdown_cache/field_data_spec.rb b/spec/lib/gitlab/markdown_cache/field_data_spec.rb index 393bf85aa43..76d8cbe6b7d 100644 --- a/spec/lib/gitlab/markdown_cache/field_data_spec.rb +++ b/spec/lib/gitlab/markdown_cache/field_data_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::MarkdownCache::FieldData do +RSpec.describe Gitlab::MarkdownCache::FieldData do subject(:field_data) { described_class.new } before do diff --git a/spec/lib/gitlab/markdown_cache/redis/extension_spec.rb b/spec/lib/gitlab/markdown_cache/redis/extension_spec.rb index b6a781de426..e8f6c38dc2b 100644 --- a/spec/lib/gitlab/markdown_cache/redis/extension_spec.rb +++ b/spec/lib/gitlab/markdown_cache/redis/extension_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::MarkdownCache::Redis::Extension, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::MarkdownCache::Redis::Extension, :clean_gitlab_redis_cache do let(:klass) do Class.new do include CacheMarkdownField diff --git a/spec/lib/gitlab/markdown_cache/redis/store_spec.rb b/spec/lib/gitlab/markdown_cache/redis/store_spec.rb index 95c68e7d491..93451726250 100644 --- a/spec/lib/gitlab/markdown_cache/redis/store_spec.rb +++ b/spec/lib/gitlab/markdown_cache/redis/store_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::MarkdownCache::Redis::Store, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::MarkdownCache::Redis::Store, :clean_gitlab_redis_cache do let(:storable_class) do Class.new do cattr_reader :cached_markdown_fields do diff --git a/spec/lib/gitlab/markup_helper_spec.rb b/spec/lib/gitlab/markup_helper_spec.rb index b93538cae5a..bf5415ba1d7 100644 --- a/spec/lib/gitlab/markup_helper_spec.rb +++ b/spec/lib/gitlab/markup_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::MarkupHelper do +RSpec.describe Gitlab::MarkupHelper do describe '#markup?' do %w(textile rdoc org creole wiki mediawiki rst adoc ad asciidoc mdown md markdown).each do |type| diff --git a/spec/lib/gitlab/metrics/background_transaction_spec.rb b/spec/lib/gitlab/metrics/background_transaction_spec.rb index 84f405d7369..e4306806e0e 100644 --- a/spec/lib/gitlab/metrics/background_transaction_spec.rb +++ b/spec/lib/gitlab/metrics/background_transaction_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::BackgroundTransaction do +RSpec.describe Gitlab::Metrics::BackgroundTransaction do let(:test_worker_class) { double(:class, name: 'TestWorker') } subject { described_class.new(test_worker_class) } diff --git a/spec/lib/gitlab/metrics/dashboard/defaults_spec.rb b/spec/lib/gitlab/metrics/dashboard/defaults_spec.rb index 420b246b3f5..dd61f8ebc4d 100644 --- a/spec/lib/gitlab/metrics/dashboard/defaults_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/defaults_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Defaults do +RSpec.describe Gitlab::Metrics::Dashboard::Defaults do it { is_expected.to be_const_defined(:DEFAULT_PANEL_TYPE) } it { is_expected.to be_const_defined(:DEFAULT_PANEL_WEIGHT) } end diff --git a/spec/lib/gitlab/metrics/dashboard/finder_spec.rb b/spec/lib/gitlab/metrics/dashboard/finder_spec.rb index 2703339d89c..d50a08801ff 100644 --- a/spec/lib/gitlab/metrics/dashboard/finder_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store_caching do +RSpec.describe Gitlab::Metrics::Dashboard::Finder, :use_clean_rails_memory_store_caching do include MetricsDashboardHelpers let_it_be(:project) { create(:project) } diff --git a/spec/lib/gitlab/metrics/dashboard/processor_spec.rb b/spec/lib/gitlab/metrics/dashboard/processor_spec.rb index b5ed54e3c90..b017eb89b5d 100644 --- a/spec/lib/gitlab/metrics/dashboard/processor_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/processor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Processor do +RSpec.describe Gitlab::Metrics::Dashboard::Processor do let(:project) { build(:project) } let(:environment) { create(:environment, project: project) } let(:dashboard_yml) { YAML.load_file('spec/fixtures/lib/gitlab/metrics/dashboard/sample_dashboard.yml') } diff --git a/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb b/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb index 245c98cdd00..2466208e715 100644 --- a/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/service_selector_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::ServiceSelector do +RSpec.describe Gitlab::Metrics::Dashboard::ServiceSelector do include MetricsDashboardHelpers describe '#call' do diff --git a/spec/lib/gitlab/metrics/dashboard/stages/grafana_formatter_spec.rb b/spec/lib/gitlab/metrics/dashboard/stages/grafana_formatter_spec.rb index 5d4bd4512e3..8a236f72a60 100644 --- a/spec/lib/gitlab/metrics/dashboard/stages/grafana_formatter_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/stages/grafana_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Stages::GrafanaFormatter do +RSpec.describe Gitlab::Metrics::Dashboard::Stages::GrafanaFormatter do include GrafanaApiHelpers let_it_be(:namespace) { create(:namespace, name: 'foo') } diff --git a/spec/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter_spec.rb b/spec/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter_spec.rb index 6124f471e39..889712433c2 100644 --- a/spec/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/stages/panel_ids_inserter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Stages::PanelIdsInserter do +RSpec.describe Gitlab::Metrics::Dashboard::Stages::PanelIdsInserter do let(:project) { build_stubbed(:project) } def fetch_panel_ids(dashboard_hash) diff --git a/spec/lib/gitlab/metrics/dashboard/url_spec.rb b/spec/lib/gitlab/metrics/dashboard/url_spec.rb index 75f9f99c8a6..afb65f0b6e4 100644 --- a/spec/lib/gitlab/metrics/dashboard/url_spec.rb +++ b/spec/lib/gitlab/metrics/dashboard/url_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Dashboard::Url do +RSpec.describe Gitlab::Metrics::Dashboard::Url do include Gitlab::Routing.url_helpers describe '#metrics_regex' do diff --git a/spec/lib/gitlab/metrics/delta_spec.rb b/spec/lib/gitlab/metrics/delta_spec.rb index 9bb011dc8fc..e768da875c2 100644 --- a/spec/lib/gitlab/metrics/delta_spec.rb +++ b/spec/lib/gitlab/metrics/delta_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Delta do +RSpec.describe Gitlab::Metrics::Delta do let(:delta) { described_class.new } describe '#compared_with' do diff --git a/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb index 305768ef060..1fbd41bcc88 100644 --- a/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/elasticsearch_rack_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::ElasticsearchRackMiddleware do +RSpec.describe Gitlab::Metrics::ElasticsearchRackMiddleware do let(:app) { double(:app, call: 'app call result') } let(:middleware) { described_class.new(app) } let(:env) { {} } diff --git a/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb b/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb index 47ec69e2f45..e4f85243528 100644 --- a/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb +++ b/spec/lib/gitlab/metrics/exporter/base_exporter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Exporter::BaseExporter do +RSpec.describe Gitlab::Metrics::Exporter::BaseExporter do let(:exporter) { described_class.new } let(:log_filename) { File.join(Rails.root, 'log', 'sidekiq_exporter.log') } let(:settings) { double('settings') } diff --git a/spec/lib/gitlab/metrics/exporter/sidekiq_exporter_spec.rb b/spec/lib/gitlab/metrics/exporter/sidekiq_exporter_spec.rb index 0b820fdbde9..2c5ef09f799 100644 --- a/spec/lib/gitlab/metrics/exporter/sidekiq_exporter_spec.rb +++ b/spec/lib/gitlab/metrics/exporter/sidekiq_exporter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Exporter::SidekiqExporter do +RSpec.describe Gitlab::Metrics::Exporter::SidekiqExporter do let(:exporter) { described_class.new } after do diff --git a/spec/lib/gitlab/metrics/exporter/web_exporter_spec.rb b/spec/lib/gitlab/metrics/exporter/web_exporter_spec.rb index f22993cf057..ce98c807e2e 100644 --- a/spec/lib/gitlab/metrics/exporter/web_exporter_spec.rb +++ b/spec/lib/gitlab/metrics/exporter/web_exporter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Exporter::WebExporter do +RSpec.describe Gitlab::Metrics::Exporter::WebExporter do let(:exporter) { described_class.new } let(:readiness_probe) { exporter.send(:readiness_probe).execute } diff --git a/spec/lib/gitlab/metrics/instrumentation_spec.rb b/spec/lib/gitlab/metrics/instrumentation_spec.rb index bf84a476df9..2729fbce974 100644 --- a/spec/lib/gitlab/metrics/instrumentation_spec.rb +++ b/spec/lib/gitlab/metrics/instrumentation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Instrumentation do +RSpec.describe Gitlab::Metrics::Instrumentation do let(:env) { {} } let(:transaction) { Gitlab::Metrics::WebTransaction.new(env) } diff --git a/spec/lib/gitlab/metrics/method_call_spec.rb b/spec/lib/gitlab/metrics/method_call_spec.rb index 035d875258c..42361cbc36a 100644 --- a/spec/lib/gitlab/metrics/method_call_spec.rb +++ b/spec/lib/gitlab/metrics/method_call_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::MethodCall do +RSpec.describe Gitlab::Metrics::MethodCall do let(:transaction) { double(:transaction, labels: {}) } let(:method_call) { described_class.new('Foo#bar', :Foo, '#bar', transaction) } diff --git a/spec/lib/gitlab/metrics/methods_spec.rb b/spec/lib/gitlab/metrics/methods_spec.rb index 5cf8db55142..3c171680272 100644 --- a/spec/lib/gitlab/metrics/methods_spec.rb +++ b/spec/lib/gitlab/metrics/methods_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Methods do +RSpec.describe Gitlab::Metrics::Methods do subject { Class.new { include Gitlab::Metrics::Methods } } shared_context 'metric' do |metric_type, *args| diff --git a/spec/lib/gitlab/metrics/prometheus_spec.rb b/spec/lib/gitlab/metrics/prometheus_spec.rb index e15a063fc9e..2273987551d 100644 --- a/spec/lib/gitlab/metrics/prometheus_spec.rb +++ b/spec/lib/gitlab/metrics/prometheus_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Prometheus, :prometheus do +RSpec.describe Gitlab::Metrics::Prometheus, :prometheus do let(:all_metrics) { Gitlab::Metrics } let(:registry) { all_metrics.registry } diff --git a/spec/lib/gitlab/metrics/rack_middleware_spec.rb b/spec/lib/gitlab/metrics/rack_middleware_spec.rb index dd1dbf7a1f4..335e5a490a6 100644 --- a/spec/lib/gitlab/metrics/rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/rack_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::RackMiddleware do +RSpec.describe Gitlab::Metrics::RackMiddleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } diff --git a/spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb index f2f36ccad20..a85968dbd43 100644 --- a/spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/redis_rack_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::RedisRackMiddleware do +RSpec.describe Gitlab::Metrics::RedisRackMiddleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:env) { {} } diff --git a/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb b/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb index 6ee8acbf6fd..69b779d36eb 100644 --- a/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/requests_rack_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::RequestsRackMiddleware do +RSpec.describe Gitlab::Metrics::RequestsRackMiddleware do let(:app) { double('app') } subject { described_class.new(app) } diff --git a/spec/lib/gitlab/metrics/samplers/database_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/database_sampler_spec.rb index 087a0bfbac5..b94d19ff227 100644 --- a/spec/lib/gitlab/metrics/samplers/database_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/database_sampler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Samplers::DatabaseSampler do +RSpec.describe Gitlab::Metrics::Samplers::DatabaseSampler do subject { described_class.new } describe '#interval' do diff --git a/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb index df63f2ebe28..214649d3e7e 100644 --- a/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/puma_sampler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Samplers::PumaSampler do +RSpec.describe Gitlab::Metrics::Samplers::PumaSampler do subject { described_class.new } let(:null_metric) { double('null_metric', set: nil, observe: nil) } diff --git a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb index 9fc8dd10922..59a70ac74a5 100644 --- a/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/ruby_sampler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Samplers::RubySampler do +RSpec.describe Gitlab::Metrics::Samplers::RubySampler do let(:sampler) { described_class.new } let(:null_metric) { double('null_metric', set: nil, observe: nil) } diff --git a/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb b/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb index a64aae73d43..9f2180c4170 100644 --- a/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb +++ b/spec/lib/gitlab/metrics/samplers/unicorn_sampler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Samplers::UnicornSampler do +RSpec.describe Gitlab::Metrics::Samplers::UnicornSampler do subject { described_class.new(1.second) } describe '#sample' do diff --git a/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb b/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb index ea9e8fa6795..c800f5c1e06 100644 --- a/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb +++ b/spec/lib/gitlab/metrics/sidekiq_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::SidekiqMiddleware do +RSpec.describe Gitlab::Metrics::SidekiqMiddleware do let(:middleware) { described_class.new } let(:message) { { 'args' => ['test'], 'enqueued_at' => Time.new(2016, 6, 23, 6, 59).to_f } } diff --git a/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb b/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb index 857e54d3432..161527c01aa 100644 --- a/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb +++ b/spec/lib/gitlab/metrics/subscribers/action_view_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Subscribers::ActionView do +RSpec.describe Gitlab::Metrics::Subscribers::ActionView do let(:env) { {} } let(:transaction) { Gitlab::Metrics::WebTransaction.new(env) } diff --git a/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb b/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb index a78d048908d..701f170b8ed 100644 --- a/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb +++ b/spec/lib/gitlab/metrics/subscribers/active_record_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Subscribers::ActiveRecord do +RSpec.describe Gitlab::Metrics::Subscribers::ActiveRecord do let(:env) { {} } let(:transaction) { Gitlab::Metrics::WebTransaction.new(env) } let(:subscriber) { described_class.new } diff --git a/spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb b/spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb index ab0d89b2683..f7ac719c16a 100644 --- a/spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb +++ b/spec/lib/gitlab/metrics/subscribers/rails_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Subscribers::RailsCache do +RSpec.describe Gitlab::Metrics::Subscribers::RailsCache do let(:env) { {} } let(:transaction) { Gitlab::Metrics::WebTransaction.new(env) } let(:subscriber) { described_class.new } diff --git a/spec/lib/gitlab/metrics/system_spec.rb b/spec/lib/gitlab/metrics/system_spec.rb index abb6a0096d6..720bd5d79b3 100644 --- a/spec/lib/gitlab/metrics/system_spec.rb +++ b/spec/lib/gitlab/metrics/system_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::System do +RSpec.describe Gitlab::Metrics::System do context 'when /proc files exist' do # Fixtures pulled from: # Linux carbon 5.3.0-7648-generic #41~1586789791~19.10~9593806-Ubuntu SMP Mon Apr 13 17:50:40 UTC x86_64 x86_64 x86_64 GNU/Linux diff --git a/spec/lib/gitlab/metrics/transaction_spec.rb b/spec/lib/gitlab/metrics/transaction_spec.rb index 693ec3cb7e7..a838980deae 100644 --- a/spec/lib/gitlab/metrics/transaction_spec.rb +++ b/spec/lib/gitlab/metrics/transaction_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::Transaction do +RSpec.describe Gitlab::Metrics::Transaction do let(:transaction) { described_class.new } let(:sensitive_tags) do diff --git a/spec/lib/gitlab/metrics/web_transaction_spec.rb b/spec/lib/gitlab/metrics/web_transaction_spec.rb index 47f1bd3bd10..6ceba186660 100644 --- a/spec/lib/gitlab/metrics/web_transaction_spec.rb +++ b/spec/lib/gitlab/metrics/web_transaction_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics::WebTransaction do +RSpec.describe Gitlab::Metrics::WebTransaction do let(:env) { {} } let(:transaction) { described_class.new(env) } let(:prometheus_metric) { double("prometheus metric") } diff --git a/spec/lib/gitlab/metrics_spec.rb b/spec/lib/gitlab/metrics_spec.rb index 2ebe1958487..bdf72a3c288 100644 --- a/spec/lib/gitlab/metrics_spec.rb +++ b/spec/lib/gitlab/metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Metrics do +RSpec.describe Gitlab::Metrics do include StubENV describe '.settings' do diff --git a/spec/lib/gitlab/middleware/basic_health_check_spec.rb b/spec/lib/gitlab/middleware/basic_health_check_spec.rb index 07fda691ac8..0ca96de38da 100644 --- a/spec/lib/gitlab/middleware/basic_health_check_spec.rb +++ b/spec/lib/gitlab/middleware/basic_health_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::BasicHealthCheck do +RSpec.describe Gitlab::Middleware::BasicHealthCheck do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:env) { {} } diff --git a/spec/lib/gitlab/middleware/go_spec.rb b/spec/lib/gitlab/middleware/go_spec.rb index 43a489f6df0..1fffef53a82 100644 --- a/spec/lib/gitlab/middleware/go_spec.rb +++ b/spec/lib/gitlab/middleware/go_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::Go do +RSpec.describe Gitlab::Middleware::Go do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:env) do diff --git a/spec/lib/gitlab/middleware/handle_ip_spoof_attack_error_spec.rb b/spec/lib/gitlab/middleware/handle_ip_spoof_attack_error_spec.rb index ccfc5e93887..553ee589c62 100644 --- a/spec/lib/gitlab/middleware/handle_ip_spoof_attack_error_spec.rb +++ b/spec/lib/gitlab/middleware/handle_ip_spoof_attack_error_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::HandleIpSpoofAttackError do +RSpec.describe Gitlab::Middleware::HandleIpSpoofAttackError do let(:spoof_error) { ActionDispatch::RemoteIp::IpSpoofAttackError.new('sensitive') } let(:standard_error) { StandardError.new('error') } let(:app) { -> (env) { env.is_a?(Exception) ? raise(env) : env } } diff --git a/spec/lib/gitlab/middleware/multipart_spec.rb b/spec/lib/gitlab/middleware/multipart_spec.rb index 705164d5445..48aba7d4fb8 100644 --- a/spec/lib/gitlab/middleware/multipart_spec.rb +++ b/spec/lib/gitlab/middleware/multipart_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'tempfile' -describe Gitlab::Middleware::Multipart do +RSpec.describe Gitlab::Middleware::Multipart do include_context 'multipart middleware context' RSpec.shared_examples_for 'multipart upload files' do diff --git a/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb b/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb index 4f21bd14122..8f9b0aec9eb 100644 --- a/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb +++ b/spec/lib/gitlab/middleware/rails_queue_duration_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::RailsQueueDuration do +RSpec.describe Gitlab::Middleware::RailsQueueDuration do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:env) { {} } diff --git a/spec/lib/gitlab/middleware/read_only_spec.rb b/spec/lib/gitlab/middleware/read_only_spec.rb index c7e9b38e3ca..3bdf2a5077f 100644 --- a/spec/lib/gitlab/middleware/read_only_spec.rb +++ b/spec/lib/gitlab/middleware/read_only_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::ReadOnly do +RSpec.describe Gitlab::Middleware::ReadOnly do include Rack::Test::Methods using RSpec::Parameterized::TableSyntax diff --git a/spec/lib/gitlab/middleware/release_env_spec.rb b/spec/lib/gitlab/middleware/release_env_spec.rb index 3ca40f4ebd0..ca0ec0b9d83 100644 --- a/spec/lib/gitlab/middleware/release_env_spec.rb +++ b/spec/lib/gitlab/middleware/release_env_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::ReleaseEnv do +RSpec.describe Gitlab::Middleware::ReleaseEnv do let(:inner_app) { double(:app, call: 'yay') } let(:app) { described_class.new(inner_app) } let(:env) { { 'action_controller.instance' => 'something' } } diff --git a/spec/lib/gitlab/middleware/request_context_spec.rb b/spec/lib/gitlab/middleware/request_context_spec.rb index 1ed06a97c1e..431f4453e37 100644 --- a/spec/lib/gitlab/middleware/request_context_spec.rb +++ b/spec/lib/gitlab/middleware/request_context_spec.rb @@ -4,7 +4,7 @@ require 'rack' require 'request_store' require_relative '../../../support/helpers/next_instance_of' -describe Gitlab::Middleware::RequestContext do +RSpec.describe Gitlab::Middleware::RequestContext do include NextInstanceOf let(:app) { -> (env) {} } diff --git a/spec/lib/gitlab/middleware/same_site_cookies_spec.rb b/spec/lib/gitlab/middleware/same_site_cookies_spec.rb index 0cf1028a930..7c5262ca318 100644 --- a/spec/lib/gitlab/middleware/same_site_cookies_spec.rb +++ b/spec/lib/gitlab/middleware/same_site_cookies_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Middleware::SameSiteCookies do +RSpec.describe Gitlab::Middleware::SameSiteCookies do include Rack::Test::Methods let(:mock_app) do diff --git a/spec/lib/gitlab/monitor/demo_projects_spec.rb b/spec/lib/gitlab/monitor/demo_projects_spec.rb index 92024a3f9c1..262c78eb62e 100644 --- a/spec/lib/gitlab/monitor/demo_projects_spec.rb +++ b/spec/lib/gitlab/monitor/demo_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Monitor::DemoProjects do +RSpec.describe Gitlab::Monitor::DemoProjects do describe '#primary_keys' do subject { described_class.primary_keys } diff --git a/spec/lib/gitlab/multi_collection_paginator_spec.rb b/spec/lib/gitlab/multi_collection_paginator_spec.rb index f2049884b83..c7c8f4f969f 100644 --- a/spec/lib/gitlab/multi_collection_paginator_spec.rb +++ b/spec/lib/gitlab/multi_collection_paginator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::MultiCollectionPaginator do +RSpec.describe Gitlab::MultiCollectionPaginator do subject(:paginator) { described_class.new(Project.all.order(:id), Group.all.order(:id), per_page: 3) } it 'combines both collections' do diff --git a/spec/lib/gitlab/multi_destination_logger_spec.rb b/spec/lib/gitlab/multi_destination_logger_spec.rb index 7acd7906a26..e0d76afd9bf 100644 --- a/spec/lib/gitlab/multi_destination_logger_spec.rb +++ b/spec/lib/gitlab/multi_destination_logger_spec.rb @@ -31,7 +31,7 @@ class EmptyLogger < Gitlab::MultiDestinationLogger end end -describe Gitlab::MultiDestinationLogger do +RSpec.describe Gitlab::MultiDestinationLogger do after(:all) do TestLogger.loggers.each do |logger| log_file_path = "#{Rails.root}/log/#{logger.file_name}" diff --git a/spec/lib/gitlab/namespaced_session_store_spec.rb b/spec/lib/gitlab/namespaced_session_store_spec.rb index e177c44ad67..a569c86960c 100644 --- a/spec/lib/gitlab/namespaced_session_store_spec.rb +++ b/spec/lib/gitlab/namespaced_session_store_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::NamespacedSessionStore do +RSpec.describe Gitlab::NamespacedSessionStore do let(:key) { :some_key } context 'current session' do diff --git a/spec/lib/gitlab/no_cache_headers_spec.rb b/spec/lib/gitlab/no_cache_headers_spec.rb index c7a73f0e2dc..513a39978e6 100644 --- a/spec/lib/gitlab/no_cache_headers_spec.rb +++ b/spec/lib/gitlab/no_cache_headers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::NoCacheHeaders do +RSpec.describe Gitlab::NoCacheHeaders do before do stub_const('NoCacheTester', Class.new) NoCacheTester.class_eval do diff --git a/spec/lib/gitlab/noteable_metadata_spec.rb b/spec/lib/gitlab/noteable_metadata_spec.rb index b12a1825f04..98c07fc9f62 100644 --- a/spec/lib/gitlab/noteable_metadata_spec.rb +++ b/spec/lib/gitlab/noteable_metadata_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::NoteableMetadata do +RSpec.describe Gitlab::NoteableMetadata do subject { Class.new { include Gitlab::NoteableMetadata }.new } it 'returns an empty Hash if an empty collection is provided' do diff --git a/spec/lib/gitlab/null_request_store_spec.rb b/spec/lib/gitlab/null_request_store_spec.rb index c023dac53ad..f600af2e31f 100644 --- a/spec/lib/gitlab/null_request_store_spec.rb +++ b/spec/lib/gitlab/null_request_store_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::NullRequestStore do +RSpec.describe Gitlab::NullRequestStore do let(:null_store) { described_class.new } describe '#store' do diff --git a/spec/lib/gitlab/object_hierarchy_spec.rb b/spec/lib/gitlab/object_hierarchy_spec.rb index b72aeb6d601..ef2d4fa0cbf 100644 --- a/spec/lib/gitlab/object_hierarchy_spec.rb +++ b/spec/lib/gitlab/object_hierarchy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ObjectHierarchy do +RSpec.describe Gitlab::ObjectHierarchy do let!(:parent) { create(:group) } let!(:child1) { create(:group, parent: parent) } let!(:child2) { create(:group, parent: child1) } diff --git a/spec/lib/gitlab/octokit/middleware_spec.rb b/spec/lib/gitlab/octokit/middleware_spec.rb index 8aa6d17ac9e..bc4d95738c7 100644 --- a/spec/lib/gitlab/octokit/middleware_spec.rb +++ b/spec/lib/gitlab/octokit/middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Octokit::Middleware do +RSpec.describe Gitlab::Octokit::Middleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } diff --git a/spec/lib/gitlab/omniauth_initializer_spec.rb b/spec/lib/gitlab/omniauth_initializer_spec.rb index 4afe4545891..a38dffcfce0 100644 --- a/spec/lib/gitlab/omniauth_initializer_spec.rb +++ b/spec/lib/gitlab/omniauth_initializer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::OmniauthInitializer do +RSpec.describe Gitlab::OmniauthInitializer do let(:devise_config) { class_double(Devise) } subject { described_class.new(devise_config) } diff --git a/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb b/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb index 36405daed5a..f65b247d5d7 100644 --- a/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb +++ b/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::OmniauthLogging::JSONFormatter do +RSpec.describe Gitlab::OmniauthLogging::JSONFormatter do it "generates log in json format" do Timecop.freeze(Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do expect(subject.call(:info, Time.now, 'omniauth', 'log message')) diff --git a/spec/lib/gitlab/optimistic_locking_spec.rb b/spec/lib/gitlab/optimistic_locking_spec.rb index 9dfcb775dfa..0862a9c880e 100644 --- a/spec/lib/gitlab/optimistic_locking_spec.rb +++ b/spec/lib/gitlab/optimistic_locking_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::OptimisticLocking do +RSpec.describe Gitlab::OptimisticLocking do let!(:pipeline) { create(:ci_pipeline) } let!(:pipeline2) { Ci::Pipeline.find(pipeline.id) } diff --git a/spec/lib/gitlab/other_markup_spec.rb b/spec/lib/gitlab/other_markup_spec.rb index b5cf5b0999d..26e60251abb 100644 --- a/spec/lib/gitlab/other_markup_spec.rb +++ b/spec/lib/gitlab/other_markup_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::OtherMarkup do +RSpec.describe Gitlab::OtherMarkup do let(:context) { {} } context "XSS Checks" do diff --git a/spec/lib/gitlab/otp_key_rotator_spec.rb b/spec/lib/gitlab/otp_key_rotator_spec.rb index f5a567d5ea0..e328b190db4 100644 --- a/spec/lib/gitlab/otp_key_rotator_spec.rb +++ b/spec/lib/gitlab/otp_key_rotator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::OtpKeyRotator do +RSpec.describe Gitlab::OtpKeyRotator do let(:file) { Tempfile.new("otp-key-rotator-test") } let(:filename) { file.path } let(:old_key) { Gitlab::Application.secrets.otp_key_base } diff --git a/spec/lib/gitlab/pages_spec.rb b/spec/lib/gitlab/pages_spec.rb index 5889689cb81..9f85efd56e6 100644 --- a/spec/lib/gitlab/pages_spec.rb +++ b/spec/lib/gitlab/pages_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Pages do +RSpec.describe Gitlab::Pages do using RSpec::Parameterized::TableSyntax let(:pages_secret) { SecureRandom.random_bytes(Gitlab::Pages::SECRET_LENGTH) } diff --git a/spec/lib/gitlab/pagination/keyset/page_spec.rb b/spec/lib/gitlab/pagination/keyset/page_spec.rb index c5ca27231d8..3f4ef192b5a 100644 --- a/spec/lib/gitlab/pagination/keyset/page_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Pagination::Keyset::Page do +RSpec.describe Gitlab::Pagination::Keyset::Page do describe '#per_page' do it 'limits to a maximum of 100 records per page' do per_page = described_class.new(per_page: 101).per_page diff --git a/spec/lib/gitlab/pagination/keyset/pager_spec.rb b/spec/lib/gitlab/pagination/keyset/pager_spec.rb index 3ad1bee7225..a3169142279 100644 --- a/spec/lib/gitlab/pagination/keyset/pager_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/pager_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Pagination::Keyset::Pager do +RSpec.describe Gitlab::Pagination::Keyset::Pager do let(:relation) { Project.all.order(id: :asc) } let(:request) { double('request', page: page, apply_headers: nil) } let(:page) { Gitlab::Pagination::Keyset::Page.new(order_by: { id: :asc }, per_page: 3) } diff --git a/spec/lib/gitlab/pagination/keyset/request_context_spec.rb b/spec/lib/gitlab/pagination/keyset/request_context_spec.rb index d6d5340f38b..d4255176a4e 100644 --- a/spec/lib/gitlab/pagination/keyset/request_context_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/request_context_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Pagination::Keyset::RequestContext do +RSpec.describe Gitlab::Pagination::Keyset::RequestContext do let(:request) { double('request', params: params) } describe '#page' do diff --git a/spec/lib/gitlab/pagination/keyset_spec.rb b/spec/lib/gitlab/pagination/keyset_spec.rb index 0ac40080872..81dc40b35d5 100644 --- a/spec/lib/gitlab/pagination/keyset_spec.rb +++ b/spec/lib/gitlab/pagination/keyset_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Pagination::Keyset do +RSpec.describe Gitlab::Pagination::Keyset do describe '.available_for_type?' do subject { described_class } diff --git a/spec/lib/gitlab/pagination/offset_pagination_spec.rb b/spec/lib/gitlab/pagination/offset_pagination_spec.rb index 9c7dd385726..be20f0194f7 100644 --- a/spec/lib/gitlab/pagination/offset_pagination_spec.rb +++ b/spec/lib/gitlab/pagination/offset_pagination_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Pagination::OffsetPagination do +RSpec.describe Gitlab::Pagination::OffsetPagination do let(:resource) { Project.all } let(:custom_port) { 8080 } let(:incoming_api_projects_url) { "#{Gitlab.config.gitlab.url}:#{custom_port}/api/v4/projects" } diff --git a/spec/lib/gitlab/patch/action_dispatch_journey_formatter_spec.rb b/spec/lib/gitlab/patch/action_dispatch_journey_formatter_spec.rb index b1c7f73489d..ca74f7573f3 100644 --- a/spec/lib/gitlab/patch/action_dispatch_journey_formatter_spec.rb +++ b/spec/lib/gitlab/patch/action_dispatch_journey_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Patch::ActionDispatchJourneyFormatter do +RSpec.describe Gitlab::Patch::ActionDispatchJourneyFormatter do let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } let(:pipeline) { create(:ci_empty_pipeline, project: project) } diff --git a/spec/lib/gitlab/patch/draw_route_spec.rb b/spec/lib/gitlab/patch/draw_route_spec.rb index 4009b903dc3..4d1c7bf9fcf 100644 --- a/spec/lib/gitlab/patch/draw_route_spec.rb +++ b/spec/lib/gitlab/patch/draw_route_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Patch::DrawRoute do +RSpec.describe Gitlab::Patch::DrawRoute do subject do Class.new do include Gitlab::Patch::DrawRoute diff --git a/spec/lib/gitlab/patch/prependable_spec.rb b/spec/lib/gitlab/patch/prependable_spec.rb index 255324f89d5..8feab57a8f3 100644 --- a/spec/lib/gitlab/patch/prependable_spec.rb +++ b/spec/lib/gitlab/patch/prependable_spec.rb @@ -5,7 +5,7 @@ require 'fast_spec_helper' # Patching ActiveSupport::Concern require_relative '../../../../config/initializers/0_as_concern' -describe Gitlab::Patch::Prependable do +RSpec.describe Gitlab::Patch::Prependable do before do @prepended_modules = [] end diff --git a/spec/lib/gitlab/path_regex_spec.rb b/spec/lib/gitlab/path_regex_spec.rb index ac506c49100..7cecc29afa4 100644 --- a/spec/lib/gitlab/path_regex_spec.rb +++ b/spec/lib/gitlab/path_regex_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PathRegex do +RSpec.describe Gitlab::PathRegex do let(:starting_with_namespace) { %r{^/\*namespace_id/:(project_)?id} } let(:non_param_parts) { %r{[^:*][a-z\-_/]*} } let(:any_other_path_part) { %r{[a-z\-_/:]*} } diff --git a/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb b/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb index 3b92261f0fe..735f04b3bce 100644 --- a/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb +++ b/spec/lib/gitlab/performance_bar/with_top_level_warnings_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'rspec-parameterized' -describe Gitlab::PerformanceBar::WithTopLevelWarnings do +RSpec.describe Gitlab::PerformanceBar::WithTopLevelWarnings do using RSpec::Parameterized::TableSyntax subject { Module.new } diff --git a/spec/lib/gitlab/performance_bar_spec.rb b/spec/lib/gitlab/performance_bar_spec.rb index 7b79cc82816..12916c41f0f 100644 --- a/spec/lib/gitlab/performance_bar_spec.rb +++ b/spec/lib/gitlab/performance_bar_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PerformanceBar do +RSpec.describe Gitlab::PerformanceBar do it { expect(described_class.l1_cache_backend).to eq(Gitlab::ProcessMemoryCache.cache_backend) } it { expect(described_class.l2_cache_backend).to eq(Rails.cache) } diff --git a/spec/lib/gitlab/phabricator_import/cache/map_spec.rb b/spec/lib/gitlab/phabricator_import/cache/map_spec.rb index 4935ef1bd90..0f760852a68 100644 --- a/spec/lib/gitlab/phabricator_import/cache/map_spec.rb +++ b/spec/lib/gitlab/phabricator_import/cache/map_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PhabricatorImport::Cache::Map, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::PhabricatorImport::Cache::Map, :clean_gitlab_redis_cache do let_it_be(:project) { create(:project) } let(:redis) { Gitlab::Redis::Cache } diff --git a/spec/lib/gitlab/phabricator_import/conduit/client_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/client_spec.rb index 542b3cd060f..dad349f3255 100644 --- a/spec/lib/gitlab/phabricator_import/conduit/client_spec.rb +++ b/spec/lib/gitlab/phabricator_import/conduit/client_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Conduit::Client do +RSpec.describe Gitlab::PhabricatorImport::Conduit::Client do let(:client) do described_class.new('https://see-ya-later.phabricator', 'api-token') end diff --git a/spec/lib/gitlab/phabricator_import/conduit/maniphest_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/maniphest_spec.rb index 0d7714649b9..e655a39a28d 100644 --- a/spec/lib/gitlab/phabricator_import/conduit/maniphest_spec.rb +++ b/spec/lib/gitlab/phabricator_import/conduit/maniphest_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Conduit::Maniphest do +RSpec.describe Gitlab::PhabricatorImport::Conduit::Maniphest do let(:maniphest) do described_class.new(phabricator_url: 'https://see-ya-later.phabricator', api_token: 'api-token') end diff --git a/spec/lib/gitlab/phabricator_import/conduit/response_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/response_spec.rb index 1ffb811cbc1..2788c7e595b 100644 --- a/spec/lib/gitlab/phabricator_import/conduit/response_spec.rb +++ b/spec/lib/gitlab/phabricator_import/conduit/response_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Conduit::Response do +RSpec.describe Gitlab::PhabricatorImport::Conduit::Response do let(:response) { described_class.new(Gitlab::Json.parse(fixture_file('phabricator_responses/maniphest.search.json')))} let(:error_response) { described_class.new(Gitlab::Json.parse(fixture_file('phabricator_responses/auth_failed.json'))) } diff --git a/spec/lib/gitlab/phabricator_import/conduit/tasks_response_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/tasks_response_spec.rb index 2cc12ee0165..4e56dead5c0 100644 --- a/spec/lib/gitlab/phabricator_import/conduit/tasks_response_spec.rb +++ b/spec/lib/gitlab/phabricator_import/conduit/tasks_response_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Conduit::TasksResponse do +RSpec.describe Gitlab::PhabricatorImport::Conduit::TasksResponse do let(:conduit_response) do Gitlab::PhabricatorImport::Conduit::Response .new(Gitlab::Json.parse(fixture_file('phabricator_responses/maniphest.search.json'))) diff --git a/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb index f3928f390bc..d38421c9405 100644 --- a/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb +++ b/spec/lib/gitlab/phabricator_import/conduit/user_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Conduit::User do +RSpec.describe Gitlab::PhabricatorImport::Conduit::User do let(:user_client) do described_class.new(phabricator_url: 'https://see-ya-later.phabricator', api_token: 'api-token') end diff --git a/spec/lib/gitlab/phabricator_import/conduit/users_response_spec.rb b/spec/lib/gitlab/phabricator_import/conduit/users_response_spec.rb index 999a986b73c..ebbb2c0598c 100644 --- a/spec/lib/gitlab/phabricator_import/conduit/users_response_spec.rb +++ b/spec/lib/gitlab/phabricator_import/conduit/users_response_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Conduit::UsersResponse do +RSpec.describe Gitlab::PhabricatorImport::Conduit::UsersResponse do let(:conduit_response) do Gitlab::PhabricatorImport::Conduit::Response .new(Gitlab::Json.parse(fixture_file('phabricator_responses/user.search.json'))) diff --git a/spec/lib/gitlab/phabricator_import/importer_spec.rb b/spec/lib/gitlab/phabricator_import/importer_spec.rb index 2715b785379..e78024c35c1 100644 --- a/spec/lib/gitlab/phabricator_import/importer_spec.rb +++ b/spec/lib/gitlab/phabricator_import/importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PhabricatorImport::Importer do +RSpec.describe Gitlab::PhabricatorImport::Importer do it { expect(described_class).to be_async } it "acts like it's importing repositories" do diff --git a/spec/lib/gitlab/phabricator_import/issues/importer_spec.rb b/spec/lib/gitlab/phabricator_import/issues/importer_spec.rb index 02dafd4bb3b..63ba575aea3 100644 --- a/spec/lib/gitlab/phabricator_import/issues/importer_spec.rb +++ b/spec/lib/gitlab/phabricator_import/issues/importer_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Issues::Importer do +RSpec.describe Gitlab::PhabricatorImport::Issues::Importer do let(:project) { create(:project) } let(:response) do diff --git a/spec/lib/gitlab/phabricator_import/issues/task_importer_spec.rb b/spec/lib/gitlab/phabricator_import/issues/task_importer_spec.rb index 79f11d7fae6..3cb15f08627 100644 --- a/spec/lib/gitlab/phabricator_import/issues/task_importer_spec.rb +++ b/spec/lib/gitlab/phabricator_import/issues/task_importer_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::Issues::TaskImporter do +RSpec.describe Gitlab::PhabricatorImport::Issues::TaskImporter do let_it_be(:project) { create(:project) } let(:task) do Gitlab::PhabricatorImport::Representation::Task.new( diff --git a/spec/lib/gitlab/phabricator_import/project_creator_spec.rb b/spec/lib/gitlab/phabricator_import/project_creator_spec.rb index 0b6a71290ed..016aa0abe4d 100644 --- a/spec/lib/gitlab/phabricator_import/project_creator_spec.rb +++ b/spec/lib/gitlab/phabricator_import/project_creator_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::PhabricatorImport::ProjectCreator do +RSpec.describe Gitlab::PhabricatorImport::ProjectCreator do let(:user) { create(:user) } let(:params) do { path: 'new-phab-import', diff --git a/spec/lib/gitlab/phabricator_import/representation/task_spec.rb b/spec/lib/gitlab/phabricator_import/representation/task_spec.rb index 5603a6961d6..25a52af3a7a 100644 --- a/spec/lib/gitlab/phabricator_import/representation/task_spec.rb +++ b/spec/lib/gitlab/phabricator_import/representation/task_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PhabricatorImport::Representation::Task do +RSpec.describe Gitlab::PhabricatorImport::Representation::Task do subject(:task) do described_class.new( { diff --git a/spec/lib/gitlab/phabricator_import/representation/user_spec.rb b/spec/lib/gitlab/phabricator_import/representation/user_spec.rb index f52467a0cf1..f51be0f7d8d 100644 --- a/spec/lib/gitlab/phabricator_import/representation/user_spec.rb +++ b/spec/lib/gitlab/phabricator_import/representation/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PhabricatorImport::Representation::User do +RSpec.describe Gitlab::PhabricatorImport::Representation::User do subject(:user) do described_class.new( { diff --git a/spec/lib/gitlab/phabricator_import/user_finder_spec.rb b/spec/lib/gitlab/phabricator_import/user_finder_spec.rb index f260e38b7c8..e63ad6e6626 100644 --- a/spec/lib/gitlab/phabricator_import/user_finder_spec.rb +++ b/spec/lib/gitlab/phabricator_import/user_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::PhabricatorImport::UserFinder, :clean_gitlab_redis_cache do let(:project) { create(:project, namespace: create(:group)) } subject(:finder) { described_class.new(project, %w[first-phid second-phid]) } diff --git a/spec/lib/gitlab/phabricator_import/worker_state_spec.rb b/spec/lib/gitlab/phabricator_import/worker_state_spec.rb index 51514dd0ffd..4a07e28440f 100644 --- a/spec/lib/gitlab/phabricator_import/worker_state_spec.rb +++ b/spec/lib/gitlab/phabricator_import/worker_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PhabricatorImport::WorkerState, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::PhabricatorImport::WorkerState, :clean_gitlab_redis_shared_state do subject(:state) { described_class.new('weird-project-id') } let(:key) { 'phabricator-import/jobs/project-weird-project-id/job-count' } diff --git a/spec/lib/gitlab/polling_interval_spec.rb b/spec/lib/gitlab/polling_interval_spec.rb index 31569b2c51e..bf0eaf80d3b 100644 --- a/spec/lib/gitlab/polling_interval_spec.rb +++ b/spec/lib/gitlab/polling_interval_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PollingInterval do +RSpec.describe Gitlab::PollingInterval do let(:polling_interval) { described_class } describe '.set_header' do diff --git a/spec/lib/gitlab/popen/runner_spec.rb b/spec/lib/gitlab/popen/runner_spec.rb index de19106eaee..5f72852c63e 100644 --- a/spec/lib/gitlab/popen/runner_spec.rb +++ b/spec/lib/gitlab/popen/runner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Popen::Runner do +RSpec.describe Gitlab::Popen::Runner do subject { described_class.new } describe '#run' do diff --git a/spec/lib/gitlab/popen_spec.rb b/spec/lib/gitlab/popen_spec.rb index b398381a7e0..891482a5f17 100644 --- a/spec/lib/gitlab/popen_spec.rb +++ b/spec/lib/gitlab/popen_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Popen do +RSpec.describe Gitlab::Popen do let(:path) { Rails.root.join('tmp').to_s } before do diff --git a/spec/lib/gitlab/private_commit_email_spec.rb b/spec/lib/gitlab/private_commit_email_spec.rb index 7b7a0f7c0ca..502cc82fd8d 100644 --- a/spec/lib/gitlab/private_commit_email_spec.rb +++ b/spec/lib/gitlab/private_commit_email_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PrivateCommitEmail do +RSpec.describe Gitlab::PrivateCommitEmail do let(:hostname) { Gitlab::CurrentSettings.current_application_settings.commit_email_hostname } let(:id) { 1 } let(:valid_email) { "#{id}-foo@#{hostname}" } diff --git a/spec/lib/gitlab/process_memory_cache/helper_spec.rb b/spec/lib/gitlab/process_memory_cache/helper_spec.rb index 890642b1d5e..27d7fd0bdcf 100644 --- a/spec/lib/gitlab/process_memory_cache/helper_spec.rb +++ b/spec/lib/gitlab/process_memory_cache/helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ProcessMemoryCache::Helper, :use_clean_rails_memory_store_caching do +RSpec.describe Gitlab::ProcessMemoryCache::Helper, :use_clean_rails_memory_store_caching do let(:minimal_test_class) do Class.new do include Gitlab::ProcessMemoryCache::Helper diff --git a/spec/lib/gitlab/profiler_spec.rb b/spec/lib/gitlab/profiler_spec.rb index 6440f74a49a..3b3b0eddc21 100644 --- a/spec/lib/gitlab/profiler_spec.rb +++ b/spec/lib/gitlab/profiler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Profiler do +RSpec.describe Gitlab::Profiler do let(:null_logger) { Logger.new('/dev/null') } let(:private_token) { 'private' } diff --git a/spec/lib/gitlab/project_authorizations_spec.rb b/spec/lib/gitlab/project_authorizations_spec.rb index 261e44bc5fa..5ff07dcec4f 100644 --- a/spec/lib/gitlab/project_authorizations_spec.rb +++ b/spec/lib/gitlab/project_authorizations_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ProjectAuthorizations do +RSpec.describe Gitlab::ProjectAuthorizations do def map_access_levels(rows) rows.each_with_object({}) do |row, hash| hash[row.project_id] = row.access_level diff --git a/spec/lib/gitlab/project_search_results_spec.rb b/spec/lib/gitlab/project_search_results_spec.rb index aa52949ed60..75a3fe06632 100644 --- a/spec/lib/gitlab/project_search_results_spec.rb +++ b/spec/lib/gitlab/project_search_results_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ProjectSearchResults do +RSpec.describe Gitlab::ProjectSearchResults do include SearchHelpers let(:user) { create(:user) } diff --git a/spec/lib/gitlab/project_template_spec.rb b/spec/lib/gitlab/project_template_spec.rb index 35f79042df0..127c22734b9 100644 --- a/spec/lib/gitlab/project_template_spec.rb +++ b/spec/lib/gitlab/project_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ProjectTemplate do +RSpec.describe Gitlab::ProjectTemplate do describe '.all' do it 'returns all templates' do expected = %w[ diff --git a/spec/lib/gitlab/project_transfer_spec.rb b/spec/lib/gitlab/project_transfer_spec.rb index d54817ea02b..87c4014264f 100644 --- a/spec/lib/gitlab/project_transfer_spec.rb +++ b/spec/lib/gitlab/project_transfer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ProjectTransfer do +RSpec.describe Gitlab::ProjectTransfer do before do @root_dir = File.join(Rails.root, "public", "uploads") @project_transfer = described_class.new diff --git a/spec/lib/gitlab/prometheus/adapter_spec.rb b/spec/lib/gitlab/prometheus/adapter_spec.rb index afee95467fa..4762e4ad108 100644 --- a/spec/lib/gitlab/prometheus/adapter_spec.rb +++ b/spec/lib/gitlab/prometheus/adapter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Adapter do +RSpec.describe Gitlab::Prometheus::Adapter do let_it_be(:project) { create(:project) } let_it_be(:cluster, reload: true) { create(:cluster, :provided_by_user, environment_scope: '*', projects: [project]) } diff --git a/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb b/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb index 3f97a69b5eb..3c7496cabd0 100644 --- a/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb +++ b/spec/lib/gitlab/prometheus/additional_metrics_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::AdditionalMetricsParser do +RSpec.describe Gitlab::Prometheus::AdditionalMetricsParser do include Prometheus::MetricBuilders let(:parser_error_class) { Gitlab::Prometheus::ParsingError } diff --git a/spec/lib/gitlab/prometheus/internal_spec.rb b/spec/lib/gitlab/prometheus/internal_spec.rb index 884bdcb4e9b..1254610fe32 100644 --- a/spec/lib/gitlab/prometheus/internal_spec.rb +++ b/spec/lib/gitlab/prometheus/internal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Internal do +RSpec.describe Gitlab::Prometheus::Internal do let(:listen_address) { 'localhost:9090' } let(:prometheus_settings) do diff --git a/spec/lib/gitlab/prometheus/metric_group_spec.rb b/spec/lib/gitlab/prometheus/metric_group_spec.rb index 787f14daf47..a68cdfe5fb2 100644 --- a/spec/lib/gitlab/prometheus/metric_group_spec.rb +++ b/spec/lib/gitlab/prometheus/metric_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::MetricGroup do +RSpec.describe Gitlab::Prometheus::MetricGroup do describe '.common_metrics' do let!(:project_metric) { create(:prometheus_metric) } let!(:common_metric_group_a) { create(:prometheus_metric, :common, group: :aws_elb) } diff --git a/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb index 55e89395452..8abc944eeb1 100644 --- a/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/additional_metrics_deployment_query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::AdditionalMetricsDeploymentQuery do +RSpec.describe Gitlab::Prometheus::Queries::AdditionalMetricsDeploymentQuery do around do |example| Timecop.freeze(Time.local(2008, 9, 1, 12, 0, 0)) { example.run } end diff --git a/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb index 95df8880b90..f5911963108 100644 --- a/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/additional_metrics_environment_query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::AdditionalMetricsEnvironmentQuery do +RSpec.describe Gitlab::Prometheus::Queries::AdditionalMetricsEnvironmentQuery do around do |example| Timecop.freeze { example.run } end diff --git a/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb b/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb index 4af233291f6..4683c4eae28 100644 --- a/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/deployment_query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::DeploymentQuery do +RSpec.describe Gitlab::Prometheus::Queries::DeploymentQuery do let(:environment) { create(:environment, slug: 'environment-slug') } let(:deployment) { create(:deployment, environment: environment) } let(:client) { double('prometheus_client') } diff --git a/spec/lib/gitlab/prometheus/queries/knative_invocation_query_spec.rb b/spec/lib/gitlab/prometheus/queries/knative_invocation_query_spec.rb index 8eefd22bd29..ff48b9ada90 100644 --- a/spec/lib/gitlab/prometheus/queries/knative_invocation_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/knative_invocation_query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::KnativeInvocationQuery do +RSpec.describe Gitlab::Prometheus::Queries::KnativeInvocationQuery do include PrometheusHelpers let(:project) { create(:project) } diff --git a/spec/lib/gitlab/prometheus/queries/matched_metric_query_spec.rb b/spec/lib/gitlab/prometheus/queries/matched_metric_query_spec.rb index 35034d814bf..117ca798022 100644 --- a/spec/lib/gitlab/prometheus/queries/matched_metric_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/matched_metric_query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::MatchedMetricQuery do +RSpec.describe Gitlab::Prometheus::Queries::MatchedMetricQuery do include Prometheus::MetricBuilders let(:metric_group_class) { Gitlab::Prometheus::MetricGroup } diff --git a/spec/lib/gitlab/prometheus/queries/validate_query_spec.rb b/spec/lib/gitlab/prometheus/queries/validate_query_spec.rb index 9c0170718f4..045c063ab34 100644 --- a/spec/lib/gitlab/prometheus/queries/validate_query_spec.rb +++ b/spec/lib/gitlab/prometheus/queries/validate_query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::Queries::ValidateQuery do +RSpec.describe Gitlab::Prometheus::Queries::ValidateQuery do include PrometheusHelpers let(:api_url) { 'https://prometheus.example.com' } diff --git a/spec/lib/gitlab/prometheus/query_variables_spec.rb b/spec/lib/gitlab/prometheus/query_variables_spec.rb index 7dfa4de35d6..1422d48152a 100644 --- a/spec/lib/gitlab/prometheus/query_variables_spec.rb +++ b/spec/lib/gitlab/prometheus/query_variables_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Prometheus::QueryVariables do +RSpec.describe Gitlab::Prometheus::QueryVariables do describe '.call' do let(:project) { environment.project } let(:environment) { create(:environment) } diff --git a/spec/lib/gitlab/prometheus_client_spec.rb b/spec/lib/gitlab/prometheus_client_spec.rb index 749192e5795..fa7c0e0d591 100644 --- a/spec/lib/gitlab/prometheus_client_spec.rb +++ b/spec/lib/gitlab/prometheus_client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PrometheusClient do +RSpec.describe Gitlab::PrometheusClient do include PrometheusHelpers subject { described_class.new('https://prometheus.example.com') } diff --git a/spec/lib/gitlab/puma_logging/json_formatter_spec.rb b/spec/lib/gitlab/puma_logging/json_formatter_spec.rb index f7f5b99d5e5..64ace09e01b 100644 --- a/spec/lib/gitlab/puma_logging/json_formatter_spec.rb +++ b/spec/lib/gitlab/puma_logging/json_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PumaLogging::JSONFormatter do +RSpec.describe Gitlab::PumaLogging::JSONFormatter do it "generate json format with timestamp and pid" do Timecop.freeze( Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do expect(subject.call('log message')).to eq "{\"timestamp\":\"2019-12-04T09:10:11.123Z\",\"pid\":#{Process.pid},\"message\":\"log message\"}" diff --git a/spec/lib/gitlab/push_options_spec.rb b/spec/lib/gitlab/push_options_spec.rb index fc9e421bea6..8f43943e2d1 100644 --- a/spec/lib/gitlab/push_options_spec.rb +++ b/spec/lib/gitlab/push_options_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::PushOptions do +RSpec.describe Gitlab::PushOptions do describe 'namespace and key validation' do it 'ignores unrecognised namespaces' do options = described_class.new(['invalid.key=value']) diff --git a/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb b/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb index 2db6d2fb60f..a8dd482c7b8 100644 --- a/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb +++ b/spec/lib/gitlab/query_limiting/active_support_subscriber_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QueryLimiting::ActiveSupportSubscriber do +RSpec.describe Gitlab::QueryLimiting::ActiveSupportSubscriber do let(:transaction) { instance_double(Gitlab::QueryLimiting::Transaction, increment: true) } before do diff --git a/spec/lib/gitlab/query_limiting/middleware_spec.rb b/spec/lib/gitlab/query_limiting/middleware_spec.rb index f397843df54..cae6df8cdd5 100644 --- a/spec/lib/gitlab/query_limiting/middleware_spec.rb +++ b/spec/lib/gitlab/query_limiting/middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QueryLimiting::Middleware do +RSpec.describe Gitlab::QueryLimiting::Middleware do describe '#call' do it 'runs the application with query limiting in place' do middleware = described_class.new(-> (env) { env }) diff --git a/spec/lib/gitlab/query_limiting/transaction_spec.rb b/spec/lib/gitlab/query_limiting/transaction_spec.rb index 4e906314b5a..331c3c1d8b0 100644 --- a/spec/lib/gitlab/query_limiting/transaction_spec.rb +++ b/spec/lib/gitlab/query_limiting/transaction_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QueryLimiting::Transaction do +RSpec.describe Gitlab::QueryLimiting::Transaction do after do Thread.current[described_class::THREAD_KEY] = nil end diff --git a/spec/lib/gitlab/query_limiting_spec.rb b/spec/lib/gitlab/query_limiting_spec.rb index e9c6bbc35a3..0fcd865567d 100644 --- a/spec/lib/gitlab/query_limiting_spec.rb +++ b/spec/lib/gitlab/query_limiting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QueryLimiting do +RSpec.describe Gitlab::QueryLimiting do describe '.enable?' do it 'returns true in a test environment' do expect(described_class.enable?).to eq(true) diff --git a/spec/lib/gitlab/quick_actions/command_definition_spec.rb b/spec/lib/gitlab/quick_actions/command_definition_spec.rb index 45b710adf07..d63c21954f2 100644 --- a/spec/lib/gitlab/quick_actions/command_definition_spec.rb +++ b/spec/lib/gitlab/quick_actions/command_definition_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QuickActions::CommandDefinition do +RSpec.describe Gitlab::QuickActions::CommandDefinition do subject { described_class.new(:command) } describe "#all_names" do diff --git a/spec/lib/gitlab/quick_actions/dsl_spec.rb b/spec/lib/gitlab/quick_actions/dsl_spec.rb index 1145a7edc85..f990abfb253 100644 --- a/spec/lib/gitlab/quick_actions/dsl_spec.rb +++ b/spec/lib/gitlab/quick_actions/dsl_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QuickActions::Dsl do +RSpec.describe Gitlab::QuickActions::Dsl do before :all do DummyClass = Struct.new(:project) do include Gitlab::QuickActions::Dsl diff --git a/spec/lib/gitlab/quick_actions/extractor_spec.rb b/spec/lib/gitlab/quick_actions/extractor_spec.rb index 6ea597bf01e..f4104b78d5c 100644 --- a/spec/lib/gitlab/quick_actions/extractor_spec.rb +++ b/spec/lib/gitlab/quick_actions/extractor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QuickActions::Extractor do +RSpec.describe Gitlab::QuickActions::Extractor do let(:definitions) do Class.new do include Gitlab::QuickActions::Dsl diff --git a/spec/lib/gitlab/quick_actions/spend_time_and_date_separator_spec.rb b/spec/lib/gitlab/quick_actions/spend_time_and_date_separator_spec.rb index fd149cd1114..0b012bfd970 100644 --- a/spec/lib/gitlab/quick_actions/spend_time_and_date_separator_spec.rb +++ b/spec/lib/gitlab/quick_actions/spend_time_and_date_separator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QuickActions::SpendTimeAndDateSeparator do +RSpec.describe Gitlab::QuickActions::SpendTimeAndDateSeparator do subject { described_class } shared_examples 'arg line with invalid parameters' do diff --git a/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb b/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb index d1a44e2feeb..b28ac49b4ea 100644 --- a/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb +++ b/spec/lib/gitlab/quick_actions/substitution_definition_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::QuickActions::SubstitutionDefinition do +RSpec.describe Gitlab::QuickActions::SubstitutionDefinition do let(:content) do <<EOF Hello! Let's do this! diff --git a/spec/lib/gitlab/rate_limit_helpers_spec.rb b/spec/lib/gitlab/rate_limit_helpers_spec.rb index 5ab79a2bbfe..e7d4c69d47b 100644 --- a/spec/lib/gitlab/rate_limit_helpers_spec.rb +++ b/spec/lib/gitlab/rate_limit_helpers_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RateLimitHelpers, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::RateLimitHelpers, :clean_gitlab_redis_shared_state do let(:limiter_class) do Class.new do include ::Gitlab::RateLimitHelpers diff --git a/spec/lib/gitlab/reactive_cache_set_cache_spec.rb b/spec/lib/gitlab/reactive_cache_set_cache_spec.rb index a0d8f15ba1b..19fb2ada476 100644 --- a/spec/lib/gitlab/reactive_cache_set_cache_spec.rb +++ b/spec/lib/gitlab/reactive_cache_set_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ReactiveCacheSetCache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::ReactiveCacheSetCache, :clean_gitlab_redis_cache do let_it_be(:project) { create(:project) } let(:cache_prefix) { 'cache_prefix' } let(:expires_in) { 10.minutes } diff --git a/spec/lib/gitlab/redis/boolean_spec.rb b/spec/lib/gitlab/redis/boolean_spec.rb index bfacf0c448b..9c233ba089f 100644 --- a/spec/lib/gitlab/redis/boolean_spec.rb +++ b/spec/lib/gitlab/redis/boolean_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::Redis::Boolean do +RSpec.describe Gitlab::Redis::Boolean do subject(:redis_boolean) { described_class.new(bool) } let(:bool) { true } diff --git a/spec/lib/gitlab/redis/cache_spec.rb b/spec/lib/gitlab/redis/cache_spec.rb index 0718998f981..5f73b84288d 100644 --- a/spec/lib/gitlab/redis/cache_spec.rb +++ b/spec/lib/gitlab/redis/cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Redis::Cache do +RSpec.describe Gitlab::Redis::Cache do let(:config_file_name) { "config/redis.cache.yml" } let(:environment_config_file_name) { "GITLAB_REDIS_CACHE_CONFIG_FILE" } let(:config_old_format_socket) { "spec/fixtures/config/redis_cache_old_format_socket.yml" } diff --git a/spec/lib/gitlab/redis/queues_spec.rb b/spec/lib/gitlab/redis/queues_spec.rb index 93207b6f469..8a32c991943 100644 --- a/spec/lib/gitlab/redis/queues_spec.rb +++ b/spec/lib/gitlab/redis/queues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Redis::Queues do +RSpec.describe Gitlab::Redis::Queues do let(:config_file_name) { "config/redis.queues.yml" } let(:environment_config_file_name) { "GITLAB_REDIS_QUEUES_CONFIG_FILE" } let(:config_old_format_socket) { "spec/fixtures/config/redis_queues_old_format_socket.yml" } diff --git a/spec/lib/gitlab/redis/shared_state_spec.rb b/spec/lib/gitlab/redis/shared_state_spec.rb index aa61fd99eb5..bd90e4c750d 100644 --- a/spec/lib/gitlab/redis/shared_state_spec.rb +++ b/spec/lib/gitlab/redis/shared_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Redis::SharedState do +RSpec.describe Gitlab::Redis::SharedState do let(:config_file_name) { "config/redis.shared_state.yml" } let(:environment_config_file_name) { "GITLAB_REDIS_SHARED_STATE_CONFIG_FILE" } let(:config_old_format_socket) { "spec/fixtures/config/redis_shared_state_old_format_socket.yml" } diff --git a/spec/lib/gitlab/redis/wrapper_spec.rb b/spec/lib/gitlab/redis/wrapper_spec.rb index 51a36eb062c..283853ee863 100644 --- a/spec/lib/gitlab/redis/wrapper_spec.rb +++ b/spec/lib/gitlab/redis/wrapper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Redis::Wrapper do +RSpec.describe Gitlab::Redis::Wrapper do let(:config_file_name) { "config/resque.yml" } let(:environment_config_file_name) { "GITLAB_REDIS_CONFIG_FILE" } let(:config_old_format_socket) { "spec/fixtures/config/redis_old_format_socket.yml" } diff --git a/spec/lib/gitlab/reference_counter_spec.rb b/spec/lib/gitlab/reference_counter_spec.rb index ae7b18ca007..0d0ac75ee22 100644 --- a/spec/lib/gitlab/reference_counter_spec.rb +++ b/spec/lib/gitlab/reference_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ReferenceCounter, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::ReferenceCounter, :clean_gitlab_redis_shared_state do let(:reference_counter) { described_class.new('project-1') } describe '#increase' do diff --git a/spec/lib/gitlab/reference_extractor_spec.rb b/spec/lib/gitlab/reference_extractor_spec.rb index dd16f3c6035..0172defc75d 100644 --- a/spec/lib/gitlab/reference_extractor_spec.rb +++ b/spec/lib/gitlab/reference_extractor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ReferenceExtractor do +RSpec.describe Gitlab::ReferenceExtractor do let_it_be(:project) { create(:project) } before do diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 85c6951cf95..7aece6fe697 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Regex do +RSpec.describe Gitlab::Regex do shared_examples_for 'project/group name regex' do it { is_expected.to match('gitlab-ce') } it { is_expected.to match('GitLab CE') } diff --git a/spec/lib/gitlab/repo_path_spec.rb b/spec/lib/gitlab/repo_path_spec.rb index 68571b9de20..05f32459164 100644 --- a/spec/lib/gitlab/repo_path_spec.rb +++ b/spec/lib/gitlab/repo_path_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ::Gitlab::RepoPath do +RSpec.describe ::Gitlab::RepoPath do include Gitlab::Routing let_it_be(:project) { create(:project, :repository) } diff --git a/spec/lib/gitlab/repository_cache_adapter_spec.rb b/spec/lib/gitlab/repository_cache_adapter_spec.rb index dba5ffc84c5..3727217203e 100644 --- a/spec/lib/gitlab/repository_cache_adapter_spec.rb +++ b/spec/lib/gitlab/repository_cache_adapter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RepositoryCacheAdapter do +RSpec.describe Gitlab::RepositoryCacheAdapter do let(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:cache) { repository.send(:cache) } diff --git a/spec/lib/gitlab/repository_cache_spec.rb b/spec/lib/gitlab/repository_cache_spec.rb index be31be761ad..80285a6c732 100644 --- a/spec/lib/gitlab/repository_cache_spec.rb +++ b/spec/lib/gitlab/repository_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RepositoryCache do +RSpec.describe Gitlab::RepositoryCache do let_it_be(:project) { create(:project) } let(:backend) { double('backend').as_null_object } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/repository_hash_cache_spec.rb b/spec/lib/gitlab/repository_hash_cache_spec.rb index 014a2f235b9..ea856c14a77 100644 --- a/spec/lib/gitlab/repository_hash_cache_spec.rb +++ b/spec/lib/gitlab/repository_hash_cache_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe Gitlab::RepositoryHashCache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::RepositoryHashCache, :clean_gitlab_redis_cache do let_it_be(:project) { create(:project) } let(:repository) { project.repository } let(:namespace) { "#{repository.full_path}:#{project.id}" } diff --git a/spec/lib/gitlab/repository_set_cache_spec.rb b/spec/lib/gitlab/repository_set_cache_spec.rb index b09194e7d0b..024aae49b04 100644 --- a/spec/lib/gitlab/repository_set_cache_spec.rb +++ b/spec/lib/gitlab/repository_set_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RepositorySetCache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::RepositorySetCache, :clean_gitlab_redis_cache do let_it_be(:project) { create(:project) } let(:repository) { project.repository } let(:namespace) { "#{repository.full_path}:#{project.id}" } diff --git a/spec/lib/gitlab/repository_size_checker_spec.rb b/spec/lib/gitlab/repository_size_checker_spec.rb index 61f76d716e5..9b2c02b1190 100644 --- a/spec/lib/gitlab/repository_size_checker_spec.rb +++ b/spec/lib/gitlab/repository_size_checker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RepositorySizeChecker do +RSpec.describe Gitlab::RepositorySizeChecker do let(:current_size) { 0 } let(:limit) { 50 } let(:enabled) { true } diff --git a/spec/lib/gitlab/repository_size_error_message_spec.rb b/spec/lib/gitlab/repository_size_error_message_spec.rb index 9e4d19cc572..b6b975143c9 100644 --- a/spec/lib/gitlab/repository_size_error_message_spec.rb +++ b/spec/lib/gitlab/repository_size_error_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RepositorySizeErrorMessage do +RSpec.describe Gitlab::RepositorySizeErrorMessage do let(:checker) do Gitlab::RepositorySizeChecker.new( current_size_proc: -> { 15.megabytes }, diff --git a/spec/lib/gitlab/repository_url_builder_spec.rb b/spec/lib/gitlab/repository_url_builder_spec.rb index a5797146cc5..63cb1d7a9ac 100644 --- a/spec/lib/gitlab/repository_url_builder_spec.rb +++ b/spec/lib/gitlab/repository_url_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RepositoryUrlBuilder do +RSpec.describe Gitlab::RepositoryUrlBuilder do describe '.build' do using RSpec::Parameterized::TableSyntax diff --git a/spec/lib/gitlab/request_context_spec.rb b/spec/lib/gitlab/request_context_spec.rb index d7af0765d53..b9acfa4a841 100644 --- a/spec/lib/gitlab/request_context_spec.rb +++ b/spec/lib/gitlab/request_context_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RequestContext, :request_store do +RSpec.describe Gitlab::RequestContext, :request_store do subject { described_class.instance } before do diff --git a/spec/lib/gitlab/request_forgery_protection_spec.rb b/spec/lib/gitlab/request_forgery_protection_spec.rb index b7a3dc16eff..20996dd44b8 100644 --- a/spec/lib/gitlab/request_forgery_protection_spec.rb +++ b/spec/lib/gitlab/request_forgery_protection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RequestForgeryProtection, :allow_forgery_protection do +RSpec.describe Gitlab::RequestForgeryProtection, :allow_forgery_protection do let(:csrf_token) { SecureRandom.base64(ActionController::RequestForgeryProtection::AUTHENTICITY_TOKEN_LENGTH) } let(:env) do { diff --git a/spec/lib/gitlab/request_profiler/profile_spec.rb b/spec/lib/gitlab/request_profiler/profile_spec.rb index a75f3c66156..2e9c75dde87 100644 --- a/spec/lib/gitlab/request_profiler/profile_spec.rb +++ b/spec/lib/gitlab/request_profiler/profile_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::RequestProfiler::Profile do +RSpec.describe Gitlab::RequestProfiler::Profile do let(:profile) { described_class.new(filename) } describe '.new' do diff --git a/spec/lib/gitlab/request_profiler_spec.rb b/spec/lib/gitlab/request_profiler_spec.rb index f157189a72d..4d3b361efcb 100644 --- a/spec/lib/gitlab/request_profiler_spec.rb +++ b/spec/lib/gitlab/request_profiler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RequestProfiler do +RSpec.describe Gitlab::RequestProfiler do describe '.profile_token' do it 'returns a token' do expect(described_class.profile_token).to be_present diff --git a/spec/lib/gitlab/route_map_spec.rb b/spec/lib/gitlab/route_map_spec.rb index d5e70b91fb4..e2c71980068 100644 --- a/spec/lib/gitlab/route_map_spec.rb +++ b/spec/lib/gitlab/route_map_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RouteMap do +RSpec.describe Gitlab::RouteMap do describe '#initialize' do context 'when the data is not YAML' do it 'raises an error' do diff --git a/spec/lib/gitlab/routing_spec.rb b/spec/lib/gitlab/routing_spec.rb index 5446d6559fe..304ce57aee3 100644 --- a/spec/lib/gitlab/routing_spec.rb +++ b/spec/lib/gitlab/routing_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Routing do +RSpec.describe Gitlab::Routing do context 'when module is included' do subject do Class.new.include(described_class).new diff --git a/spec/lib/gitlab/rugged_instrumentation_spec.rb b/spec/lib/gitlab/rugged_instrumentation_spec.rb index d6f3fb9be55..393bb957aba 100644 --- a/spec/lib/gitlab/rugged_instrumentation_spec.rb +++ b/spec/lib/gitlab/rugged_instrumentation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::RuggedInstrumentation, :request_store do +RSpec.describe Gitlab::RuggedInstrumentation, :request_store do subject { described_class } describe '.query_time' do diff --git a/spec/lib/gitlab/runtime_spec.rb b/spec/lib/gitlab/runtime_spec.rb index 8f920bb2e01..8c1f17d070e 100644 --- a/spec/lib/gitlab/runtime_spec.rb +++ b/spec/lib/gitlab/runtime_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Runtime do +RSpec.describe Gitlab::Runtime do shared_examples "valid runtime" do |runtime, max_threads| it "identifies itself" do expect(subject.identify).to eq(runtime) diff --git a/spec/lib/gitlab/safe_request_store_spec.rb b/spec/lib/gitlab/safe_request_store_spec.rb index def05a3f285..704102ccaee 100644 --- a/spec/lib/gitlab/safe_request_store_spec.rb +++ b/spec/lib/gitlab/safe_request_store_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SafeRequestStore do +RSpec.describe Gitlab::SafeRequestStore do describe '.store' do context 'when RequestStore is active', :request_store do it 'uses RequestStore' do diff --git a/spec/lib/gitlab/sanitizers/exif_spec.rb b/spec/lib/gitlab/sanitizers/exif_spec.rb index 58fba673f8e..88ef3ce6aa5 100644 --- a/spec/lib/gitlab/sanitizers/exif_spec.rb +++ b/spec/lib/gitlab/sanitizers/exif_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sanitizers::Exif do +RSpec.describe Gitlab::Sanitizers::Exif do let(:sanitizer) { described_class.new } describe '#batch_clean' do diff --git a/spec/lib/gitlab/sanitizers/svg_spec.rb b/spec/lib/gitlab/sanitizers/svg_spec.rb index 18fa96a2914..88fd7b78abe 100644 --- a/spec/lib/gitlab/sanitizers/svg_spec.rb +++ b/spec/lib/gitlab/sanitizers/svg_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sanitizers::SVG do +RSpec.describe Gitlab::Sanitizers::SVG do let(:scrubber) { Gitlab::Sanitizers::SVG::Scrubber.new } let(:namespace) { double(Nokogiri::XML::Namespace, prefix: 'xlink', href: 'http://www.w3.org/1999/xlink') } let(:namespaced_attr) { double(Nokogiri::XML::Attr, name: 'href', namespace: namespace, value: '#awesome_id') } diff --git a/spec/lib/gitlab/search/found_blob_spec.rb b/spec/lib/gitlab/search/found_blob_spec.rb index ce6a54100a5..8b1c91f689d 100644 --- a/spec/lib/gitlab/search/found_blob_spec.rb +++ b/spec/lib/gitlab/search/found_blob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Search::FoundBlob do +RSpec.describe Gitlab::Search::FoundBlob do let(:project) { create(:project, :public, :repository) } describe 'parsing content results' do diff --git a/spec/lib/gitlab/search/found_wiki_page_spec.rb b/spec/lib/gitlab/search/found_wiki_page_spec.rb index e8b6728aba5..fc166ad3851 100644 --- a/spec/lib/gitlab/search/found_wiki_page_spec.rb +++ b/spec/lib/gitlab/search/found_wiki_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Search::FoundWikiPage do +RSpec.describe Gitlab::Search::FoundWikiPage do let(:project) { create(:project, :public, :repository) } describe 'policy' do diff --git a/spec/lib/gitlab/search/query_spec.rb b/spec/lib/gitlab/search/query_spec.rb index 112e9a59f04..e9601002922 100644 --- a/spec/lib/gitlab/search/query_spec.rb +++ b/spec/lib/gitlab/search/query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Search::Query do +RSpec.describe Gitlab::Search::Query do let(:query) { 'base filter:wow anotherfilter:noway name:maybe other:mmm leftover' } let(:subject) do described_class.new(query) do diff --git a/spec/lib/gitlab/search_context/builder_spec.rb b/spec/lib/gitlab/search_context/builder_spec.rb index 1707b54b273..5b4190fc67e 100644 --- a/spec/lib/gitlab/search_context/builder_spec.rb +++ b/spec/lib/gitlab/search_context/builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SearchContext::Builder, type: :controller do +RSpec.describe Gitlab::SearchContext::Builder, type: :controller do controller(ApplicationController) { } subject(:builder) { described_class.new(controller.view_context) } diff --git a/spec/lib/gitlab/search_context/controller_concern_spec.rb b/spec/lib/gitlab/search_context/controller_concern_spec.rb index 16784cafb76..9cf6b8d49aa 100644 --- a/spec/lib/gitlab/search_context/controller_concern_spec.rb +++ b/spec/lib/gitlab/search_context/controller_concern_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SearchContext::ControllerConcern, type: :controller do +RSpec.describe Gitlab::SearchContext::ControllerConcern, type: :controller do controller(ApplicationController) do include Gitlab::SearchContext::ControllerConcern end diff --git a/spec/lib/gitlab/search_results_spec.rb b/spec/lib/gitlab/search_results_spec.rb index ab14602a468..61fa61566cd 100644 --- a/spec/lib/gitlab/search_results_spec.rb +++ b/spec/lib/gitlab/search_results_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SearchResults do +RSpec.describe Gitlab::SearchResults do include ProjectForksHelper include SearchHelpers diff --git a/spec/lib/gitlab/serializer/ci/variables_spec.rb b/spec/lib/gitlab/serializer/ci/variables_spec.rb index 900508420c9..9b0475259fe 100644 --- a/spec/lib/gitlab/serializer/ci/variables_spec.rb +++ b/spec/lib/gitlab/serializer/ci/variables_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Serializer::Ci::Variables do +RSpec.describe Gitlab::Serializer::Ci::Variables do subject do described_class.load(described_class.dump(object)) end diff --git a/spec/lib/gitlab/serializer/pagination_spec.rb b/spec/lib/gitlab/serializer/pagination_spec.rb index 1e7f441f258..69b5e181769 100644 --- a/spec/lib/gitlab/serializer/pagination_spec.rb +++ b/spec/lib/gitlab/serializer/pagination_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Serializer::Pagination do +RSpec.describe Gitlab::Serializer::Pagination do let(:request) { double(url: "#{Gitlab.config.gitlab.url}:8080/api/v4/projects?#{query.to_query}", query_parameters: query) } let(:response) { spy('response') } let(:headers) { spy('headers') } diff --git a/spec/lib/gitlab/serverless/service_spec.rb b/spec/lib/gitlab/serverless/service_spec.rb index 6db8b9cd0ba..3400be5b48e 100644 --- a/spec/lib/gitlab/serverless/service_spec.rb +++ b/spec/lib/gitlab/serverless/service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Serverless::Service do +RSpec.describe Gitlab::Serverless::Service do let(:cluster) { create(:cluster) } let(:environment) { create(:environment) } let(:attributes) do diff --git a/spec/lib/gitlab/session_spec.rb b/spec/lib/gitlab/session_spec.rb index 8db73f0ec7b..de680e8425e 100644 --- a/spec/lib/gitlab/session_spec.rb +++ b/spec/lib/gitlab/session_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Session do +RSpec.describe Gitlab::Session do it 'uses the current thread as a data store' do Thread.current[:session_storage] = { a: :b } diff --git a/spec/lib/gitlab/shard_health_cache_spec.rb b/spec/lib/gitlab/shard_health_cache_spec.rb index f747849b5e9..5c47ac7e9a0 100644 --- a/spec/lib/gitlab/shard_health_cache_spec.rb +++ b/spec/lib/gitlab/shard_health_cache_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do +RSpec.describe Gitlab::ShardHealthCache, :clean_gitlab_redis_cache do let(:shards) { %w(foo bar) } before do diff --git a/spec/lib/gitlab/shell_spec.rb b/spec/lib/gitlab/shell_spec.rb index 1f515cffdbf..b0dc34e8abf 100644 --- a/spec/lib/gitlab/shell_spec.rb +++ b/spec/lib/gitlab/shell_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'stringio' -describe Gitlab::Shell do +RSpec.describe Gitlab::Shell do let_it_be(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:gitlab_shell) { described_class.new } diff --git a/spec/lib/gitlab/sherlock/collection_spec.rb b/spec/lib/gitlab/sherlock/collection_spec.rb index bdc89c3d3cf..fcf8e6638f8 100644 --- a/spec/lib/gitlab/sherlock/collection_spec.rb +++ b/spec/lib/gitlab/sherlock/collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::Collection do +RSpec.describe Gitlab::Sherlock::Collection do let(:collection) { described_class.new } let(:transaction) do diff --git a/spec/lib/gitlab/sherlock/file_sample_spec.rb b/spec/lib/gitlab/sherlock/file_sample_spec.rb index b09ba5c62dc..8a1aa51e2d4 100644 --- a/spec/lib/gitlab/sherlock/file_sample_spec.rb +++ b/spec/lib/gitlab/sherlock/file_sample_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::FileSample do +RSpec.describe Gitlab::Sherlock::FileSample do let(:sample) { described_class.new(__FILE__, [], 150.4, 2) } describe '#id' do diff --git a/spec/lib/gitlab/sherlock/line_profiler_spec.rb b/spec/lib/gitlab/sherlock/line_profiler_spec.rb index c1997606839..2220a2cafc8 100644 --- a/spec/lib/gitlab/sherlock/line_profiler_spec.rb +++ b/spec/lib/gitlab/sherlock/line_profiler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::LineProfiler do +RSpec.describe Gitlab::Sherlock::LineProfiler do let(:profiler) { described_class.new } describe '#profile' do diff --git a/spec/lib/gitlab/sherlock/line_sample_spec.rb b/spec/lib/gitlab/sherlock/line_sample_spec.rb index b68e8cc0266..db031377787 100644 --- a/spec/lib/gitlab/sherlock/line_sample_spec.rb +++ b/spec/lib/gitlab/sherlock/line_sample_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::LineSample do +RSpec.describe Gitlab::Sherlock::LineSample do let(:sample) { described_class.new(150.0, 4) } describe '#duration' do diff --git a/spec/lib/gitlab/sherlock/location_spec.rb b/spec/lib/gitlab/sherlock/location_spec.rb index 7b40c84c2d1..4a8b5dffba2 100644 --- a/spec/lib/gitlab/sherlock/location_spec.rb +++ b/spec/lib/gitlab/sherlock/location_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::Location do +RSpec.describe Gitlab::Sherlock::Location do let(:location) { described_class.new(__FILE__, 1) } describe 'from_ruby_location' do diff --git a/spec/lib/gitlab/sherlock/middleware_spec.rb b/spec/lib/gitlab/sherlock/middleware_spec.rb index 8d6e362f622..645bde6681d 100644 --- a/spec/lib/gitlab/sherlock/middleware_spec.rb +++ b/spec/lib/gitlab/sherlock/middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::Middleware do +RSpec.describe Gitlab::Sherlock::Middleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } diff --git a/spec/lib/gitlab/sherlock/query_spec.rb b/spec/lib/gitlab/sherlock/query_spec.rb index 13c7e6f8f8b..b8dfd082c37 100644 --- a/spec/lib/gitlab/sherlock/query_spec.rb +++ b/spec/lib/gitlab/sherlock/query_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::Query do +RSpec.describe Gitlab::Sherlock::Query do let(:started_at) { Time.utc(2015, 1, 1) } let(:finished_at) { started_at + 5 } diff --git a/spec/lib/gitlab/sherlock/transaction_spec.rb b/spec/lib/gitlab/sherlock/transaction_spec.rb index 728c44df4f3..535b0ad4d8a 100644 --- a/spec/lib/gitlab/sherlock/transaction_spec.rb +++ b/spec/lib/gitlab/sherlock/transaction_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sherlock::Transaction do +RSpec.describe Gitlab::Sherlock::Transaction do let(:transaction) { described_class.new('POST', '/cat_pictures') } describe '#id' do diff --git a/spec/lib/gitlab/sidekiq_cluster/cli_spec.rb b/spec/lib/gitlab/sidekiq_cluster/cli_spec.rb index fa23bf8958c..cf165d1770b 100644 --- a/spec/lib/gitlab/sidekiq_cluster/cli_spec.rb +++ b/spec/lib/gitlab/sidekiq_cluster/cli_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'rspec-parameterized' -describe Gitlab::SidekiqCluster::CLI do +RSpec.describe Gitlab::SidekiqCluster::CLI do let(:cli) { described_class.new('/dev/null') } let(:timeout) { described_class::DEFAULT_SOFT_TIMEOUT_SECONDS } let(:default_options) do diff --git a/spec/lib/gitlab/sidekiq_cluster_spec.rb b/spec/lib/gitlab/sidekiq_cluster_spec.rb index 3f466e9f2a3..d625a2a2185 100644 --- a/spec/lib/gitlab/sidekiq_cluster_spec.rb +++ b/spec/lib/gitlab/sidekiq_cluster_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'rspec-parameterized' -describe Gitlab::SidekiqCluster do +RSpec.describe Gitlab::SidekiqCluster do describe '.trap_signals' do it 'traps the given signals' do expect(described_class).to receive(:trap).ordered.with(:INT) diff --git a/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb b/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb index 7a8aba2d396..01e7c06249a 100644 --- a/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb +++ b/spec/lib/gitlab/sidekiq_config/cli_methods_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'rspec-parameterized' -describe Gitlab::SidekiqConfig::CliMethods do +RSpec.describe Gitlab::SidekiqConfig::CliMethods do let(:dummy_root) { '/tmp/' } describe '.worker_queues' do diff --git a/spec/lib/gitlab/sidekiq_config/worker_spec.rb b/spec/lib/gitlab/sidekiq_config/worker_spec.rb index 00343a0264d..05987f95b33 100644 --- a/spec/lib/gitlab/sidekiq_config/worker_spec.rb +++ b/spec/lib/gitlab/sidekiq_config/worker_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::SidekiqConfig::Worker do +RSpec.describe Gitlab::SidekiqConfig::Worker do def create_worker(queue:, **attributes) namespace = queue.include?(':') && queue.split(':').first inner_worker = double( diff --git a/spec/lib/gitlab/sidekiq_config_spec.rb b/spec/lib/gitlab/sidekiq_config_spec.rb index 66744d07aaa..d216b9d0c18 100644 --- a/spec/lib/gitlab/sidekiq_config_spec.rb +++ b/spec/lib/gitlab/sidekiq_config_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqConfig do +RSpec.describe Gitlab::SidekiqConfig do describe '.workers' do it 'includes all workers' do worker_classes = described_class.workers.map(&:klass) diff --git a/spec/lib/gitlab/sidekiq_daemon/memory_killer_spec.rb b/spec/lib/gitlab/sidekiq_daemon/memory_killer_spec.rb index 45bcc71dfcb..0ff2dbb234a 100644 --- a/spec/lib/gitlab/sidekiq_daemon/memory_killer_spec.rb +++ b/spec/lib/gitlab/sidekiq_daemon/memory_killer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqDaemon::MemoryKiller do +RSpec.describe Gitlab::SidekiqDaemon::MemoryKiller do let(:memory_killer) { described_class.new } let(:pid) { 12345 } diff --git a/spec/lib/gitlab/sidekiq_daemon/monitor_spec.rb b/spec/lib/gitlab/sidekiq_daemon/monitor_spec.rb index 3f49ef0e9a7..749c7af6f59 100644 --- a/spec/lib/gitlab/sidekiq_daemon/monitor_spec.rb +++ b/spec/lib/gitlab/sidekiq_daemon/monitor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqDaemon::Monitor do +RSpec.describe Gitlab::SidekiqDaemon::Monitor do let(:monitor) { described_class.new } describe '#within_job' do diff --git a/spec/lib/gitlab/sidekiq_logging/deduplication_logger_spec.rb b/spec/lib/gitlab/sidekiq_logging/deduplication_logger_spec.rb index 3cc5c0bed1b..8db06b8333b 100644 --- a/spec/lib/gitlab/sidekiq_logging/deduplication_logger_spec.rb +++ b/spec/lib/gitlab/sidekiq_logging/deduplication_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqLogging::DeduplicationLogger do +RSpec.describe Gitlab::SidekiqLogging::DeduplicationLogger do describe '#log_deduplication' do let(:job) do { diff --git a/spec/lib/gitlab/sidekiq_logging/exception_handler_spec.rb b/spec/lib/gitlab/sidekiq_logging/exception_handler_spec.rb index a79a0678e2b..5a68b88c02d 100644 --- a/spec/lib/gitlab/sidekiq_logging/exception_handler_spec.rb +++ b/spec/lib/gitlab/sidekiq_logging/exception_handler_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqLogging::ExceptionHandler do +RSpec.describe Gitlab::SidekiqLogging::ExceptionHandler do describe '#call' do let(:job) do { diff --git a/spec/lib/gitlab/sidekiq_logging/json_formatter_spec.rb b/spec/lib/gitlab/sidekiq_logging/json_formatter_spec.rb index 10354147cf9..c879fdea3ad 100644 --- a/spec/lib/gitlab/sidekiq_logging/json_formatter_spec.rb +++ b/spec/lib/gitlab/sidekiq_logging/json_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqLogging::JSONFormatter do +RSpec.describe Gitlab::SidekiqLogging::JSONFormatter do let(:message) { 'This is a test' } let(:now) { Time.now } let(:timestamp) { now.utc.to_f } diff --git a/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb b/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb index a456f814e78..03ace9a01c7 100644 --- a/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb +++ b/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqLogging::StructuredLogger do +RSpec.describe Gitlab::SidekiqLogging::StructuredLogger do describe '#call' do let(:timestamp) { Time.iso8601('2018-01-01T12:00:00.000Z') } let(:created_at) { timestamp - 1.second } diff --git a/spec/lib/gitlab/sidekiq_middleware/admin_mode/client_spec.rb b/spec/lib/gitlab/sidekiq_middleware/admin_mode/client_spec.rb index f6449bae8c3..3d9ffb11ae2 100644 --- a/spec/lib/gitlab/sidekiq_middleware/admin_mode/client_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/admin_mode/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::AdminMode::Client, :do_not_mock_admin_mode, :request_store do +RSpec.describe Gitlab::SidekiqMiddleware::AdminMode::Client, :do_not_mock_admin_mode, :request_store do include AdminModeHelper let(:worker) do diff --git a/spec/lib/gitlab/sidekiq_middleware/admin_mode/server_spec.rb b/spec/lib/gitlab/sidekiq_middleware/admin_mode/server_spec.rb index 60475f0e403..20f1e88bcf4 100644 --- a/spec/lib/gitlab/sidekiq_middleware/admin_mode/server_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/admin_mode/server_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::AdminMode::Server, :do_not_mock_admin_mode, :request_store do +RSpec.describe Gitlab::SidekiqMiddleware::AdminMode::Server, :do_not_mock_admin_mode, :request_store do include AdminModeHelper let(:worker) do diff --git a/spec/lib/gitlab/sidekiq_middleware/client_metrics_spec.rb b/spec/lib/gitlab/sidekiq_middleware/client_metrics_spec.rb index 1d45b70ec3e..f7010b2001a 100644 --- a/spec/lib/gitlab/sidekiq_middleware/client_metrics_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/client_metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::ClientMetrics do +RSpec.describe Gitlab::SidekiqMiddleware::ClientMetrics do context "with worker attribution" do subject { described_class.new } diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/client_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/client_spec.rb index a1e4cbb1e31..98350fb9b8e 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/client_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::DuplicateJobs::Client, :clean_gitlab_redis_queues do +RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::Client, :clean_gitlab_redis_queues do let(:worker_class) do Class.new do def self.name diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb index 13c86563be7..8ef61d4eae9 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob, :clean_gitlab_redis_queues do +RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob, :clean_gitlab_redis_queues do using RSpec::Parameterized::TableSyntax subject(:duplicate_job) do diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/server_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/server_spec.rb index 312ebd30a76..3f75d867936 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/server_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/server_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::DuplicateJobs::Server, :clean_gitlab_redis_queues do +RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::Server, :clean_gitlab_redis_queues do let(:worker_class) do Class.new do def self.name diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies/until_executing_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies/until_executing_spec.rb index eb8b0a951a8..ddf66a04d48 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies/until_executing_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies/until_executing_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'timecop' -describe Gitlab::SidekiqMiddleware::DuplicateJobs::Strategies::UntilExecuting do +RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::Strategies::UntilExecuting do let(:fake_duplicate_job) do instance_double(Gitlab::SidekiqMiddleware::DuplicateJobs::DuplicateJob) end diff --git a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies_spec.rb b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies_spec.rb index 6ecc2a3a5f8..5d37e3cb1ae 100644 --- a/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::SidekiqMiddleware::DuplicateJobs::Strategies do +RSpec.describe Gitlab::SidekiqMiddleware::DuplicateJobs::Strategies do describe '.for' do it 'returns the right class for `until_executing`' do expect(described_class.for(:until_executing)).to eq(described_class::UntilExecuting) diff --git a/spec/lib/gitlab/sidekiq_middleware/extra_done_log_metadata_spec.rb b/spec/lib/gitlab/sidekiq_middleware/extra_done_log_metadata_spec.rb index 98847885e62..dbab67f5996 100644 --- a/spec/lib/gitlab/sidekiq_middleware/extra_done_log_metadata_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/extra_done_log_metadata_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::ExtraDoneLogMetadata do +RSpec.describe Gitlab::SidekiqMiddleware::ExtraDoneLogMetadata do # Cannot use Class.new for this as ApplicationWorker will need the class to # have a name during `included do`. let(:worker) { AdminEmailWorker.new } diff --git a/spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb b/spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb index b5be43ec96c..0d1616c4aed 100644 --- a/spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/memory_killer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::MemoryKiller do +RSpec.describe Gitlab::SidekiqMiddleware::MemoryKiller do subject { described_class.new } let(:pid) { 999 } diff --git a/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb b/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb index 398144025ea..85cddfa7bf1 100644 --- a/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/monitor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::Monitor do +RSpec.describe Gitlab::SidekiqMiddleware::Monitor do let(:monitor) { described_class.new } describe '#call' do diff --git a/spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb b/spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb index 4b7baea25e8..1b3b108d9ea 100644 --- a/spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/server_metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::ServerMetrics do +RSpec.describe Gitlab::SidekiqMiddleware::ServerMetrics do context "with worker attribution" do subject { described_class.new } diff --git a/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb b/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb index 9cb89b1bc10..fff925f8532 100644 --- a/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::WorkerContext::Client do +RSpec.describe Gitlab::SidekiqMiddleware::WorkerContext::Client do let(:worker_class) do Class.new do def self.name diff --git a/spec/lib/gitlab/sidekiq_middleware/worker_context/server_spec.rb b/spec/lib/gitlab/sidekiq_middleware/worker_context/server_spec.rb index fdf643a8ad1..bde19fa7552 100644 --- a/spec/lib/gitlab/sidekiq_middleware/worker_context/server_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware/worker_context/server_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqMiddleware::WorkerContext::Server do +RSpec.describe Gitlab::SidekiqMiddleware::WorkerContext::Server do let(:worker_class) do Class.new do def self.name diff --git a/spec/lib/gitlab/sidekiq_middleware_spec.rb b/spec/lib/gitlab/sidekiq_middleware_spec.rb index 5ca0abeb132..018821e6c5e 100644 --- a/spec/lib/gitlab/sidekiq_middleware_spec.rb +++ b/spec/lib/gitlab/sidekiq_middleware_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'sidekiq/testing' -describe Gitlab::SidekiqMiddleware do +RSpec.describe Gitlab::SidekiqMiddleware do before do stub_const('TestWorker', Class.new) diff --git a/spec/lib/gitlab/sidekiq_queue_spec.rb b/spec/lib/gitlab/sidekiq_queue_spec.rb index f5be8d9bfed..44ac89c0816 100644 --- a/spec/lib/gitlab/sidekiq_queue_spec.rb +++ b/spec/lib/gitlab/sidekiq_queue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqQueue, :clean_gitlab_redis_queues do +RSpec.describe Gitlab::SidekiqQueue, :clean_gitlab_redis_queues do around do |example| Sidekiq::Queue.new('authorized_projects').clear Sidekiq::Testing.disable!(&example) diff --git a/spec/lib/gitlab/sidekiq_signals_spec.rb b/spec/lib/gitlab/sidekiq_signals_spec.rb index 10f1bad32cd..2f751839f6a 100644 --- a/spec/lib/gitlab/sidekiq_signals_spec.rb +++ b/spec/lib/gitlab/sidekiq_signals_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqSignals do +RSpec.describe Gitlab::SidekiqSignals do describe '.install' do let(:result) { Hash.new { |h, k| h[k] = 0 } } let(:int_handler) { -> (_) { result['INT'] += 1 } } diff --git a/spec/lib/gitlab/sidekiq_status/client_middleware_spec.rb b/spec/lib/gitlab/sidekiq_status/client_middleware_spec.rb index 1ca8cea66fc..0cf05fb0a5c 100644 --- a/spec/lib/gitlab/sidekiq_status/client_middleware_spec.rb +++ b/spec/lib/gitlab/sidekiq_status/client_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqStatus::ClientMiddleware do +RSpec.describe Gitlab::SidekiqStatus::ClientMiddleware do describe '#call' do it 'tracks the job in Redis' do expect(Gitlab::SidekiqStatus).to receive(:set).with('123', Gitlab::SidekiqStatus::DEFAULT_EXPIRATION) diff --git a/spec/lib/gitlab/sidekiq_status/server_middleware_spec.rb b/spec/lib/gitlab/sidekiq_status/server_middleware_spec.rb index 40bcb49d1d3..5a0c4cbd1b5 100644 --- a/spec/lib/gitlab/sidekiq_status/server_middleware_spec.rb +++ b/spec/lib/gitlab/sidekiq_status/server_middleware_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqStatus::ServerMiddleware do +RSpec.describe Gitlab::SidekiqStatus::ServerMiddleware do describe '#call' do it 'stops tracking of a job upon completion' do expect(Gitlab::SidekiqStatus).to receive(:unset).with('123') diff --git a/spec/lib/gitlab/sidekiq_status_spec.rb b/spec/lib/gitlab/sidekiq_status_spec.rb index 7b5c75b2f3b..dd5b8856ccd 100644 --- a/spec/lib/gitlab/sidekiq_status_spec.rb +++ b/spec/lib/gitlab/sidekiq_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqStatus do +RSpec.describe Gitlab::SidekiqStatus do describe '.set', :clean_gitlab_redis_shared_state do it 'stores the job ID' do described_class.set('123') diff --git a/spec/lib/gitlab/sidekiq_versioning/manager_spec.rb b/spec/lib/gitlab/sidekiq_versioning/manager_spec.rb index a528ce201a2..84161d9236e 100644 --- a/spec/lib/gitlab/sidekiq_versioning/manager_spec.rb +++ b/spec/lib/gitlab/sidekiq_versioning/manager_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqVersioning::Manager do +RSpec.describe Gitlab::SidekiqVersioning::Manager do before do Sidekiq::Manager.prepend described_class end diff --git a/spec/lib/gitlab/sidekiq_versioning_spec.rb b/spec/lib/gitlab/sidekiq_versioning_spec.rb index 11c866894c2..ed9650fc166 100644 --- a/spec/lib/gitlab/sidekiq_versioning_spec.rb +++ b/spec/lib/gitlab/sidekiq_versioning_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SidekiqVersioning, :redis do +RSpec.describe Gitlab::SidekiqVersioning, :redis do let(:foo_worker) do Class.new do def self.name diff --git a/spec/lib/gitlab/slash_commands/application_help_spec.rb b/spec/lib/gitlab/slash_commands/application_help_spec.rb index afa63c21584..b82121bf3a8 100644 --- a/spec/lib/gitlab/slash_commands/application_help_spec.rb +++ b/spec/lib/gitlab/slash_commands/application_help_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::ApplicationHelp do +RSpec.describe Gitlab::SlashCommands::ApplicationHelp do let(:params) { { command: '/gitlab', text: 'help' } } let(:project) { build(:project) } diff --git a/spec/lib/gitlab/slash_commands/command_spec.rb b/spec/lib/gitlab/slash_commands/command_spec.rb index 9849cf78b2f..069577b3846 100644 --- a/spec/lib/gitlab/slash_commands/command_spec.rb +++ b/spec/lib/gitlab/slash_commands/command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Command do +RSpec.describe Gitlab::SlashCommands::Command do let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:chat_name) { double(:chat_name, user: user) } diff --git a/spec/lib/gitlab/slash_commands/deploy_spec.rb b/spec/lib/gitlab/slash_commands/deploy_spec.rb index fb9969800a2..36f47c711bc 100644 --- a/spec/lib/gitlab/slash_commands/deploy_spec.rb +++ b/spec/lib/gitlab/slash_commands/deploy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Deploy do +RSpec.describe Gitlab::SlashCommands::Deploy do describe '#execute' do let(:project) { create(:project, :repository) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/slash_commands/issue_close_spec.rb b/spec/lib/gitlab/slash_commands/issue_close_spec.rb index c0760ce0ba6..cf6ac2c5267 100644 --- a/spec/lib/gitlab/slash_commands/issue_close_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_close_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueClose do +RSpec.describe Gitlab::SlashCommands::IssueClose do describe '#execute' do let(:issue) { create(:issue, project: project) } let(:project) { create(:project) } diff --git a/spec/lib/gitlab/slash_commands/issue_comment_spec.rb b/spec/lib/gitlab/slash_commands/issue_comment_spec.rb index c6f56d10d1f..f3c3bccfade 100644 --- a/spec/lib/gitlab/slash_commands/issue_comment_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_comment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueComment do +RSpec.describe Gitlab::SlashCommands::IssueComment do describe '#execute' do let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } diff --git a/spec/lib/gitlab/slash_commands/issue_move_spec.rb b/spec/lib/gitlab/slash_commands/issue_move_spec.rb index 1a45b0e06ba..5fffbb2d4cc 100644 --- a/spec/lib/gitlab/slash_commands/issue_move_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_move_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueMove, service: true do +RSpec.describe Gitlab::SlashCommands::IssueMove, service: true do describe '#match' do shared_examples_for 'move command' do |text_command| it 'can be parsed to extract the needed fields' do diff --git a/spec/lib/gitlab/slash_commands/issue_new_spec.rb b/spec/lib/gitlab/slash_commands/issue_new_spec.rb index 90f0518a63e..c17cee887ee 100644 --- a/spec/lib/gitlab/slash_commands/issue_new_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_new_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueNew do +RSpec.describe Gitlab::SlashCommands::IssueNew do describe '#execute' do let(:project) { create(:project) } let(:user) { create(:user) } diff --git a/spec/lib/gitlab/slash_commands/issue_search_spec.rb b/spec/lib/gitlab/slash_commands/issue_search_spec.rb index a142c8e4c92..8a86aaf67e3 100644 --- a/spec/lib/gitlab/slash_commands/issue_search_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_search_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueSearch do +RSpec.describe Gitlab::SlashCommands::IssueSearch do describe '#execute' do let!(:issue) { create(:issue, project: project, title: 'find me') } let!(:confidential) { create(:issue, :confidential, project: project, title: 'mepmep find') } diff --git a/spec/lib/gitlab/slash_commands/issue_show_spec.rb b/spec/lib/gitlab/slash_commands/issue_show_spec.rb index e53f79dcd86..62628daf24d 100644 --- a/spec/lib/gitlab/slash_commands/issue_show_spec.rb +++ b/spec/lib/gitlab/slash_commands/issue_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::IssueShow do +RSpec.describe Gitlab::SlashCommands::IssueShow do describe '#execute' do let(:issue) { create(:issue, project: project) } let(:project) { create(:project) } diff --git a/spec/lib/gitlab/slash_commands/presenters/access_spec.rb b/spec/lib/gitlab/slash_commands/presenters/access_spec.rb index 804184a7173..5d62e96971b 100644 --- a/spec/lib/gitlab/slash_commands/presenters/access_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::Access do +RSpec.describe Gitlab::SlashCommands::Presenters::Access do shared_examples_for 'displays an error message' do it do expect(subject[:text]).to match(error_message) diff --git a/spec/lib/gitlab/slash_commands/presenters/deploy_spec.rb b/spec/lib/gitlab/slash_commands/presenters/deploy_spec.rb index 9c2e9ab982f..c6f188de576 100644 --- a/spec/lib/gitlab/slash_commands/presenters/deploy_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/deploy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::Deploy do +RSpec.describe Gitlab::SlashCommands::Presenters::Deploy do let(:build) { create(:ci_build) } describe '#present' do diff --git a/spec/lib/gitlab/slash_commands/presenters/error_spec.rb b/spec/lib/gitlab/slash_commands/presenters/error_spec.rb index 30ff81510c1..24d6aad1726 100644 --- a/spec/lib/gitlab/slash_commands/presenters/error_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/error_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::Error do +RSpec.describe Gitlab::SlashCommands::Presenters::Error do subject { described_class.new('Error').message } it { is_expected.to be_a(Hash) } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_close_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_close_spec.rb index adc13b4ee56..daa859d4de7 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_close_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_close_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::IssueClose do +RSpec.describe Gitlab::SlashCommands::Presenters::IssueClose do let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:attachment) { subject[:attachments].first } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_comment_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_comment_spec.rb index 3741563a744..109b4b8fee1 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_comment_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_comment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::IssueComment do +RSpec.describe Gitlab::SlashCommands::Presenters::IssueComment do let_it_be(:project) { create(:project) } let_it_be(:issue) { create(:issue, project: project) } let_it_be(:note) { create(:note, project: project, noteable: issue) } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb index 7726c3b6a87..df949154d4c 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_move_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::IssueMove do +RSpec.describe Gitlab::SlashCommands::Presenters::IssueMove do let_it_be(:admin) { create(:admin) } let_it_be(:project, reload: true) { create(:project) } let_it_be(:other_project) { create(:project) } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb index f926783fbea..03a94ea5e29 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_new_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::IssueNew do +RSpec.describe Gitlab::SlashCommands::Presenters::IssueNew do let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } let(:attachment) { subject[:attachments].first } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb index e1c011133c4..c12e7fa7ee8 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_search_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::IssueSearch do +RSpec.describe Gitlab::SlashCommands::Presenters::IssueSearch do let(:project) { create(:project) } let(:message) { subject[:text] } diff --git a/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb b/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb index 47b9a67f54f..91fd32d2b55 100644 --- a/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/issue_show_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::IssueShow do +RSpec.describe Gitlab::SlashCommands::Presenters::IssueShow do let(:user) { create(:user, :with_avatar) } let(:project) { create(:project, creator: user) } let(:issue) { create(:issue, project: project) } diff --git a/spec/lib/gitlab/slash_commands/presenters/run_spec.rb b/spec/lib/gitlab/slash_commands/presenters/run_spec.rb index f3ab01ef6bb..3a775e8f101 100644 --- a/spec/lib/gitlab/slash_commands/presenters/run_spec.rb +++ b/spec/lib/gitlab/slash_commands/presenters/run_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Presenters::Run do +RSpec.describe Gitlab::SlashCommands::Presenters::Run do let(:presenter) { described_class.new } describe '#present' do diff --git a/spec/lib/gitlab/slash_commands/run_spec.rb b/spec/lib/gitlab/slash_commands/run_spec.rb index 32a23129e3c..c9ff580d586 100644 --- a/spec/lib/gitlab/slash_commands/run_spec.rb +++ b/spec/lib/gitlab/slash_commands/run_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SlashCommands::Run do +RSpec.describe Gitlab::SlashCommands::Run do describe '.available?' do it 'returns true when builds are enabled for the project' do project = double(:project, builds_enabled?: true) diff --git a/spec/lib/gitlab/slug/environment_spec.rb b/spec/lib/gitlab/slug/environment_spec.rb index 7dc583a94b8..f516322b937 100644 --- a/spec/lib/gitlab/slug/environment_spec.rb +++ b/spec/lib/gitlab/slug/environment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Slug::Environment do +RSpec.describe Gitlab::Slug::Environment do describe '#generate' do { "staging-12345678901234567" => "staging-123456789-q517sa", diff --git a/spec/lib/gitlab/snippet_search_results_spec.rb b/spec/lib/gitlab/snippet_search_results_spec.rb index a41be0eaa95..e1ae26a4d9e 100644 --- a/spec/lib/gitlab/snippet_search_results_spec.rb +++ b/spec/lib/gitlab/snippet_search_results_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SnippetSearchResults do +RSpec.describe Gitlab::SnippetSearchResults do include SearchHelpers let_it_be(:snippet) { create(:snippet, content: 'foo', file_name: 'foo') } diff --git a/spec/lib/gitlab/sourcegraph_spec.rb b/spec/lib/gitlab/sourcegraph_spec.rb index ef4008960a9..ad947475f06 100644 --- a/spec/lib/gitlab/sourcegraph_spec.rb +++ b/spec/lib/gitlab/sourcegraph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Sourcegraph do +RSpec.describe Gitlab::Sourcegraph do let_it_be(:user) { create(:user) } let(:feature_scope) { true } diff --git a/spec/lib/gitlab/sql/cte_spec.rb b/spec/lib/gitlab/sql/cte_spec.rb index e6194924f5a..fdc150cd4b9 100644 --- a/spec/lib/gitlab/sql/cte_spec.rb +++ b/spec/lib/gitlab/sql/cte_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SQL::CTE do +RSpec.describe Gitlab::SQL::CTE do describe '#to_arel' do it 'generates an Arel relation for the CTE body' do relation = User.where(id: 1) diff --git a/spec/lib/gitlab/sql/glob_spec.rb b/spec/lib/gitlab/sql/glob_spec.rb index 83eed309ecc..8e2b842add6 100644 --- a/spec/lib/gitlab/sql/glob_spec.rb +++ b/spec/lib/gitlab/sql/glob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SQL::Glob do +RSpec.describe Gitlab::SQL::Glob do describe '.to_like' do it 'matches * as %' do expect(glob('apple', '*')).to be(true) diff --git a/spec/lib/gitlab/sql/pattern_spec.rb b/spec/lib/gitlab/sql/pattern_spec.rb index 38b93913f6d..220ac2ff6da 100644 --- a/spec/lib/gitlab/sql/pattern_spec.rb +++ b/spec/lib/gitlab/sql/pattern_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SQL::Pattern do +RSpec.describe Gitlab::SQL::Pattern do describe '.to_pattern' do subject(:to_pattern) { User.to_pattern(query) } diff --git a/spec/lib/gitlab/sql/recursive_cte_spec.rb b/spec/lib/gitlab/sql/recursive_cte_spec.rb index b15be56dd6d..02611620989 100644 --- a/spec/lib/gitlab/sql/recursive_cte_spec.rb +++ b/spec/lib/gitlab/sql/recursive_cte_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SQL::RecursiveCTE do +RSpec.describe Gitlab::SQL::RecursiveCTE do let(:cte) { described_class.new(:cte_name) } describe '#to_arel' do diff --git a/spec/lib/gitlab/sql/union_spec.rb b/spec/lib/gitlab/sql/union_spec.rb index f736614ae53..c8be83c093d 100644 --- a/spec/lib/gitlab/sql/union_spec.rb +++ b/spec/lib/gitlab/sql/union_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SQL::Union do +RSpec.describe Gitlab::SQL::Union do let(:relation_1) { User.where(email: 'alice@example.com').select(:id) } let(:relation_2) { User.where(email: 'bob@example.com').select(:id) } diff --git a/spec/lib/gitlab/ssh_public_key_spec.rb b/spec/lib/gitlab/ssh_public_key_spec.rb index 08e008c82d9..e1a588a4b7d 100644 --- a/spec/lib/gitlab/ssh_public_key_spec.rb +++ b/spec/lib/gitlab/ssh_public_key_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SSHPublicKey, lib: true do +RSpec.describe Gitlab::SSHPublicKey, lib: true do let(:key) { attributes_for(:rsa_key_2048)[:key] } let(:public_key) { described_class.new(key) } diff --git a/spec/lib/gitlab/static_site_editor/config_spec.rb b/spec/lib/gitlab/static_site_editor/config_spec.rb index 0d50e3bfdca..b4b667c25ee 100644 --- a/spec/lib/gitlab/static_site_editor/config_spec.rb +++ b/spec/lib/gitlab/static_site_editor/config_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::StaticSiteEditor::Config do +RSpec.describe Gitlab::StaticSiteEditor::Config do subject(:config) { described_class.new(repository, ref, file_path, return_url) } let_it_be(:namespace) { create(:namespace, name: 'namespace') } diff --git a/spec/lib/gitlab/string_placeholder_replacer_spec.rb b/spec/lib/gitlab/string_placeholder_replacer_spec.rb index 0295bf1265f..8f17bf64005 100644 --- a/spec/lib/gitlab/string_placeholder_replacer_spec.rb +++ b/spec/lib/gitlab/string_placeholder_replacer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::StringPlaceholderReplacer do +RSpec.describe Gitlab::StringPlaceholderReplacer do describe '.render_url' do it 'returns the nil if the string is blank' do expect(described_class.replace_string_placeholders(nil, /whatever/)).to be_blank diff --git a/spec/lib/gitlab/string_range_marker_spec.rb b/spec/lib/gitlab/string_range_marker_spec.rb index ef9be7cd992..52fab6e3109 100644 --- a/spec/lib/gitlab/string_range_marker_spec.rb +++ b/spec/lib/gitlab/string_range_marker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::StringRangeMarker do +RSpec.describe Gitlab::StringRangeMarker do describe '#mark' do def mark_diff(rich = nil) raw = 'abc <def>' diff --git a/spec/lib/gitlab/string_regex_marker_spec.rb b/spec/lib/gitlab/string_regex_marker_spec.rb index 2ab1ccc447b..2dadd222820 100644 --- a/spec/lib/gitlab/string_regex_marker_spec.rb +++ b/spec/lib/gitlab/string_regex_marker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::StringRegexMarker do +RSpec.describe Gitlab::StringRegexMarker do describe '#mark' do context 'with a single occurrence' do let(:raw) { %{"name": "AFNetworking"} } diff --git a/spec/lib/gitlab/submodule_links_spec.rb b/spec/lib/gitlab/submodule_links_spec.rb index 1f2848a29e9..c69326e12be 100644 --- a/spec/lib/gitlab/submodule_links_spec.rb +++ b/spec/lib/gitlab/submodule_links_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::SubmoduleLinks do +RSpec.describe Gitlab::SubmoduleLinks do let(:submodule_item) { double(id: 'hash', path: 'gitlab-foss') } let(:repo) { double } let(:links) { described_class.new(repo) } diff --git a/spec/lib/gitlab/tab_width_spec.rb b/spec/lib/gitlab/tab_width_spec.rb index 3b5014d27e4..f0efb6ec4a7 100644 --- a/spec/lib/gitlab/tab_width_spec.rb +++ b/spec/lib/gitlab/tab_width_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::TabWidth, lib: true do +RSpec.describe Gitlab::TabWidth, lib: true do describe '.css_class_for_user' do it 'returns default CSS class when user is nil' do css_class = described_class.css_class_for_user(nil) diff --git a/spec/lib/gitlab/tcp_checker_spec.rb b/spec/lib/gitlab/tcp_checker_spec.rb index 9474e79cc5d..12149576de0 100644 --- a/spec/lib/gitlab/tcp_checker_spec.rb +++ b/spec/lib/gitlab/tcp_checker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::TcpChecker, :permit_dns do +RSpec.describe Gitlab::TcpChecker, :permit_dns do before do @server = TCPServer.new('localhost', 0) _, @port, _, @ip = @server.addr diff --git a/spec/lib/gitlab/template/finders/global_template_finder_spec.rb b/spec/lib/gitlab/template/finders/global_template_finder_spec.rb index 580da497944..e776284b3e8 100644 --- a/spec/lib/gitlab/template/finders/global_template_finder_spec.rb +++ b/spec/lib/gitlab/template/finders/global_template_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Template::Finders::GlobalTemplateFinder do +RSpec.describe Gitlab::Template::Finders::GlobalTemplateFinder do let(:base_dir) { Dir.mktmpdir } def create_template!(name_with_category) diff --git a/spec/lib/gitlab/template/finders/repo_template_finders_spec.rb b/spec/lib/gitlab/template/finders/repo_template_finders_spec.rb index cd5cde76b73..05f351be702 100644 --- a/spec/lib/gitlab/template/finders/repo_template_finders_spec.rb +++ b/spec/lib/gitlab/template/finders/repo_template_finders_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Template::Finders::RepoTemplateFinder do +RSpec.describe Gitlab::Template::Finders::RepoTemplateFinder do let_it_be(:project) { create(:project, :repository) } let(:categories) { { 'HTML' => 'html' } } diff --git a/spec/lib/gitlab/template/gitignore_template_spec.rb b/spec/lib/gitlab/template/gitignore_template_spec.rb index e8f632889ad..365b579d08e 100644 --- a/spec/lib/gitlab/template/gitignore_template_spec.rb +++ b/spec/lib/gitlab/template/gitignore_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Template::GitignoreTemplate do +RSpec.describe Gitlab::Template::GitignoreTemplate do subject { described_class } describe '.all' do diff --git a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb index 52e100768a7..3004de6fe08 100644 --- a/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb +++ b/spec/lib/gitlab/template/gitlab_ci_yml_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Template::GitlabCiYmlTemplate do +RSpec.describe Gitlab::Template::GitlabCiYmlTemplate do subject { described_class } describe '.all' do diff --git a/spec/lib/gitlab/template/issue_template_spec.rb b/spec/lib/gitlab/template/issue_template_spec.rb index 54e46d3a9ec..4acbdcc4ba6 100644 --- a/spec/lib/gitlab/template/issue_template_spec.rb +++ b/spec/lib/gitlab/template/issue_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Template::IssueTemplate do +RSpec.describe Gitlab::Template::IssueTemplate do let(:project) { create(:project, :repository, create_templates: :issue) } describe '.all' do diff --git a/spec/lib/gitlab/template/merge_request_template_spec.rb b/spec/lib/gitlab/template/merge_request_template_spec.rb index bbc184d4dfc..abac0a10e18 100644 --- a/spec/lib/gitlab/template/merge_request_template_spec.rb +++ b/spec/lib/gitlab/template/merge_request_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Template::MergeRequestTemplate do +RSpec.describe Gitlab::Template::MergeRequestTemplate do let(:project) { create(:project, :repository, create_templates: :merge_request) } describe '.all' do diff --git a/spec/lib/gitlab/themes_spec.rb b/spec/lib/gitlab/themes_spec.rb index e0278eb9c7f..68ff28becfa 100644 --- a/spec/lib/gitlab/themes_spec.rb +++ b/spec/lib/gitlab/themes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Themes, lib: true do +RSpec.describe Gitlab::Themes, lib: true do describe '.body_classes' do it 'returns a space-separated list of class names' do css = described_class.body_classes diff --git a/spec/lib/gitlab/throttle_spec.rb b/spec/lib/gitlab/throttle_spec.rb index e3679a1a721..ca2abe94ad2 100644 --- a/spec/lib/gitlab/throttle_spec.rb +++ b/spec/lib/gitlab/throttle_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Throttle do +RSpec.describe Gitlab::Throttle do describe '.protected_paths_enabled?' do subject { described_class.protected_paths_enabled? } diff --git a/spec/lib/gitlab/time_tracking_formatter_spec.rb b/spec/lib/gitlab/time_tracking_formatter_spec.rb index cfc804c13a7..8bbd1263057 100644 --- a/spec/lib/gitlab/time_tracking_formatter_spec.rb +++ b/spec/lib/gitlab/time_tracking_formatter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::TimeTrackingFormatter do +RSpec.describe Gitlab::TimeTrackingFormatter do describe '#parse' do subject { described_class.parse(duration_string) } diff --git a/spec/lib/gitlab/tracking/incident_management_spec.rb b/spec/lib/gitlab/tracking/incident_management_spec.rb index 6f7e04b7c16..e8131b4eeee 100644 --- a/spec/lib/gitlab/tracking/incident_management_spec.rb +++ b/spec/lib/gitlab/tracking/incident_management_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Tracking::IncidentManagement do +RSpec.describe Gitlab::Tracking::IncidentManagement do describe '.track_from_params' do shared_examples 'a tracked event' do |label, value = nil| it 'creates the tracking event with the correct details' do diff --git a/spec/lib/gitlab/tracking_spec.rb b/spec/lib/gitlab/tracking_spec.rb index 82828c2dcce..65b6d9c8899 100644 --- a/spec/lib/gitlab/tracking_spec.rb +++ b/spec/lib/gitlab/tracking_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Tracking do +RSpec.describe Gitlab::Tracking do let(:timestamp) { Time.utc(2017, 3, 22) } before do diff --git a/spec/lib/gitlab/tree_summary_spec.rb b/spec/lib/gitlab/tree_summary_spec.rb index 593b8655e80..a00739f49d1 100644 --- a/spec/lib/gitlab/tree_summary_spec.rb +++ b/spec/lib/gitlab/tree_summary_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::TreeSummary do +RSpec.describe Gitlab::TreeSummary do using RSpec::Parameterized::TableSyntax let(:project) { create(:project, :empty_repo) } diff --git a/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb b/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb index cdd681a9345..42fc84cf076 100644 --- a/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb +++ b/spec/lib/gitlab/untrusted_regexp/ruby_syntax_spec.rb @@ -4,7 +4,7 @@ require 'fast_spec_helper' require 'support/shared_examples/lib/gitlab/malicious_regexp_shared_examples' require 'support/helpers/stub_feature_flags' -describe Gitlab::UntrustedRegexp::RubySyntax do +RSpec.describe Gitlab::UntrustedRegexp::RubySyntax do describe '.matches_syntax?' do it 'returns true if regexp is valid' do expect(described_class.matches_syntax?('/some .* thing/')) diff --git a/spec/lib/gitlab/untrusted_regexp_spec.rb b/spec/lib/gitlab/untrusted_regexp_spec.rb index 60f14d0277b..aac3d5e27f5 100644 --- a/spec/lib/gitlab/untrusted_regexp_spec.rb +++ b/spec/lib/gitlab/untrusted_regexp_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'support/shared_examples/lib/gitlab/malicious_regexp_shared_examples' -describe Gitlab::UntrustedRegexp do +RSpec.describe Gitlab::UntrustedRegexp do describe '#initialize' do subject { described_class.new(pattern) } diff --git a/spec/lib/gitlab/uploads_transfer_spec.rb b/spec/lib/gitlab/uploads_transfer_spec.rb index 16560fc8f12..80bbf68e98a 100644 --- a/spec/lib/gitlab/uploads_transfer_spec.rb +++ b/spec/lib/gitlab/uploads_transfer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UploadsTransfer do +RSpec.describe Gitlab::UploadsTransfer do it 'leaves avatar uploads where they are' do project_with_avatar = create(:project, :with_avatar) diff --git a/spec/lib/gitlab/url_blocker_spec.rb b/spec/lib/gitlab/url_blocker_spec.rb index 08678de87c9..7edfde09864 100644 --- a/spec/lib/gitlab/url_blocker_spec.rb +++ b/spec/lib/gitlab/url_blocker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UrlBlocker, :stub_invalid_dns_only do +RSpec.describe Gitlab::UrlBlocker, :stub_invalid_dns_only do include StubRequests describe '#validate!' do diff --git a/spec/lib/gitlab/url_blockers/domain_whitelist_entry_spec.rb b/spec/lib/gitlab/url_blockers/domain_whitelist_entry_spec.rb index 34ea6c328e6..58bae109146 100644 --- a/spec/lib/gitlab/url_blockers/domain_whitelist_entry_spec.rb +++ b/spec/lib/gitlab/url_blockers/domain_whitelist_entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UrlBlockers::DomainWhitelistEntry do +RSpec.describe Gitlab::UrlBlockers::DomainWhitelistEntry do let(:domain) { 'www.example.com' } describe '#initialize' do diff --git a/spec/lib/gitlab/url_blockers/ip_whitelist_entry_spec.rb b/spec/lib/gitlab/url_blockers/ip_whitelist_entry_spec.rb index 042d135d265..52f9b31165a 100644 --- a/spec/lib/gitlab/url_blockers/ip_whitelist_entry_spec.rb +++ b/spec/lib/gitlab/url_blockers/ip_whitelist_entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UrlBlockers::IpWhitelistEntry do +RSpec.describe Gitlab::UrlBlockers::IpWhitelistEntry do let(:ipv4) { IPAddr.new('192.168.1.1') } describe '#initialize' do diff --git a/spec/lib/gitlab/url_blockers/url_whitelist_spec.rb b/spec/lib/gitlab/url_blockers/url_whitelist_spec.rb index e43cd819838..7a65516be3c 100644 --- a/spec/lib/gitlab/url_blockers/url_whitelist_spec.rb +++ b/spec/lib/gitlab/url_blockers/url_whitelist_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UrlBlockers::UrlWhitelist do +RSpec.describe Gitlab::UrlBlockers::UrlWhitelist do include StubRequests let(:whitelist) { [] } diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb index e91d17bfbe8..d10601a5a2b 100644 --- a/spec/lib/gitlab/url_builder_spec.rb +++ b/spec/lib/gitlab/url_builder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UrlBuilder do +RSpec.describe Gitlab::UrlBuilder do subject { described_class } describe '#build' do diff --git a/spec/lib/gitlab/url_sanitizer_spec.rb b/spec/lib/gitlab/url_sanitizer_spec.rb index caca22eb98b..aba4ca109a9 100644 --- a/spec/lib/gitlab/url_sanitizer_spec.rb +++ b/spec/lib/gitlab/url_sanitizer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UrlSanitizer do +RSpec.describe Gitlab::UrlSanitizer do using RSpec::Parameterized::TableSyntax describe '.sanitize' do diff --git a/spec/lib/gitlab/usage_data_counters/cycle_analytics_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/cycle_analytics_counter_spec.rb index 71be37692e2..18c21ef7eba 100644 --- a/spec/lib/gitlab/usage_data_counters/cycle_analytics_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/cycle_analytics_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::CycleAnalyticsCounter do +RSpec.describe Gitlab::UsageDataCounters::CycleAnalyticsCounter do it_behaves_like 'a redis usage counter', 'CycleAnalytics', :views it_behaves_like 'a redis usage counter with totals', :cycle_analytics, views: 3 diff --git a/spec/lib/gitlab/usage_data_counters/designs_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/designs_counter_spec.rb index deaf7ebc7f3..10a09e737f9 100644 --- a/spec/lib/gitlab/usage_data_counters/designs_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/designs_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::DesignsCounter do +RSpec.describe Gitlab::UsageDataCounters::DesignsCounter do it_behaves_like 'a redis usage counter', 'Designs', :create it_behaves_like 'a redis usage counter', 'Designs', :update it_behaves_like 'a redis usage counter', 'Designs', :delete diff --git a/spec/lib/gitlab/usage_data_counters/merge_request_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/merge_request_counter_spec.rb index 4be4a661260..d16c73e9312 100644 --- a/spec/lib/gitlab/usage_data_counters/merge_request_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/merge_request_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::MergeRequestCounter do +RSpec.describe Gitlab::UsageDataCounters::MergeRequestCounter do it_behaves_like 'a redis usage counter', 'Merge Request', :create it_behaves_like 'a redis usage counter with totals', :merge_request, create: 5 diff --git a/spec/lib/gitlab/usage_data_counters/note_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/note_counter_spec.rb index b385d1b07c7..7e8f0172e06 100644 --- a/spec/lib/gitlab/usage_data_counters/note_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/note_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::NoteCounter, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::UsageDataCounters::NoteCounter, :clean_gitlab_redis_shared_state do shared_examples 'a note usage counter' do |event, noteable_type| describe ".count(#{event})" do it "increments the Note #{event} counter by 1" do diff --git a/spec/lib/gitlab/usage_data_counters/productivity_analytics_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/productivity_analytics_counter_spec.rb index f4e92791728..34b2cfcf1de 100644 --- a/spec/lib/gitlab/usage_data_counters/productivity_analytics_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/productivity_analytics_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::ProductivityAnalyticsCounter do +RSpec.describe Gitlab::UsageDataCounters::ProductivityAnalyticsCounter do it_behaves_like 'a redis usage counter', 'ProductivityAnalytics', :views it_behaves_like 'a redis usage counter with totals', :productivity_analytics, views: 3 diff --git a/spec/lib/gitlab/usage_data_counters/redis_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/redis_counter_spec.rb index c34ac7867ab..be528b081c5 100644 --- a/spec/lib/gitlab/usage_data_counters/redis_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/redis_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::RedisCounter, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::UsageDataCounters::RedisCounter, :clean_gitlab_redis_shared_state do let(:redis_key) { 'foobar' } subject { Class.new.extend(described_class) } diff --git a/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb index 35b0f9a67f4..b55e20ba555 100644 --- a/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/search_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::SearchCounter, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::UsageDataCounters::SearchCounter, :clean_gitlab_redis_shared_state do shared_examples_for 'usage counter with totals' do |counter| it 'increments counter and returns total count' do expect(described_class.read(counter)).to eq(0) diff --git a/spec/lib/gitlab/usage_data_counters/snippet_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/snippet_counter_spec.rb index 65381ed36d1..6109437da77 100644 --- a/spec/lib/gitlab/usage_data_counters/snippet_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/snippet_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::SnippetCounter do +RSpec.describe Gitlab::UsageDataCounters::SnippetCounter do it_behaves_like 'a redis usage counter', 'Snippet', :create it_behaves_like 'a redis usage counter', 'Snippet', :update diff --git a/spec/lib/gitlab/usage_data_counters/source_code_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/source_code_counter_spec.rb index 47077345e0c..73d5b4038f8 100644 --- a/spec/lib/gitlab/usage_data_counters/source_code_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/source_code_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::SourceCodeCounter do +RSpec.describe Gitlab::UsageDataCounters::SourceCodeCounter do it_behaves_like 'a redis usage counter', 'Source Code', :pushes it_behaves_like 'a redis usage counter with totals', :source_code, pushes: 5 diff --git a/spec/lib/gitlab/usage_data_counters/web_ide_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/web_ide_counter_spec.rb index 42abbecead0..b0e5bd18b66 100644 --- a/spec/lib/gitlab/usage_data_counters/web_ide_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/web_ide_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::WebIdeCounter, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::UsageDataCounters::WebIdeCounter, :clean_gitlab_redis_shared_state do shared_examples 'counter examples' do |event| it 'increments counter and return the total count' do expect(described_class.public_send(:total_count, event)).to eq(0) diff --git a/spec/lib/gitlab/usage_data_counters/wiki_page_counter_spec.rb b/spec/lib/gitlab/usage_data_counters/wiki_page_counter_spec.rb index 4e8ae35187e..685f6ea0a85 100644 --- a/spec/lib/gitlab/usage_data_counters/wiki_page_counter_spec.rb +++ b/spec/lib/gitlab/usage_data_counters/wiki_page_counter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageDataCounters::WikiPageCounter do +RSpec.describe Gitlab::UsageDataCounters::WikiPageCounter do it_behaves_like 'a redis usage counter', 'Wiki Page', :create it_behaves_like 'a redis usage counter', 'Wiki Page', :update it_behaves_like 'a redis usage counter', 'Wiki Page', :delete diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index 3c536dacd2a..dd32311e79e 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UsageData, :aggregate_failures do +RSpec.describe Gitlab::UsageData, :aggregate_failures do include UsageDataHelpers before do @@ -174,7 +174,9 @@ describe Gitlab::UsageData, :aggregate_failures do expect(count_data[:clusters_applications_jupyter]).to eq(1) expect(count_data[:clusters_management_project]).to eq(1) - expect(count_data[:snippets]).to eq(2) + expect(count_data[:snippets]).to eq(6) + expect(count_data[:personal_snippets]).to eq(2) + expect(count_data[:project_snippets]).to eq(4) end it 'gathers object store usage correctly' do @@ -261,7 +263,9 @@ describe Gitlab::UsageData, :aggregate_failures do it 'gathers projects data correctly' do counts_monthly = subject[:counts_monthly] - expect(counts_monthly[:snippets]).to eq(1) + expect(counts_monthly[:snippets]).to eq(3) + expect(counts_monthly[:personal_snippets]).to eq(1) + expect(counts_monthly[:project_snippets]).to eq(2) end end diff --git a/spec/lib/gitlab/user_access_snippet_spec.rb b/spec/lib/gitlab/user_access_snippet_spec.rb index 2e8a0a49a76..4143a3017e8 100644 --- a/spec/lib/gitlab/user_access_snippet_spec.rb +++ b/spec/lib/gitlab/user_access_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UserAccessSnippet do +RSpec.describe Gitlab::UserAccessSnippet do subject(:access) { described_class.new(user, snippet: snippet) } let_it_be(:project) { create(:project, :private) } diff --git a/spec/lib/gitlab/user_access_spec.rb b/spec/lib/gitlab/user_access_spec.rb index 78370f0136c..1a81d0127dc 100644 --- a/spec/lib/gitlab/user_access_spec.rb +++ b/spec/lib/gitlab/user_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::UserAccess do +RSpec.describe Gitlab::UserAccess do include ProjectForksHelper let(:access) { described_class.new(user, project: project) } diff --git a/spec/lib/gitlab/utils/deep_size_spec.rb b/spec/lib/gitlab/utils/deep_size_spec.rb index 5a155fb6c80..7595fb2c1b0 100644 --- a/spec/lib/gitlab/utils/deep_size_spec.rb +++ b/spec/lib/gitlab/utils/deep_size_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Utils::DeepSize do +RSpec.describe Gitlab::Utils::DeepSize do let(:data) do { a: [1, 2, 3], diff --git a/spec/lib/gitlab/utils/inline_hash_spec.rb b/spec/lib/gitlab/utils/inline_hash_spec.rb index 867db0b92a5..d1354a7ae0a 100644 --- a/spec/lib/gitlab/utils/inline_hash_spec.rb +++ b/spec/lib/gitlab/utils/inline_hash_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Utils::InlineHash do +RSpec.describe Gitlab::Utils::InlineHash do describe '.merge_keys' do subject { described_class.merge_keys(source) } diff --git a/spec/lib/gitlab/utils/json_size_estimator_spec.rb b/spec/lib/gitlab/utils/json_size_estimator_spec.rb index ae24e25558a..5fd66caa5e9 100644 --- a/spec/lib/gitlab/utils/json_size_estimator_spec.rb +++ b/spec/lib/gitlab/utils/json_size_estimator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Utils::JsonSizeEstimator do +RSpec.describe Gitlab::Utils::JsonSizeEstimator do RSpec::Matchers.define :match_json_bytesize_of do |expected| match do |actual| actual == expected.to_json.bytesize diff --git a/spec/lib/gitlab/utils/lazy_attributes_spec.rb b/spec/lib/gitlab/utils/lazy_attributes_spec.rb index c0005c194c4..dfffe70defb 100644 --- a/spec/lib/gitlab/utils/lazy_attributes_spec.rb +++ b/spec/lib/gitlab/utils/lazy_attributes_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' require 'active_support/concern' -describe Gitlab::Utils::LazyAttributes do +RSpec.describe Gitlab::Utils::LazyAttributes do subject(:klass) do Class.new do include Gitlab::Utils::LazyAttributes diff --git a/spec/lib/gitlab/utils/log_limited_array_spec.rb b/spec/lib/gitlab/utils/log_limited_array_spec.rb index a236ab37614..a55a176be48 100644 --- a/spec/lib/gitlab/utils/log_limited_array_spec.rb +++ b/spec/lib/gitlab/utils/log_limited_array_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Utils::LogLimitedArray do +RSpec.describe Gitlab::Utils::LogLimitedArray do describe '.log_limited_array' do context 'when the argument is not an array' do it 'returns an empty array' do diff --git a/spec/lib/gitlab/utils/measuring_spec.rb b/spec/lib/gitlab/utils/measuring_spec.rb index 254f53f7da3..4931ebf26f0 100644 --- a/spec/lib/gitlab/utils/measuring_spec.rb +++ b/spec/lib/gitlab/utils/measuring_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Utils::Measuring do +RSpec.describe Gitlab::Utils::Measuring do describe '#with_measuring' do let(:base_log_data) { {} } let(:result) { "result" } diff --git a/spec/lib/gitlab/utils/merge_hash_spec.rb b/spec/lib/gitlab/utils/merge_hash_spec.rb index 72620e549a9..11daa05c9ee 100644 --- a/spec/lib/gitlab/utils/merge_hash_spec.rb +++ b/spec/lib/gitlab/utils/merge_hash_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::Utils::MergeHash do +RSpec.describe Gitlab::Utils::MergeHash do describe '.crush' do it 'can flatten a hash to each element' do input = { hello: "world", this: { crushes: ["an entire", "hash"] } } diff --git a/spec/lib/gitlab/utils/override_spec.rb b/spec/lib/gitlab/utils/override_spec.rb index e2776efac85..7ba7392df0f 100644 --- a/spec/lib/gitlab/utils/override_spec.rb +++ b/spec/lib/gitlab/utils/override_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Utils::Override do +RSpec.describe Gitlab::Utils::Override do let(:base) do Struct.new(:good) do def self.good diff --git a/spec/lib/gitlab/utils/safe_inline_hash_spec.rb b/spec/lib/gitlab/utils/safe_inline_hash_spec.rb index 617845332bc..f7c50140cf7 100644 --- a/spec/lib/gitlab/utils/safe_inline_hash_spec.rb +++ b/spec/lib/gitlab/utils/safe_inline_hash_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Gitlab::Utils::SafeInlineHash do +RSpec.describe Gitlab::Utils::SafeInlineHash do describe '.merge_keys!' do let(:source) { { 'foo' => { 'bar' => 'baz' } } } let(:validator) { instance_double(Gitlab::Utils::DeepSize, valid?: valid) } diff --git a/spec/lib/gitlab/utils/sanitize_node_link_spec.rb b/spec/lib/gitlab/utils/sanitize_node_link_spec.rb index dd379f2fe1f..514051b1cc0 100644 --- a/spec/lib/gitlab/utils/sanitize_node_link_spec.rb +++ b/spec/lib/gitlab/utils/sanitize_node_link_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Utils::SanitizeNodeLink do +RSpec.describe Gitlab::Utils::SanitizeNodeLink do let(:klass) do struct = Struct.new(:value) struct.include(described_class) diff --git a/spec/lib/gitlab/utils/strong_memoize_spec.rb b/spec/lib/gitlab/utils/strong_memoize_spec.rb index 624e799c5e9..d9fa2e516e1 100644 --- a/spec/lib/gitlab/utils/strong_memoize_spec.rb +++ b/spec/lib/gitlab/utils/strong_memoize_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Utils::StrongMemoize do +RSpec.describe Gitlab::Utils::StrongMemoize do let(:klass) do struct = Struct.new(:value) do def method_name diff --git a/spec/lib/gitlab/utils/usage_data_spec.rb b/spec/lib/gitlab/utils/usage_data_spec.rb index aeb90156c1c..bc5636c6923 100644 --- a/spec/lib/gitlab/utils/usage_data_spec.rb +++ b/spec/lib/gitlab/utils/usage_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Utils::UsageData do +RSpec.describe Gitlab::Utils::UsageData do describe '#count' do let(:relation) { double(:relation) } diff --git a/spec/lib/gitlab/utils_spec.rb b/spec/lib/gitlab/utils_spec.rb index 3a2430d1f2d..4b7a1aa24f4 100644 --- a/spec/lib/gitlab/utils_spec.rb +++ b/spec/lib/gitlab/utils_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Utils do +RSpec.describe Gitlab::Utils do delegate :to_boolean, :boolean_to_yes_no, :slugify, :random_string, :which, :ensure_array_from_string, :to_exclusive_sentence, :bytes_to_megabytes, :append_path, :check_path_traversal!, :ms_to_round_sec, to: :described_class diff --git a/spec/lib/gitlab/verify/job_artifacts_spec.rb b/spec/lib/gitlab/verify/job_artifacts_spec.rb index b50ec1528d4..fde7ebd442e 100644 --- a/spec/lib/gitlab/verify/job_artifacts_spec.rb +++ b/spec/lib/gitlab/verify/job_artifacts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Verify::JobArtifacts do +RSpec.describe Gitlab::Verify::JobArtifacts do include GitlabVerifyHelpers it_behaves_like 'Gitlab::Verify::BatchVerifier subclass' do diff --git a/spec/lib/gitlab/verify/lfs_objects_spec.rb b/spec/lib/gitlab/verify/lfs_objects_spec.rb index c27c9b6efa1..760162dd627 100644 --- a/spec/lib/gitlab/verify/lfs_objects_spec.rb +++ b/spec/lib/gitlab/verify/lfs_objects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Verify::LfsObjects do +RSpec.describe Gitlab::Verify::LfsObjects do include GitlabVerifyHelpers it_behaves_like 'Gitlab::Verify::BatchVerifier subclass' do diff --git a/spec/lib/gitlab/verify/uploads_spec.rb b/spec/lib/gitlab/verify/uploads_spec.rb index a3d3f5d46f3..3e5154d5029 100644 --- a/spec/lib/gitlab/verify/uploads_spec.rb +++ b/spec/lib/gitlab/verify/uploads_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Verify::Uploads do +RSpec.describe Gitlab::Verify::Uploads do include GitlabVerifyHelpers it_behaves_like 'Gitlab::Verify::BatchVerifier subclass' do diff --git a/spec/lib/gitlab/version_info_spec.rb b/spec/lib/gitlab/version_info_spec.rb index 8c14b187410..f81e3aa070a 100644 --- a/spec/lib/gitlab/version_info_spec.rb +++ b/spec/lib/gitlab/version_info_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Gitlab::VersionInfo' do +RSpec.describe 'Gitlab::VersionInfo' do before do @unknown = Gitlab::VersionInfo.new @v0_0_1 = Gitlab::VersionInfo.new(0, 0, 1) diff --git a/spec/lib/gitlab/view/presenter/base_spec.rb b/spec/lib/gitlab/view/presenter/base_spec.rb index e196ab23482..1ab6973e279 100644 --- a/spec/lib/gitlab/view/presenter/base_spec.rb +++ b/spec/lib/gitlab/view/presenter/base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::View::Presenter::Base do +RSpec.describe Gitlab::View::Presenter::Base do let(:project) { double(:project) } let(:presenter_class) do Struct.new(:subject).include(described_class) diff --git a/spec/lib/gitlab/view/presenter/delegated_spec.rb b/spec/lib/gitlab/view/presenter/delegated_spec.rb index 0a21cd1358e..27cff970f06 100644 --- a/spec/lib/gitlab/view/presenter/delegated_spec.rb +++ b/spec/lib/gitlab/view/presenter/delegated_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::View::Presenter::Delegated do +RSpec.describe Gitlab::View::Presenter::Delegated do let(:project) { double(:project, user: 'John Doe') } let(:presenter_class) do Class.new(described_class) diff --git a/spec/lib/gitlab/view/presenter/factory_spec.rb b/spec/lib/gitlab/view/presenter/factory_spec.rb index 7bf3c325019..92986e89b73 100644 --- a/spec/lib/gitlab/view/presenter/factory_spec.rb +++ b/spec/lib/gitlab/view/presenter/factory_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::View::Presenter::Factory do +RSpec.describe Gitlab::View::Presenter::Factory do let(:build) { Ci::Build.new } describe '#initialize' do diff --git a/spec/lib/gitlab/view/presenter/simple_spec.rb b/spec/lib/gitlab/view/presenter/simple_spec.rb index 70e2b170a36..2b764fcccef 100644 --- a/spec/lib/gitlab/view/presenter/simple_spec.rb +++ b/spec/lib/gitlab/view/presenter/simple_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::View::Presenter::Simple do +RSpec.describe Gitlab::View::Presenter::Simple do let(:project) { double(:project, user: 'John Doe') } let(:presenter_class) do Class.new(described_class) diff --git a/spec/lib/gitlab/visibility_level_checker_spec.rb b/spec/lib/gitlab/visibility_level_checker_spec.rb index fc929d5cbbf..833021a22ca 100644 --- a/spec/lib/gitlab/visibility_level_checker_spec.rb +++ b/spec/lib/gitlab/visibility_level_checker_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::VisibilityLevelChecker do +RSpec.describe Gitlab::VisibilityLevelChecker do let(:user) { create(:user) } let(:project) { create(:project) } let(:visibility_level_checker) { } diff --git a/spec/lib/gitlab/visibility_level_spec.rb b/spec/lib/gitlab/visibility_level_spec.rb index a249b3a235e..2ac343cd1e7 100644 --- a/spec/lib/gitlab/visibility_level_spec.rb +++ b/spec/lib/gitlab/visibility_level_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::VisibilityLevel do +RSpec.describe Gitlab::VisibilityLevel do describe '.level_value' do it 'converts "public" to integer value' do expect(described_class.level_value('public')).to eq(Gitlab::VisibilityLevel::PUBLIC) diff --git a/spec/lib/gitlab/web_ide/config/entry/global_spec.rb b/spec/lib/gitlab/web_ide/config/entry/global_spec.rb index 04b0752c6fe..3a50667163b 100644 --- a/spec/lib/gitlab/web_ide/config/entry/global_spec.rb +++ b/spec/lib/gitlab/web_ide/config/entry/global_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::WebIde::Config::Entry::Global do +RSpec.describe Gitlab::WebIde::Config::Entry::Global do let(:global) { described_class.new(hash) } describe '.nodes' do diff --git a/spec/lib/gitlab/web_ide/config/entry/terminal_spec.rb b/spec/lib/gitlab/web_ide/config/entry/terminal_spec.rb index 882e389e040..0df0f56f440 100644 --- a/spec/lib/gitlab/web_ide/config/entry/terminal_spec.rb +++ b/spec/lib/gitlab/web_ide/config/entry/terminal_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::WebIde::Config::Entry::Terminal do +RSpec.describe Gitlab::WebIde::Config::Entry::Terminal do let(:entry) { described_class.new(config, with_image_ports: true) } describe '.nodes' do diff --git a/spec/lib/gitlab/web_ide/config_spec.rb b/spec/lib/gitlab/web_ide/config_spec.rb index c1dafd01197..7a9011d03c0 100644 --- a/spec/lib/gitlab/web_ide/config_spec.rb +++ b/spec/lib/gitlab/web_ide/config_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::WebIde::Config do +RSpec.describe Gitlab::WebIde::Config do let(:config) do described_class.new(yml) end diff --git a/spec/lib/gitlab/wiki_file_finder_spec.rb b/spec/lib/gitlab/wiki_file_finder_spec.rb index aeba081f3d3..7abe92a5a2b 100644 --- a/spec/lib/gitlab/wiki_file_finder_spec.rb +++ b/spec/lib/gitlab/wiki_file_finder_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::WikiFileFinder do +RSpec.describe Gitlab::WikiFileFinder do describe '#find' do let(:project) { create(:project, :public, :wiki_repo) } let(:wiki) { build(:project_wiki, project: project) } diff --git a/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb b/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb index 01701589e63..c78103f33f4 100644 --- a/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb +++ b/spec/lib/gitlab/wiki_pages/front_matter_parser_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::WikiPages::FrontMatterParser do +RSpec.describe Gitlab::WikiPages::FrontMatterParser do subject(:parser) { described_class.new(raw_content, gate) } let(:content) { 'This is the content' } diff --git a/spec/lib/gitlab/with_request_store_spec.rb b/spec/lib/gitlab/with_request_store_spec.rb index 1ef8d986f96..353ad02fbd8 100644 --- a/spec/lib/gitlab/with_request_store_spec.rb +++ b/spec/lib/gitlab/with_request_store_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'request_store' -describe Gitlab::WithRequestStore do +RSpec.describe Gitlab::WithRequestStore do let(:fake_class) { Class.new { include Gitlab::WithRequestStore } } subject(:object) { fake_class.new } diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb index 53b6f461a48..5cb08ac1e76 100644 --- a/spec/lib/gitlab/workhorse_spec.rb +++ b/spec/lib/gitlab/workhorse_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::Workhorse do +RSpec.describe Gitlab::Workhorse do let_it_be(:project) { create(:project, :repository) } let(:repository) { project.repository } diff --git a/spec/lib/gitlab/x509/commit_spec.rb b/spec/lib/gitlab/x509/commit_spec.rb index ac93609b467..a81955b995e 100644 --- a/spec/lib/gitlab/x509/commit_spec.rb +++ b/spec/lib/gitlab/x509/commit_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::X509::Commit do +RSpec.describe Gitlab::X509::Commit do describe '#signature' do let(:signature) { described_class.new(commit).signature } diff --git a/spec/lib/gitlab/x509/signature_spec.rb b/spec/lib/gitlab/x509/signature_spec.rb index cff2fd7748b..ac6f7e49fe0 100644 --- a/spec/lib/gitlab/x509/signature_spec.rb +++ b/spec/lib/gitlab/x509/signature_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::X509::Signature do +RSpec.describe Gitlab::X509::Signature do let(:issuer_attributes) do { subject_key_identifier: X509Helpers::User1.issuer_subject_key_identifier, diff --git a/spec/lib/gitlab/x509/tag_spec.rb b/spec/lib/gitlab/x509/tag_spec.rb index 4bc9723bd0d..b011ea515de 100644 --- a/spec/lib/gitlab/x509/tag_spec.rb +++ b/spec/lib/gitlab/x509/tag_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Gitlab::X509::Tag do +RSpec.describe Gitlab::X509::Tag do subject(:signature) { described_class.new(tag).signature } describe '#signature' do diff --git a/spec/lib/gitlab/zoom_link_extractor_spec.rb b/spec/lib/gitlab/zoom_link_extractor_spec.rb index c3d1679d031..363668fb2b5 100644 --- a/spec/lib/gitlab/zoom_link_extractor_spec.rb +++ b/spec/lib/gitlab/zoom_link_extractor_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab::ZoomLinkExtractor do +RSpec.describe Gitlab::ZoomLinkExtractor do describe "#links" do using RSpec::Parameterized::TableSyntax diff --git a/spec/lib/gitlab_danger_spec.rb b/spec/lib/gitlab_danger_spec.rb index 8115fbca5e0..49c7a46f321 100644 --- a/spec/lib/gitlab_danger_spec.rb +++ b/spec/lib/gitlab_danger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GitlabDanger do +RSpec.describe GitlabDanger do let(:gitlab_danger_helper) { nil } subject { described_class.new(gitlab_danger_helper) } diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb index 84d072a50ec..7c2758bf27e 100644 --- a/spec/lib/gitlab_spec.rb +++ b/spec/lib/gitlab_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Gitlab do +RSpec.describe Gitlab do describe '.root' do it 'returns the root path of the app' do expect(described_class.root).to eq(Pathname.new(File.expand_path('../..', __dir__))) diff --git a/spec/lib/google_api/auth_spec.rb b/spec/lib/google_api/auth_spec.rb index fa4e6288681..eeb99bfbb6c 100644 --- a/spec/lib/google_api/auth_spec.rb +++ b/spec/lib/google_api/auth_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GoogleApi::Auth do +RSpec.describe GoogleApi::Auth do let(:redirect_uri) { 'http://localhost:3000/google_api/authorizations/callback' } let(:redirect_to) { 'http://localhost:3000/namaspace/project/clusters' } diff --git a/spec/lib/google_api/cloud_platform/client_spec.rb b/spec/lib/google_api/cloud_platform/client_spec.rb index bd063648ca1..d217699f79d 100644 --- a/spec/lib/google_api/cloud_platform/client_spec.rb +++ b/spec/lib/google_api/cloud_platform/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GoogleApi::CloudPlatform::Client do +RSpec.describe GoogleApi::CloudPlatform::Client do let(:token) { 'token' } let(:client) { described_class.new(token, nil) } let(:user_agent_options) { client.instance_eval { user_agent_header } } diff --git a/spec/lib/grafana/client_spec.rb b/spec/lib/grafana/client_spec.rb index 699344e940e..c233d0b8445 100644 --- a/spec/lib/grafana/client_spec.rb +++ b/spec/lib/grafana/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Grafana::Client do +RSpec.describe Grafana::Client do let(:grafana_url) { 'https://grafanatest.com/-/grafana-project' } let(:token) { 'test-token' } diff --git a/spec/lib/grafana/time_window_spec.rb b/spec/lib/grafana/time_window_spec.rb index e70861658ca..9ee65c6cf20 100644 --- a/spec/lib/grafana/time_window_spec.rb +++ b/spec/lib/grafana/time_window_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Grafana::TimeWindow do +RSpec.describe Grafana::TimeWindow do let(:from) { '1552799400000' } let(:to) { '1552828200000' } @@ -32,7 +32,7 @@ describe Grafana::TimeWindow do end end -describe Grafana::RangeWithDefaults do +RSpec.describe Grafana::RangeWithDefaults do let(:from) { Grafana::Timestamp.from_ms_since_epoch('1552799400000') } let(:to) { Grafana::Timestamp.from_ms_since_epoch('1552828200000') } @@ -78,7 +78,7 @@ describe Grafana::RangeWithDefaults do end end -describe Grafana::Timestamp do +RSpec.describe Grafana::Timestamp do let(:timestamp) { Time.at(1552799400) } around do |example| diff --git a/spec/lib/grafana/validator_spec.rb b/spec/lib/grafana/validator_spec.rb index a048a1f3470..b45749ffc95 100644 --- a/spec/lib/grafana/validator_spec.rb +++ b/spec/lib/grafana/validator_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Grafana::Validator do +RSpec.describe Grafana::Validator do let(:grafana_dashboard) { Gitlab::Json.parse(fixture_file('grafana/simplified_dashboard_response.json'), symbolize_names: true) } let(:datasource) { Gitlab::Json.parse(fixture_file('grafana/datasource_response.json'), symbolize_names: true) } let(:panel) { grafana_dashboard[:dashboard][:panels].first } diff --git a/spec/lib/json_web_token/hmac_token_spec.rb b/spec/lib/json_web_token/hmac_token_spec.rb index f2cbc381967..cf7e5c54f45 100644 --- a/spec/lib/json_web_token/hmac_token_spec.rb +++ b/spec/lib/json_web_token/hmac_token_spec.rb @@ -3,7 +3,7 @@ require 'json' require 'timecop' -describe JSONWebToken::HMACToken do +RSpec.describe JSONWebToken::HMACToken do let(:secret) { 'shh secret squirrel' } shared_examples 'a valid, non-expired token' do diff --git a/spec/lib/json_web_token/rsa_token_spec.rb b/spec/lib/json_web_token/rsa_token_spec.rb index 62fddbb97c7..f19471917c2 100644 --- a/spec/lib/json_web_token/rsa_token_spec.rb +++ b/spec/lib/json_web_token/rsa_token_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe JSONWebToken::RSAToken do +RSpec.describe JSONWebToken::RSAToken do let(:rsa_key) do OpenSSL::PKey::RSA.new <<-eos.strip_heredoc -----BEGIN RSA PRIVATE KEY----- diff --git a/spec/lib/json_web_token/token_spec.rb b/spec/lib/json_web_token/token_spec.rb index ca587a6ebcd..6fb15ae0a9c 100644 --- a/spec/lib/json_web_token/token_spec.rb +++ b/spec/lib/json_web_token/token_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -describe JSONWebToken::Token do +RSpec.describe JSONWebToken::Token do let(:token) { described_class.new } context 'custom parameters' do diff --git a/spec/lib/marginalia_spec.rb b/spec/lib/marginalia_spec.rb index 2f446694083..a920f598c24 100644 --- a/spec/lib/marginalia_spec.rb +++ b/spec/lib/marginalia_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'Marginalia spec' do +RSpec.describe 'Marginalia spec' do class MarginaliaTestController < ActionController::Base def first_user User.first diff --git a/spec/lib/mattermost/client_spec.rb b/spec/lib/mattermost/client_spec.rb index 5fe35eb5f93..32755d1103c 100644 --- a/spec/lib/mattermost/client_spec.rb +++ b/spec/lib/mattermost/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mattermost::Client do +RSpec.describe Mattermost::Client do let(:user) { build(:user) } subject { described_class.new(user) } diff --git a/spec/lib/mattermost/command_spec.rb b/spec/lib/mattermost/command_spec.rb index f8c451a1522..26d1ec32232 100644 --- a/spec/lib/mattermost/command_spec.rb +++ b/spec/lib/mattermost/command_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mattermost::Command do +RSpec.describe Mattermost::Command do let(:params) { { 'token' => 'token', team_id: 'abc' } } before do diff --git a/spec/lib/mattermost/session_spec.rb b/spec/lib/mattermost/session_spec.rb index ea12bd76c8d..5110d3cdfa3 100644 --- a/spec/lib/mattermost/session_spec.rb +++ b/spec/lib/mattermost/session_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mattermost::Session, type: :request do +RSpec.describe Mattermost::Session, type: :request do include ExclusiveLeaseHelpers include StubRequests diff --git a/spec/lib/mattermost/team_spec.rb b/spec/lib/mattermost/team_spec.rb index 2823dab67c9..0870114ca28 100644 --- a/spec/lib/mattermost/team_spec.rb +++ b/spec/lib/mattermost/team_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mattermost::Team do +RSpec.describe Mattermost::Team do before do session = Mattermost::Session.new(nil) session.base_uri = 'http://mattermost.example.com' diff --git a/spec/lib/microsoft_teams/activity_spec.rb b/spec/lib/microsoft_teams/activity_spec.rb index 3fad2437f3e..d1eac7204a6 100644 --- a/spec/lib/microsoft_teams/activity_spec.rb +++ b/spec/lib/microsoft_teams/activity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MicrosoftTeams::Activity do +RSpec.describe MicrosoftTeams::Activity do subject { described_class.new(title: 'title', subtitle: 'subtitle', text: 'text', image: 'image') } describe '#prepare' do diff --git a/spec/lib/microsoft_teams/notifier_spec.rb b/spec/lib/microsoft_teams/notifier_spec.rb index 25538db159e..c35d7e8420c 100644 --- a/spec/lib/microsoft_teams/notifier_spec.rb +++ b/spec/lib/microsoft_teams/notifier_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MicrosoftTeams::Notifier do +RSpec.describe MicrosoftTeams::Notifier do subject { described_class.new(webhook_url) } let(:webhook_url) { 'https://example.gitlab.com/'} diff --git a/spec/lib/object_storage/direct_upload_spec.rb b/spec/lib/object_storage/direct_upload_spec.rb index c286a2e6fbe..e7d8b1de34e 100644 --- a/spec/lib/object_storage/direct_upload_spec.rb +++ b/spec/lib/object_storage/direct_upload_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ObjectStorage::DirectUpload do +RSpec.describe ObjectStorage::DirectUpload do let(:region) { 'us-east-1' } let(:path_style) { false } let(:use_iam_profile) { false } diff --git a/spec/lib/omni_auth/strategies/jwt_spec.rb b/spec/lib/omni_auth/strategies/jwt_spec.rb index 302329cf198..0f4528d4fbe 100644 --- a/spec/lib/omni_auth/strategies/jwt_spec.rb +++ b/spec/lib/omni_auth/strategies/jwt_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OmniAuth::Strategies::Jwt do +RSpec.describe OmniAuth::Strategies::Jwt do include Rack::Test::Methods include DeviseHelpers diff --git a/spec/lib/peek/views/bullet_detailed_spec.rb b/spec/lib/peek/views/bullet_detailed_spec.rb index a482cadc7db..ec2f798a320 100644 --- a/spec/lib/peek/views/bullet_detailed_spec.rb +++ b/spec/lib/peek/views/bullet_detailed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Peek::Views::BulletDetailed do +RSpec.describe Peek::Views::BulletDetailed do subject { described_class.new } before do diff --git a/spec/lib/peek/views/detailed_view_spec.rb b/spec/lib/peek/views/detailed_view_spec.rb index d8660a55ea9..8d6d9a829ef 100644 --- a/spec/lib/peek/views/detailed_view_spec.rb +++ b/spec/lib/peek/views/detailed_view_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Peek::Views::DetailedView, :request_store do +RSpec.describe Peek::Views::DetailedView, :request_store do context 'when a class defines thresholds' do let(:threshold_view) do Class.new(described_class) do diff --git a/spec/lib/peek/views/redis_detailed_spec.rb b/spec/lib/peek/views/redis_detailed_spec.rb index a270c006a43..a757af50dcb 100644 --- a/spec/lib/peek/views/redis_detailed_spec.rb +++ b/spec/lib/peek/views/redis_detailed_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Peek::Views::RedisDetailed, :request_store do +RSpec.describe Peek::Views::RedisDetailed, :request_store do subject { described_class.new } using RSpec::Parameterized::TableSyntax diff --git a/spec/lib/peek/views/rugged_spec.rb b/spec/lib/peek/views/rugged_spec.rb index 39968afed39..31418b5fc81 100644 --- a/spec/lib/peek/views/rugged_spec.rb +++ b/spec/lib/peek/views/rugged_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Peek::Views::Rugged, :request_store do +RSpec.describe Peek::Views::Rugged, :request_store do subject { described_class.new } let(:project) { create(:project) } diff --git a/spec/lib/prometheus/cleanup_multiproc_dir_service_spec.rb b/spec/lib/prometheus/cleanup_multiproc_dir_service_spec.rb index c7302a1a656..db77a5d42d8 100644 --- a/spec/lib/prometheus/cleanup_multiproc_dir_service_spec.rb +++ b/spec/lib/prometheus/cleanup_multiproc_dir_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Prometheus::CleanupMultiprocDirService do +RSpec.describe Prometheus::CleanupMultiprocDirService do describe '.call' do subject { described_class.new.execute } diff --git a/spec/lib/prometheus/pid_provider_spec.rb b/spec/lib/prometheus/pid_provider_spec.rb index 5a17f25f144..f1d7f2ffff5 100644 --- a/spec/lib/prometheus/pid_provider_spec.rb +++ b/spec/lib/prometheus/pid_provider_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Prometheus::PidProvider do +RSpec.describe Prometheus::PidProvider do describe '.worker_id' do subject { described_class.worker_id } diff --git a/spec/lib/rspec_flaky/config_spec.rb b/spec/lib/rspec_flaky/config_spec.rb index 13b2219267b..6b148599b67 100644 --- a/spec/lib/rspec_flaky/config_spec.rb +++ b/spec/lib/rspec_flaky/config_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RspecFlaky::Config, :aggregate_failures do +RSpec.describe RspecFlaky::Config, :aggregate_failures do before do # Stub these env variables otherwise specs don't behave the same on the CI stub_env('FLAKY_RSPEC_GENERATE_REPORT', nil) diff --git a/spec/lib/rspec_flaky/example_spec.rb b/spec/lib/rspec_flaky/example_spec.rb index 4679dd818db..aaf5ddc6f74 100644 --- a/spec/lib/rspec_flaky/example_spec.rb +++ b/spec/lib/rspec_flaky/example_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RspecFlaky::Example do +RSpec.describe RspecFlaky::Example do let(:example_attrs) do { id: 'spec/foo/bar_spec.rb:2', diff --git a/spec/lib/rspec_flaky/flaky_example_spec.rb b/spec/lib/rspec_flaky/flaky_example_spec.rb index d4a1d6c882a..8ac323475d6 100644 --- a/spec/lib/rspec_flaky/flaky_example_spec.rb +++ b/spec/lib/rspec_flaky/flaky_example_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RspecFlaky::FlakyExample, :aggregate_failures do +RSpec.describe RspecFlaky::FlakyExample, :aggregate_failures do let(:flaky_example_attrs) do { example_id: 'spec/foo/bar_spec.rb:2', diff --git a/spec/lib/rspec_flaky/flaky_examples_collection_spec.rb b/spec/lib/rspec_flaky/flaky_examples_collection_spec.rb index 2e224cda61b..5718d8211af 100644 --- a/spec/lib/rspec_flaky/flaky_examples_collection_spec.rb +++ b/spec/lib/rspec_flaky/flaky_examples_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RspecFlaky::FlakyExamplesCollection, :aggregate_failures do +RSpec.describe RspecFlaky::FlakyExamplesCollection, :aggregate_failures do let(:collection_hash) do { a: { example_id: 'spec/foo/bar_spec.rb:2' }, diff --git a/spec/lib/rspec_flaky/listener_spec.rb b/spec/lib/rspec_flaky/listener_spec.rb index 44b8d99b74f..2438ae171d3 100644 --- a/spec/lib/rspec_flaky/listener_spec.rb +++ b/spec/lib/rspec_flaky/listener_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RspecFlaky::Listener, :aggregate_failures do +RSpec.describe RspecFlaky::Listener, :aggregate_failures do let(:already_flaky_example_uid) { '6e869794f4cfd2badd93eb68719371d1' } let(:suite_flaky_example_report) do { diff --git a/spec/lib/rspec_flaky/report_spec.rb b/spec/lib/rspec_flaky/report_spec.rb index 37330f39e1c..e735329a8a3 100644 --- a/spec/lib/rspec_flaky/report_spec.rb +++ b/spec/lib/rspec_flaky/report_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RspecFlaky::Report, :aggregate_failures do +RSpec.describe RspecFlaky::Report, :aggregate_failures do let(:thirty_one_days) { 3600 * 24 * 31 } let(:collection_hash) do { diff --git a/spec/lib/safe_zip/entry_spec.rb b/spec/lib/safe_zip/entry_spec.rb index be3d46917ee..9929b8073a0 100644 --- a/spec/lib/safe_zip/entry_spec.rb +++ b/spec/lib/safe_zip/entry_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SafeZip::Entry do +RSpec.describe SafeZip::Entry do let(:target_path) { Dir.mktmpdir('safe-zip') } let(:directories) { %w(public folder/with/subfolder) } let(:params) { SafeZip::ExtractParams.new(directories: directories, to: target_path) } diff --git a/spec/lib/safe_zip/extract_params_spec.rb b/spec/lib/safe_zip/extract_params_spec.rb index f66d3de89ee..880c4358663 100644 --- a/spec/lib/safe_zip/extract_params_spec.rb +++ b/spec/lib/safe_zip/extract_params_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SafeZip::ExtractParams do +RSpec.describe SafeZip::ExtractParams do let(:target_path) { Dir.mktmpdir("safe-zip") } let(:params) { described_class.new(directories: directories, to: target_path) } let(:directories) { %w(public folder/with/subfolder) } diff --git a/spec/lib/safe_zip/extract_spec.rb b/spec/lib/safe_zip/extract_spec.rb index d388135c3fb..30b7e1cdd2c 100644 --- a/spec/lib/safe_zip/extract_spec.rb +++ b/spec/lib/safe_zip/extract_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SafeZip::Extract do +RSpec.describe SafeZip::Extract do let(:target_path) { Dir.mktmpdir('safe-zip') } let(:directories) { %w(public) } let(:object) { described_class.new(archive) } diff --git a/spec/lib/sentry/api_urls_spec.rb b/spec/lib/sentry/api_urls_spec.rb index 78455f8d51f..d56b4397e1c 100644 --- a/spec/lib/sentry/api_urls_spec.rb +++ b/spec/lib/sentry/api_urls_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::ApiUrls do +RSpec.describe Sentry::ApiUrls do let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project/' } let(:token) { 'test-token' } let(:issue_id) { '123456' } diff --git a/spec/lib/sentry/client/event_spec.rb b/spec/lib/sentry/client/event_spec.rb index 58891895bfa..af1e28d09bb 100644 --- a/spec/lib/sentry/client/event_spec.rb +++ b/spec/lib/sentry/client/event_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::Client do +RSpec.describe Sentry::Client do include SentryClientHelpers let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project' } diff --git a/spec/lib/sentry/client/issue_link_spec.rb b/spec/lib/sentry/client/issue_link_spec.rb index 293937f6100..fe3abe7cb23 100644 --- a/spec/lib/sentry/client/issue_link_spec.rb +++ b/spec/lib/sentry/client/issue_link_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::Client::IssueLink do +RSpec.describe Sentry::Client::IssueLink do include SentryClientHelpers let_it_be(:sentry_url) { 'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project' } diff --git a/spec/lib/sentry/client/issue_spec.rb b/spec/lib/sentry/client/issue_spec.rb index b683ad6d4a9..ec479d626bf 100644 --- a/spec/lib/sentry/client/issue_spec.rb +++ b/spec/lib/sentry/client/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::Client::Issue do +RSpec.describe Sentry::Client::Issue do include SentryClientHelpers let(:token) { 'test-token' } diff --git a/spec/lib/sentry/client/projects_spec.rb b/spec/lib/sentry/client/projects_spec.rb index 1b5bbb8f81a..ea2c5ccb81e 100644 --- a/spec/lib/sentry/client/projects_spec.rb +++ b/spec/lib/sentry/client/projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::Client::Projects do +RSpec.describe Sentry::Client::Projects do include SentryClientHelpers let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project' } diff --git a/spec/lib/sentry/client/repo_spec.rb b/spec/lib/sentry/client/repo_spec.rb index 524dca8dcf6..956c0b6eee1 100644 --- a/spec/lib/sentry/client/repo_spec.rb +++ b/spec/lib/sentry/client/repo_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::Client::Repo do +RSpec.describe Sentry::Client::Repo do include SentryClientHelpers let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project' } diff --git a/spec/lib/sentry/client_spec.rb b/spec/lib/sentry/client_spec.rb index e2da4564ca1..cddcb6e98fa 100644 --- a/spec/lib/sentry/client_spec.rb +++ b/spec/lib/sentry/client_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sentry::Client do +RSpec.describe Sentry::Client do let(:sentry_url) { 'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project' } let(:token) { 'test-token' } diff --git a/spec/lib/sentry/pagination_parser_spec.rb b/spec/lib/sentry/pagination_parser_spec.rb index 1be6f9f4163..1984c7fc676 100644 --- a/spec/lib/sentry/pagination_parser_spec.rb +++ b/spec/lib/sentry/pagination_parser_spec.rb @@ -3,7 +3,7 @@ require 'fast_spec_helper' require 'support/helpers/fixture_helpers' -describe Sentry::PaginationParser do +RSpec.describe Sentry::PaginationParser do include FixtureHelpers describe '.parse' do diff --git a/spec/lib/serializers/json_spec.rb b/spec/lib/serializers/json_spec.rb index dfe85d3f362..7054f98a719 100644 --- a/spec/lib/serializers/json_spec.rb +++ b/spec/lib/serializers/json_spec.rb @@ -2,7 +2,7 @@ require 'fast_spec_helper' -describe Serializers::JSON do +RSpec.describe Serializers::JSON do describe '.dump' do let(:obj) { { key: "value" } } diff --git a/spec/lib/system_check/app/authorized_keys_permission_check_spec.rb b/spec/lib/system_check/app/authorized_keys_permission_check_spec.rb index 1a8123c3f0a..a5a3105c125 100644 --- a/spec/lib/system_check/app/authorized_keys_permission_check_spec.rb +++ b/spec/lib/system_check/app/authorized_keys_permission_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SystemCheck::App::AuthorizedKeysPermissionCheck do +RSpec.describe SystemCheck::App::AuthorizedKeysPermissionCheck do subject(:system_check) { described_class.new } describe '#skip?' do diff --git a/spec/lib/system_check/app/git_user_default_ssh_config_check_spec.rb b/spec/lib/system_check/app/git_user_default_ssh_config_check_spec.rb index f132f608ab6..2c996635c36 100644 --- a/spec/lib/system_check/app/git_user_default_ssh_config_check_spec.rb +++ b/spec/lib/system_check/app/git_user_default_ssh_config_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SystemCheck::App::GitUserDefaultSSHConfigCheck do +RSpec.describe SystemCheck::App::GitUserDefaultSSHConfigCheck do let(:username) { '_this_user_will_not_exist_unless_it_is_stubbed' } let(:base_dir) { Dir.mktmpdir } let(:home_dir) { File.join(base_dir, "/var/lib/#{username}") } diff --git a/spec/lib/system_check/app/hashed_storage_all_projects_check_spec.rb b/spec/lib/system_check/app/hashed_storage_all_projects_check_spec.rb index e5e7f6a4450..14bf9d61ab5 100644 --- a/spec/lib/system_check/app/hashed_storage_all_projects_check_spec.rb +++ b/spec/lib/system_check/app/hashed_storage_all_projects_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rake_helper' -describe SystemCheck::App::HashedStorageAllProjectsCheck do +RSpec.describe SystemCheck::App::HashedStorageAllProjectsCheck do before do silence_output end diff --git a/spec/lib/system_check/app/hashed_storage_enabled_check_spec.rb b/spec/lib/system_check/app/hashed_storage_enabled_check_spec.rb index d5a0014b791..32a2f409858 100644 --- a/spec/lib/system_check/app/hashed_storage_enabled_check_spec.rb +++ b/spec/lib/system_check/app/hashed_storage_enabled_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rake_helper' -describe SystemCheck::App::HashedStorageEnabledCheck do +RSpec.describe SystemCheck::App::HashedStorageEnabledCheck do before do silence_output end diff --git a/spec/lib/system_check/base_check_spec.rb b/spec/lib/system_check/base_check_spec.rb index ccb7b483bdc..59b2fc519ae 100644 --- a/spec/lib/system_check/base_check_spec.rb +++ b/spec/lib/system_check/base_check_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SystemCheck::BaseCheck do +RSpec.describe SystemCheck::BaseCheck do context 'helpers on instance level' do it 'responds to SystemCheck::Helpers methods' do expect(subject).to respond_to :fix_and_rerun, :for_more_information, :see_installation_guide_section, diff --git a/spec/lib/system_check/orphans/namespace_check_spec.rb b/spec/lib/system_check/orphans/namespace_check_spec.rb index f7491e40438..795dfde9029 100644 --- a/spec/lib/system_check/orphans/namespace_check_spec.rb +++ b/spec/lib/system_check/orphans/namespace_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rake_helper' -describe SystemCheck::Orphans::NamespaceCheck do +RSpec.describe SystemCheck::Orphans::NamespaceCheck do let(:storages) { Gitlab.config.repositories.storages.reject { |key, _| key.eql? 'broken' } } before do diff --git a/spec/lib/system_check/orphans/repository_check_spec.rb b/spec/lib/system_check/orphans/repository_check_spec.rb index a5e06f30e75..2ab30f4802d 100644 --- a/spec/lib/system_check/orphans/repository_check_spec.rb +++ b/spec/lib/system_check/orphans/repository_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rake_helper' -describe SystemCheck::Orphans::RepositoryCheck do +RSpec.describe SystemCheck::Orphans::RepositoryCheck do let(:storages) { Gitlab.config.repositories.storages.reject { |key, _| key.eql? 'broken' } } before do diff --git a/spec/lib/system_check/simple_executor_spec.rb b/spec/lib/system_check/simple_executor_spec.rb index 58f3a7df197..c9a09d86e32 100644 --- a/spec/lib/system_check/simple_executor_spec.rb +++ b/spec/lib/system_check/simple_executor_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rake_helper' -describe SystemCheck::SimpleExecutor do +RSpec.describe SystemCheck::SimpleExecutor do before do stub_const('SimpleCheck', Class.new(SystemCheck::BaseCheck)) stub_const('OtherCheck', Class.new(SystemCheck::BaseCheck)) diff --git a/spec/lib/system_check_spec.rb b/spec/lib/system_check_spec.rb index da1916455ba..5ddb2741c4a 100644 --- a/spec/lib/system_check_spec.rb +++ b/spec/lib/system_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'rake_helper' -describe SystemCheck do +RSpec.describe SystemCheck do before do stub_const('SimpleCheck', Class.new(SystemCheck::BaseCheck)) stub_const('OtherCheck', Class.new(SystemCheck::BaseCheck)) diff --git a/spec/lib/uploaded_file_spec.rb b/spec/lib/uploaded_file_spec.rb index 39055a2479f..5ff46193b4f 100644 --- a/spec/lib/uploaded_file_spec.rb +++ b/spec/lib/uploaded_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe UploadedFile do +RSpec.describe UploadedFile do let(:temp_dir) { Dir.tmpdir } let(:temp_file) { Tempfile.new(%w[test test], temp_dir) } diff --git a/spec/mailers/abuse_report_mailer_spec.rb b/spec/mailers/abuse_report_mailer_spec.rb index fcbffb52849..4eb616722ac 100644 --- a/spec/mailers/abuse_report_mailer_spec.rb +++ b/spec/mailers/abuse_report_mailer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AbuseReportMailer do +RSpec.describe AbuseReportMailer do include EmailSpec::Matchers describe '.notify' do diff --git a/spec/mailers/email_rejection_mailer_spec.rb b/spec/mailers/email_rejection_mailer_spec.rb index 2ce2e3e1410..d28f034105a 100644 --- a/spec/mailers/email_rejection_mailer_spec.rb +++ b/spec/mailers/email_rejection_mailer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EmailRejectionMailer do +RSpec.describe EmailRejectionMailer do include EmailSpec::Matchers describe '#rejection' do diff --git a/spec/mailers/emails/auto_devops_spec.rb b/spec/mailers/emails/auto_devops_spec.rb index dd7c12c3143..950fcfbf4df 100644 --- a/spec/mailers/emails/auto_devops_spec.rb +++ b/spec/mailers/emails/auto_devops_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Emails::AutoDevops do +RSpec.describe Emails::AutoDevops do include EmailSpec::Matchers describe '#auto_devops_disabled_email' do diff --git a/spec/mailers/emails/groups_spec.rb b/spec/mailers/emails/groups_spec.rb index b4746e120e0..01846172440 100644 --- a/spec/mailers/emails/groups_spec.rb +++ b/spec/mailers/emails/groups_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::Groups do +RSpec.describe Emails::Groups do include EmailSpec::Matchers let(:group) { create(:group) } diff --git a/spec/mailers/emails/issues_spec.rb b/spec/mailers/emails/issues_spec.rb index dfd974aa5f3..21e07c0252d 100644 --- a/spec/mailers/emails/issues_spec.rb +++ b/spec/mailers/emails/issues_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::Issues do +RSpec.describe Emails::Issues do include EmailSpec::Matchers it 'adds email methods to Notify' do diff --git a/spec/mailers/emails/merge_requests_spec.rb b/spec/mailers/emails/merge_requests_spec.rb index 541acc47172..fb523092f7a 100644 --- a/spec/mailers/emails/merge_requests_spec.rb +++ b/spec/mailers/emails/merge_requests_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::MergeRequests do +RSpec.describe Emails::MergeRequests do include EmailSpec::Matchers describe "#resolved_all_discussions_email" do diff --git a/spec/mailers/emails/pages_domains_spec.rb b/spec/mailers/emails/pages_domains_spec.rb index 5029a17e4e5..cf17f2e5ebf 100644 --- a/spec/mailers/emails/pages_domains_spec.rb +++ b/spec/mailers/emails/pages_domains_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::PagesDomains do +RSpec.describe Emails::PagesDomains do include EmailSpec::Matchers include_context 'gitlab email notification' diff --git a/spec/mailers/emails/pipelines_spec.rb b/spec/mailers/emails/pipelines_spec.rb index cc901da98dc..f0f23fe2097 100644 --- a/spec/mailers/emails/pipelines_spec.rb +++ b/spec/mailers/emails/pipelines_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::Pipelines do +RSpec.describe Emails::Pipelines do include EmailSpec::Matchers let_it_be(:project) { create(:project, :repository) } diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb index cbf42da2085..ee91df360b6 100644 --- a/spec/mailers/emails/profile_spec.rb +++ b/spec/mailers/emails/profile_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::Profile do +RSpec.describe Emails::Profile do include EmailSpec::Matchers include_context 'gitlab email notification' diff --git a/spec/mailers/emails/projects_spec.rb b/spec/mailers/emails/projects_spec.rb index 6c94ed0aa4d..599f62a8113 100644 --- a/spec/mailers/emails/projects_spec.rb +++ b/spec/mailers/emails/projects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::Projects do +RSpec.describe Emails::Projects do include EmailSpec::Matchers include_context 'gitlab email notification' diff --git a/spec/mailers/emails/releases_spec.rb b/spec/mailers/emails/releases_spec.rb index c614c009434..60e522c7cfa 100644 --- a/spec/mailers/emails/releases_spec.rb +++ b/spec/mailers/emails/releases_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Emails::Releases do +RSpec.describe Emails::Releases do include EmailSpec::Matchers include_context 'gitlab email notification' diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb index 8b99cc41a53..9e613749bdf 100644 --- a/spec/mailers/notify_spec.rb +++ b/spec/mailers/notify_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require 'email_spec' -describe Notify do +RSpec.describe Notify do include EmailSpec::Helpers include EmailSpec::Matchers include EmailHelpers diff --git a/spec/mailers/repository_check_mailer_spec.rb b/spec/mailers/repository_check_mailer_spec.rb index 1fd4d28ca53..8b1bc33d8be 100644 --- a/spec/mailers/repository_check_mailer_spec.rb +++ b/spec/mailers/repository_check_mailer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RepositoryCheckMailer do +RSpec.describe RepositoryCheckMailer do include EmailSpec::Matchers describe '.notify' do diff --git a/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb b/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb index dfa4cc21d63..750d3d1fa30 100644 --- a/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb +++ b/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190924152703_migrate_issue_trackers_data.rb') -describe MigrateIssueTrackersData do +RSpec.describe MigrateIssueTrackersData do let(:services) { table(:services) } let(:migration_class) { Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb b/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb index ac9ff5632eb..e2eacc00e5a 100644 --- a/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb +++ b/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb') -describe DropMergeRequestsRequireCodeOwnerApprovalFromProjects do +RSpec.describe DropMergeRequestsRequireCodeOwnerApprovalFromProjects do let(:projects_table) { table(:projects) } subject(:migration) { described_class.new } diff --git a/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb b/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb index 77d8dd002e3..51f798220c3 100644 --- a/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb +++ b/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191125114345_add_admin_mode_protected_path.rb') -describe AddAdminModeProtectedPath do +RSpec.describe AddAdminModeProtectedPath do subject(:migration) { described_class.new } let(:admin_mode_endpoint) { '/admin/session' } diff --git a/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb b/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb index 58061d80f21..07c69872497 100644 --- a/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb +++ b/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191204114127_delete_legacy_triggers.rb') -describe DeleteLegacyTriggers, schema: 2019_11_25_140458 do +RSpec.describe DeleteLegacyTriggers, schema: 2019_11_25_140458 do let(:ci_trigger_table) { table(:ci_triggers) } let(:user) { table(:users).create!(name: 'test', email: 'test@example.com', projects_limit: 1) } diff --git a/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb b/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb index 7a6b21d485b..1377d5e6ba0 100644 --- a/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb +++ b/spec/migrations/20200107172020_add_timestamp_softwarelicensespolicy_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200107172020_add_timestamp_softwarelicensespolicy.rb') -describe AddTimestampSoftwarelicensespolicy do +RSpec.describe AddTimestampSoftwarelicensespolicy do let(:software_licenses_policy) { table(:software_license_policies) } let(:projects) { table(:projects) } let(:licenses) { table(:software_licenses) } diff --git a/spec/migrations/20200122123016_backfill_project_settings_spec.rb b/spec/migrations/20200122123016_backfill_project_settings_spec.rb index ce86e94b6d5..0992ddde0c1 100644 --- a/spec/migrations/20200122123016_backfill_project_settings_spec.rb +++ b/spec/migrations/20200122123016_backfill_project_settings_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200122123016_backfill_project_settings.rb') -describe BackfillProjectSettings, :sidekiq, schema: 20200114113341 do +RSpec.describe BackfillProjectSettings, :sidekiq, schema: 20200114113341 do let(:projects) { table(:projects) } let(:namespace) { table(:namespaces).create(name: 'user', path: 'user') } let(:project) { projects.create(namespace_id: namespace.id) } diff --git a/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb b/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb index 253e39c1647..cae8e858af9 100644 --- a/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb +++ b/spec/migrations/20200123155929_remove_invalid_jira_data_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200123155929_remove_invalid_jira_data.rb') -describe RemoveInvalidJiraData do +RSpec.describe RemoveInvalidJiraData do let(:jira_tracker_data) { table(:jira_tracker_data) } let(:services) { table(:services) } diff --git a/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb b/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb index ca7cde08071..a86b5d83a0b 100644 --- a/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb +++ b/spec/migrations/20200127090233_remove_invalid_issue_tracker_data_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200127090233_remove_invalid_issue_tracker_data.rb') -describe RemoveInvalidIssueTrackerData do +RSpec.describe RemoveInvalidIssueTrackerData do let(:issue_tracker_data) { table(:issue_tracker_data) } let(:services) { table(:services) } diff --git a/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb b/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb index 8e3e55f3e19..146302ba650 100644 --- a/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb +++ b/spec/migrations/20200130145430_reschedule_migrate_issue_trackers_data_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200130145430_reschedule_migrate_issue_trackers_data.rb') -describe RescheduleMigrateIssueTrackersData do +RSpec.describe RescheduleMigrateIssueTrackersData do let(:services) { table(:services) } let(:migration_class) { Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb b/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb index fd30ebaa66f..d9ce62fe475 100644 --- a/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb +++ b/spec/migrations/20200313203550_remove_orphaned_chat_names_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200313203550_remove_orphaned_chat_names.rb') -describe RemoveOrphanedChatNames, schema: 20200313202430 do +RSpec.describe RemoveOrphanedChatNames, schema: 20200313202430 do let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } let(:services) { table(:services) } diff --git a/spec/migrations/20200406102120_backfill_deployment_clusters_from_deployments_spec.rb b/spec/migrations/20200406102120_backfill_deployment_clusters_from_deployments_spec.rb index fcb253677e1..47bc7428286 100644 --- a/spec/migrations/20200406102120_backfill_deployment_clusters_from_deployments_spec.rb +++ b/spec/migrations/20200406102120_backfill_deployment_clusters_from_deployments_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200406102120_backfill_deployment_clusters_from_deployments.rb') -describe BackfillDeploymentClustersFromDeployments, :migration, :sidekiq, schema: 20200227140242 do +RSpec.describe BackfillDeploymentClustersFromDeployments, :migration, :sidekiq, schema: 20200227140242 do describe '#up' do it 'schedules BackfillDeploymentClustersFromDeployments background jobs' do stub_const("#{described_class}::BATCH_SIZE", 2) diff --git a/spec/migrations/20200511145545_change_variable_interpolation_format_in_common_metrics_spec.rb b/spec/migrations/20200511145545_change_variable_interpolation_format_in_common_metrics_spec.rb index f9e8a7ee6e9..73f38c17729 100644 --- a/spec/migrations/20200511145545_change_variable_interpolation_format_in_common_metrics_spec.rb +++ b/spec/migrations/20200511145545_change_variable_interpolation_format_in_common_metrics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200511145545_change_variable_interpolation_format_in_common_metrics') -describe ChangeVariableInterpolationFormatInCommonMetrics, :migration do +RSpec.describe ChangeVariableInterpolationFormatInCommonMetrics, :migration do let(:prometheus_metrics) { table(:prometheus_metrics) } let!(:common_metric) do diff --git a/spec/migrations/active_record/schema_spec.rb b/spec/migrations/active_record/schema_spec.rb index a3348424f47..d26e6437b32 100644 --- a/spec/migrations/active_record/schema_spec.rb +++ b/spec/migrations/active_record/schema_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' # Check consistency of db/structure.sql version, migrations' timestamps, and the latest migration timestamp # stored in the database's schema_migrations table. -describe ActiveRecord::Schema, schema: :latest do +RSpec.describe ActiveRecord::Schema, schema: :latest do let(:all_migrations) do migrations_paths = %w[db/migrate db/post_migrate] .map { |path| Rails.root.join(*path, '*') } diff --git a/spec/migrations/add_default_and_free_plans_spec.rb b/spec/migrations/add_default_and_free_plans_spec.rb index dffdeb8e71a..75787896999 100644 --- a/spec/migrations/add_default_and_free_plans_spec.rb +++ b/spec/migrations/add_default_and_free_plans_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191023152913_add_default_and_free_plans.rb') -describe AddDefaultAndFreePlans do +RSpec.describe AddDefaultAndFreePlans do describe 'migrate' do let(:plans) { table(:plans) } diff --git a/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb b/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb index 3bc3d3f8ee2..f1fe27e72a1 100644 --- a/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb +++ b/spec/migrations/add_deploy_token_type_to_deploy_tokens_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200122161638_add_deploy_token_type_to_deploy_tokens.rb') -describe AddDeployTokenTypeToDeployTokens do +RSpec.describe AddDeployTokenTypeToDeployTokens do let(:deploy_tokens) { table(:deploy_tokens) } let(:deploy_token) do deploy_tokens.create(name: 'token_test', diff --git a/spec/migrations/add_incident_settings_to_all_existing_projects_spec.rb b/spec/migrations/add_incident_settings_to_all_existing_projects_spec.rb index 507b1a8d580..1745d348a78 100644 --- a/spec/migrations/add_incident_settings_to_all_existing_projects_spec.rb +++ b/spec/migrations/add_incident_settings_to_all_existing_projects_spec.rb @@ -67,7 +67,7 @@ describe AddIncidentSettingsToAllExistingProjects, :migration do context 'when project has incident labels' do before do issue = issues.create!(project_id: project.id) - incident_label_attrs = IncidentManagement::CreateIssueService::INCIDENT_LABEL + incident_label_attrs = IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES incident_label = labels.create!(project_id: project.id, **incident_label_attrs) label_links.create!(target_id: issue.id, label_id: incident_label.id, target_type: 'Issue') end diff --git a/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb b/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb index ce790b0266c..1be699f5636 100644 --- a/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb +++ b/spec/migrations/add_temporary_partial_index_on_project_id_to_services_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200114112932_add_temporary_partial_index_on_project_id_to_services.rb') -describe AddTemporaryPartialIndexOnProjectIdToServices do +RSpec.describe AddTemporaryPartialIndexOnProjectIdToServices do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb b/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb index 74830ab4ce2..6c04be5fc60 100644 --- a/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb +++ b/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190404143330_add_unique_constraint_to_approvals_user_id_and_merge_request_id.rb') -describe AddUniqueConstraintToApprovalsUserIdAndMergeRequestId do +RSpec.describe AddUniqueConstraintToApprovalsUserIdAndMergeRequestId do let(:migration) { described_class.new } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb b/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb index 8fceba276ce..9d0ad5863c6 100644 --- a/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb +++ b/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190628185004_backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table.rb') -describe BackfillAndAddNotNullConstraintToReleasedAtColumnOnReleasesTable do +RSpec.describe BackfillAndAddNotNullConstraintToReleasedAtColumnOnReleasesTable do let(:releases) { table(:releases) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_operations_feature_flags_active_spec.rb b/spec/migrations/backfill_operations_feature_flags_active_spec.rb index c51ed9fea8c..4ec2a4a2a92 100644 --- a/spec/migrations/backfill_operations_feature_flags_active_spec.rb +++ b/spec/migrations/backfill_operations_feature_flags_active_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191213184609_backfill_operations_feature_flags_active.rb') -describe BackfillOperationsFeatureFlagsActive do +RSpec.describe BackfillOperationsFeatureFlagsActive do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:flags) { table(:operations_feature_flags) } diff --git a/spec/migrations/backfill_operations_feature_flags_iid_spec.rb b/spec/migrations/backfill_operations_feature_flags_iid_spec.rb index 4628780787c..bafe5830652 100644 --- a/spec/migrations/backfill_operations_feature_flags_iid_spec.rb +++ b/spec/migrations/backfill_operations_feature_flags_iid_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200117194850_backfill_operations_feature_flags_iid.rb') -describe BackfillOperationsFeatureFlagsIid do +RSpec.describe BackfillOperationsFeatureFlagsIid do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:flags) { table(:operations_feature_flags) } diff --git a/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb b/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb index bf9a8154e1e..4c3517bc574 100644 --- a/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb +++ b/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190920194925_backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps.rb') -describe BackfillReleasesTableUpdatedAtAndAddNotNullConstraintsToTimestamps do +RSpec.describe BackfillReleasesTableUpdatedAtAndAddNotNullConstraintsToTimestamps do let(:releases) { table(:releases) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/backfill_snippet_repositories_spec.rb b/spec/migrations/backfill_snippet_repositories_spec.rb index e87bf7376dd..084faa16a37 100644 --- a/spec/migrations/backfill_snippet_repositories_spec.rb +++ b/spec/migrations/backfill_snippet_repositories_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200420094444_backfill_snippet_repositories.rb') -describe BackfillSnippetRepositories do +RSpec.describe BackfillSnippetRepositories do let(:users) { table(:users) } let(:snippets) { table(:snippets) } let(:user) { users.create(id: 1, email: 'user@example.com', projects_limit: 10, username: 'test', name: 'Test', state: 'active') } diff --git a/spec/migrations/backfill_status_page_published_incidents_spec.rb b/spec/migrations/backfill_status_page_published_incidents_spec.rb index ccdc8be4168..2b1ab891038 100644 --- a/spec/migrations/backfill_status_page_published_incidents_spec.rb +++ b/spec/migrations/backfill_status_page_published_incidents_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200421195234_backfill_status_page_published_incidents.rb') -describe BackfillStatusPagePublishedIncidents, :migration do +RSpec.describe BackfillStatusPagePublishedIncidents, :migration do subject(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/backport_enterprise_schema_spec.rb b/spec/migrations/backport_enterprise_schema_spec.rb index c167301e1e3..b76b53dc259 100644 --- a/spec/migrations/backport_enterprise_schema_spec.rb +++ b/spec/migrations/backport_enterprise_schema_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190402150158_backport_enterprise_schema.rb') -describe BackportEnterpriseSchema, schema: 20190329085614 do +RSpec.describe BackportEnterpriseSchema, schema: 20190329085614 do include MigrationsHelpers def drop_if_exists(table) diff --git a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb index dd45cac4a70..53b02425010 100644 --- a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb +++ b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190725012225_change_outbound_local_requests_whitelist_default.rb') -describe ChangeOutboundLocalRequestsWhitelistDefault do +RSpec.describe ChangeOutboundLocalRequestsWhitelistDefault do let(:application_settings) { table(:application_settings) } it 'defaults to empty array' do diff --git a/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb b/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb index c36506643de..8614bfea7cb 100644 --- a/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb +++ b/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190516155724_change_packages_size_defaults_in_project_statistics.rb') -describe ChangePackagesSizeDefaultsInProjectStatistics do +RSpec.describe ChangePackagesSizeDefaultsInProjectStatistics do let(:project_statistics) { table(:project_statistics) } let(:projects) { table(:projects) } diff --git a/spec/migrations/clean_grafana_url_spec.rb b/spec/migrations/clean_grafana_url_spec.rb index f6ea88a6f8d..caaf44b884d 100644 --- a/spec/migrations/clean_grafana_url_spec.rb +++ b/spec/migrations/clean_grafana_url_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200214085940_clean_grafana_url.rb') -describe CleanGrafanaUrl do +RSpec.describe CleanGrafanaUrl do let(:application_settings_table) { table(:application_settings) } [ diff --git a/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb b/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb index 602e1c1fe93..531c1dbb76a 100644 --- a/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb +++ b/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190313092516_clean_up_noteable_id_for_notes_on_commits.rb') -describe CleanUpNoteableIdForNotesOnCommits do +RSpec.describe CleanUpNoteableIdForNotesOnCommits do let(:notes) { table(:notes) } before do diff --git a/spec/migrations/cleanup_empty_commit_user_mentions_spec.rb b/spec/migrations/cleanup_empty_commit_user_mentions_spec.rb index 529fe046e32..da714e7da4c 100644 --- a/spec/migrations/cleanup_empty_commit_user_mentions_spec.rb +++ b/spec/migrations/cleanup_empty_commit_user_mentions_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200128133510_cleanup_empty_commit_user_mentions') -describe CleanupEmptyCommitUserMentions, :migration, :sidekiq do +RSpec.describe CleanupEmptyCommitUserMentions, :migration, :sidekiq do let(:users) { table(:users) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/cleanup_legacy_artifact_migration_spec.rb b/spec/migrations/cleanup_legacy_artifact_migration_spec.rb index 29a5c34373c..83b88a0cf1a 100644 --- a/spec/migrations/cleanup_legacy_artifact_migration_spec.rb +++ b/spec/migrations/cleanup_legacy_artifact_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190104182041_cleanup_legacy_artifact_migration.rb') -describe CleanupLegacyArtifactMigration, :redis do +RSpec.describe CleanupLegacyArtifactMigration, :redis do let(:migration) { spy('migration') } context 'when still legacy artifacts exist' do diff --git a/spec/migrations/cleanup_optimistic_locking_nulls_pt2_fixed_spec.rb b/spec/migrations/cleanup_optimistic_locking_nulls_pt2_fixed_spec.rb index 2e5e450afc7..f6a549f2eb3 100644 --- a/spec/migrations/cleanup_optimistic_locking_nulls_pt2_fixed_spec.rb +++ b/spec/migrations/cleanup_optimistic_locking_nulls_pt2_fixed_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200427064130_cleanup_optimistic_locking_nulls_pt2_fixed.rb') -describe CleanupOptimisticLockingNullsPt2Fixed, :migration do +RSpec.describe CleanupOptimisticLockingNullsPt2Fixed, :migration do test_tables = %w(ci_stages ci_builds ci_pipelines).freeze test_tables.each do |table| let(table.to_sym) { table(table.to_sym) } diff --git a/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb b/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb index 6e541c903ff..bcdcd3e9273 100644 --- a/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb +++ b/spec/migrations/cleanup_optimistic_locking_nulls_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200128210353_cleanup_optimistic_locking_nulls') -describe CleanupOptimisticLockingNulls do +RSpec.describe CleanupOptimisticLockingNulls do let(:epics) { table(:epics) } let(:merge_requests) { table(:merge_requests) } let(:issues) { table(:issues) } diff --git a/spec/migrations/cleanup_projects_with_missing_namespace_spec.rb b/spec/migrations/cleanup_projects_with_missing_namespace_spec.rb index 27c954d2984..cef6e0f470f 100644 --- a/spec/migrations/cleanup_projects_with_missing_namespace_spec.rb +++ b/spec/migrations/cleanup_projects_with_missing_namespace_spec.rb @@ -47,7 +47,7 @@ class SchemaVersionFinder end end -describe CleanupProjectsWithMissingNamespace, :migration, schema: SchemaVersionFinder.previous_migration do +RSpec.describe CleanupProjectsWithMissingNamespace, :migration, schema: SchemaVersionFinder.previous_migration do let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } let(:users) { table(:users) } diff --git a/spec/migrations/create_environment_for_self_monitoring_project_spec.rb b/spec/migrations/create_environment_for_self_monitoring_project_spec.rb index aee0651dee0..1ba464f1610 100644 --- a/spec/migrations/create_environment_for_self_monitoring_project_spec.rb +++ b/spec/migrations/create_environment_for_self_monitoring_project_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200214214934_create_environment_for_self_monitoring_project') -describe CreateEnvironmentForSelfMonitoringProject do +RSpec.describe CreateEnvironmentForSelfMonitoringProject do let(:application_settings_table) { table(:application_settings) } let(:environments) { table(:environments) } diff --git a/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb b/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb index 6eecd0870ed..a58121fb708 100644 --- a/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb +++ b/spec/migrations/delete_internal_ids_where_feature_flags_usage_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200117194900_delete_internal_ids_where_feature_flags_usage') -describe DeleteInternalIdsWhereFeatureFlagsUsage do +RSpec.describe DeleteInternalIdsWhereFeatureFlagsUsage do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:internal_ids) { table(:internal_ids) } diff --git a/spec/migrations/delete_template_project_services_spec.rb b/spec/migrations/delete_template_project_services_spec.rb index 3c6709ec310..aacc4fcfd58 100644 --- a/spec/migrations/delete_template_project_services_spec.rb +++ b/spec/migrations/delete_template_project_services_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200305151736_delete_template_project_services.rb') -describe DeleteTemplateProjectServices, :migration do +RSpec.describe DeleteTemplateProjectServices, :migration do let(:services) { table(:services) } let(:project) { table(:projects).create!(namespace_id: 1) } diff --git a/spec/migrations/delete_template_services_duplicated_by_type_spec.rb b/spec/migrations/delete_template_services_duplicated_by_type_spec.rb index 64da0664e2c..5bcbfb7c733 100644 --- a/spec/migrations/delete_template_services_duplicated_by_type_spec.rb +++ b/spec/migrations/delete_template_services_duplicated_by_type_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200304160801_delete_template_services_duplicated_by_type.rb') -describe DeleteTemplateServicesDuplicatedByType do +RSpec.describe DeleteTemplateServicesDuplicatedByType do let(:services) { table(:services) } before do diff --git a/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb b/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb index a02a0819a7b..b4bbadd199e 100644 --- a/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb +++ b/spec/migrations/drop_activate_prometheus_services_background_jobs_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200221144534_drop_activate_prometheus_services_background_jobs.rb') -describe DropActivatePrometheusServicesBackgroundJobs, :sidekiq, :redis, schema: 2020_02_21_144534 do +RSpec.describe DropActivatePrometheusServicesBackgroundJobs, :sidekiq, :redis, schema: 2020_02_21_144534 do subject(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/drop_background_migration_jobs_spec.rb b/spec/migrations/drop_background_migration_jobs_spec.rb index d9e0561f326..2896f4ca0eb 100644 --- a/spec/migrations/drop_background_migration_jobs_spec.rb +++ b/spec/migrations/drop_background_migration_jobs_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200116051619_drop_background_migration_jobs.rb') -describe DropBackgroundMigrationJobs, :sidekiq, :redis, schema: 2020_01_16_051619 do +RSpec.describe DropBackgroundMigrationJobs, :sidekiq, :redis, schema: 2020_01_16_051619 do subject(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb b/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb index 9166f626922..3f6aae401be 100644 --- a/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb +++ b/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191128162854_drop_project_ci_cd_settings_merge_trains_enabled.rb') -describe DropProjectCiCdSettingsMergeTrainsEnabled do +RSpec.describe DropProjectCiCdSettingsMergeTrainsEnabled do let!(:project_ci_cd_setting) { table(:project_ci_cd_settings) } it 'correctly migrates up and down' do diff --git a/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb b/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb index 9b139c4b57b..ad83119f324 100644 --- a/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb +++ b/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190606175050_encrypt_feature_flags_clients_tokens.rb') -describe EncryptFeatureFlagsClientsTokens do +RSpec.describe EncryptFeatureFlagsClientsTokens do let(:migration) { described_class.new } let(:feature_flags_clients) { table(:operations_feature_flags_clients) } let(:projects) { table(:projects) } diff --git a/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb b/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb index fda810d1da9..ff5aa81b5b5 100644 --- a/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb +++ b/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191120115530_encrypt_plaintext_attributes_on_application_settings.rb') -describe EncryptPlaintextAttributesOnApplicationSettings do +RSpec.describe EncryptPlaintextAttributesOnApplicationSettings do let(:migration) { described_class.new } let(:application_settings) { table(:application_settings) } let(:plaintext) { 'secret-token' } diff --git a/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb b/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb index d4cf3d15758..f5728534675 100644 --- a/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb +++ b/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190620112608_enqueue_reset_merge_status_second_run.rb') -describe EnqueueResetMergeStatusSecondRun do +RSpec.describe EnqueueResetMergeStatusSecondRun do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } diff --git a/spec/migrations/enqueue_reset_merge_status_spec.rb b/spec/migrations/enqueue_reset_merge_status_spec.rb index 9728ada14ba..683d2caf9ca 100644 --- a/spec/migrations/enqueue_reset_merge_status_spec.rb +++ b/spec/migrations/enqueue_reset_merge_status_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190528180441_enqueue_reset_merge_status.rb') -describe EnqueueResetMergeStatus do +RSpec.describe EnqueueResetMergeStatus do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } diff --git a/spec/migrations/fill_file_store_ci_job_artifacts_spec.rb b/spec/migrations/fill_file_store_ci_job_artifacts_spec.rb index 5435a438824..64ab879d53c 100644 --- a/spec/migrations/fill_file_store_ci_job_artifacts_spec.rb +++ b/spec/migrations/fill_file_store_ci_job_artifacts_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200513235532_fill_file_store_ci_job_artifacts.rb') -describe FillFileStoreCiJobArtifacts do +RSpec.describe FillFileStoreCiJobArtifacts do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:builds) { table(:ci_builds) } diff --git a/spec/migrations/fill_file_store_lfs_objects_spec.rb b/spec/migrations/fill_file_store_lfs_objects_spec.rb index e574eacca35..2a610e5311b 100644 --- a/spec/migrations/fill_file_store_lfs_objects_spec.rb +++ b/spec/migrations/fill_file_store_lfs_objects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200513234502_fill_file_store_lfs_objects.rb') -describe FillFileStoreLfsObjects do +RSpec.describe FillFileStoreLfsObjects do let(:lfs_objects) { table(:lfs_objects) } let(:oid) { 'b804383982bb89b00e828e3f44c038cc991d3d1768009fc39ba8e2c081b9fb75' } diff --git a/spec/migrations/fill_productivity_analytics_start_date_spec.rb b/spec/migrations/fill_productivity_analytics_start_date_spec.rb index 4ae7b0eed24..5d7f0ffba50 100644 --- a/spec/migrations/fill_productivity_analytics_start_date_spec.rb +++ b/spec/migrations/fill_productivity_analytics_start_date_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191004081520_fill_productivity_analytics_start_date.rb') -describe FillProductivityAnalyticsStartDate do +RSpec.describe FillProductivityAnalyticsStartDate do let(:settings_table) { table('application_settings') } let(:metrics_table) { table('merge_request_metrics') } diff --git a/spec/migrations/fill_store_uploads_spec.rb b/spec/migrations/fill_store_uploads_spec.rb index 6a2a3c4ea8e..60eaf982c57 100644 --- a/spec/migrations/fill_store_uploads_spec.rb +++ b/spec/migrations/fill_store_uploads_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200513235347_fill_store_uploads.rb') -describe FillStoreUploads do +RSpec.describe FillStoreUploads do let(:uploads) { table(:uploads) } let(:path) { 'uploads/-/system/avatar.jpg' } diff --git a/spec/migrations/fix_max_pages_size_spec.rb b/spec/migrations/fix_max_pages_size_spec.rb index 9882cda7fba..b44ce21b858 100644 --- a/spec/migrations/fix_max_pages_size_spec.rb +++ b/spec/migrations/fix_max_pages_size_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191213120427_fix_max_pages_size.rb') -describe FixMaxPagesSize do +RSpec.describe FixMaxPagesSize do let(:application_settings) { table(:application_settings) } let!(:default_setting) { application_settings.create! } let!(:max_possible_setting) { application_settings.create!(max_pages_size: described_class::MAX_SIZE) } diff --git a/spec/migrations/fix_null_type_labels_spec.rb b/spec/migrations/fix_null_type_labels_spec.rb index b098141c5e9..fadc2a5d29e 100644 --- a/spec/migrations/fix_null_type_labels_spec.rb +++ b/spec/migrations/fix_null_type_labels_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190131122559_fix_null_type_labels') -describe FixNullTypeLabels do +RSpec.describe FixNullTypeLabels do let(:migration) { described_class.new } let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/fix_pool_repository_source_project_id_spec.rb b/spec/migrations/fix_pool_repository_source_project_id_spec.rb index 5a878dba6e7..67a75b893ef 100644 --- a/spec/migrations/fix_pool_repository_source_project_id_spec.rb +++ b/spec/migrations/fix_pool_repository_source_project_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190604184643_fix_pool_repository_source_project_id.rb') -describe FixPoolRepositorySourceProjectId do +RSpec.describe FixPoolRepositorySourceProjectId do let(:projects) { table(:projects) } let(:pool_repositories) { table(:pool_repositories) } let(:shards) { table(:shards) } diff --git a/spec/migrations/fix_projects_without_project_feature_spec.rb b/spec/migrations/fix_projects_without_project_feature_spec.rb index 01413261008..2a4ba3f3ca5 100644 --- a/spec/migrations/fix_projects_without_project_feature_spec.rb +++ b/spec/migrations/fix_projects_without_project_feature_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200127111840_fix_projects_without_project_feature.rb') -describe FixProjectsWithoutProjectFeature do +RSpec.describe FixProjectsWithoutProjectFeature do let(:namespace) { table(:namespaces).create(name: 'gitlab', path: 'gitlab-org') } let!(:projects) do diff --git a/spec/migrations/fix_projects_without_prometheus_services_spec.rb b/spec/migrations/fix_projects_without_prometheus_services_spec.rb index ecfad313f58..73ede2ad90c 100644 --- a/spec/migrations/fix_projects_without_prometheus_services_spec.rb +++ b/spec/migrations/fix_projects_without_prometheus_services_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200220115023_fix_projects_without_prometheus_service.rb') -describe FixProjectsWithoutPrometheusService, :migration do +RSpec.describe FixProjectsWithoutPrometheusService, :migration do let(:namespace) { table(:namespaces).create(name: 'gitlab', path: 'gitlab-org') } let!(:projects) do diff --git a/spec/migrations/fix_wrong_pages_access_level_spec.rb b/spec/migrations/fix_wrong_pages_access_level_spec.rb index e0d09add740..9ee5fa783a4 100644 --- a/spec/migrations/fix_wrong_pages_access_level_spec.rb +++ b/spec/migrations/fix_wrong_pages_access_level_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190703185326_fix_wrong_pages_access_level.rb') -describe FixWrongPagesAccessLevel, :sidekiq_might_not_need_inline, schema: 20190628185004 do +RSpec.describe FixWrongPagesAccessLevel, :sidekiq_might_not_need_inline, schema: 20190628185004 do using RSpec::Parameterized::TableSyntax let(:migration_class) { described_class::MIGRATION } diff --git a/spec/migrations/generate_lets_encrypt_private_key_spec.rb b/spec/migrations/generate_lets_encrypt_private_key_spec.rb index c0cb39fd519..cad257c18a0 100644 --- a/spec/migrations/generate_lets_encrypt_private_key_spec.rb +++ b/spec/migrations/generate_lets_encrypt_private_key_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190524062810_generate_lets_encrypt_private_key.rb') -describe GenerateLetsEncryptPrivateKey do +RSpec.describe GenerateLetsEncryptPrivateKey do describe '#up' do it 'does not fail' do expect do diff --git a/spec/migrations/insert_project_hooks_plan_limits_spec.rb b/spec/migrations/insert_project_hooks_plan_limits_spec.rb index e4bdda4cf5e..09fae160a6f 100644 --- a/spec/migrations/insert_project_hooks_plan_limits_spec.rb +++ b/spec/migrations/insert_project_hooks_plan_limits_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191216183532_insert_project_hooks_plan_limits.rb') -describe InsertProjectHooksPlanLimits do +RSpec.describe InsertProjectHooksPlanLimits do let(:migration) { described_class.new } let(:plans) { table(:plans) } let(:plan_limits) { table(:plan_limits) } diff --git a/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb b/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb index 2fe6f3f62a9..d0abc777326 100644 --- a/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb +++ b/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190204115450_migrate_auto_dev_ops_domain_to_cluster_domain.rb') -describe MigrateAutoDevOpsDomainToClusterDomain do +RSpec.describe MigrateAutoDevOpsDomainToClusterDomain do include MigrationHelpers::ClusterHelpers let(:migration) { described_class.new } diff --git a/spec/migrations/migrate_bot_type_to_user_type_spec.rb b/spec/migrations/migrate_bot_type_to_user_type_spec.rb index 9686aae0cd3..2b85f2a7f69 100644 --- a/spec/migrations/migrate_bot_type_to_user_type_spec.rb +++ b/spec/migrations/migrate_bot_type_to_user_type_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200311074438_migrate_bot_type_to_user_type.rb') -describe MigrateBotTypeToUserType, :migration do +RSpec.describe MigrateBotTypeToUserType, :migration do let(:users) { table(:users) } it 'updates bots & ignores humans' do diff --git a/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb b/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb index cda965135b0..70304a4deb2 100644 --- a/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb +++ b/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb') -describe MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches do +RSpec.describe MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:protected_branches) { table(:protected_branches) } diff --git a/spec/migrations/migrate_commit_notes_mentions_to_db_spec.rb b/spec/migrations/migrate_commit_notes_mentions_to_db_spec.rb index dc40d0865f2..eb7fb7d4fc5 100644 --- a/spec/migrations/migrate_commit_notes_mentions_to_db_spec.rb +++ b/spec/migrations/migrate_commit_notes_mentions_to_db_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200128134110_migrate_commit_notes_mentions_to_db') -describe MigrateCommitNotesMentionsToDb, :migration, :sidekiq do +RSpec.describe MigrateCommitNotesMentionsToDb, :migration, :sidekiq do let(:users) { table(:users) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/migrate_create_commit_signature_worker_sidekiq_queue_spec.rb b/spec/migrations/migrate_create_commit_signature_worker_sidekiq_queue_spec.rb index 3d7803b7563..5f7b4755980 100644 --- a/spec/migrations/migrate_create_commit_signature_worker_sidekiq_queue_spec.rb +++ b/spec/migrations/migrate_create_commit_signature_worker_sidekiq_queue_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200206091544_migrate_create_commit_signature_worker_sidekiq_queue.rb') -describe MigrateCreateCommitSignatureWorkerSidekiqQueue, :sidekiq, :redis do +RSpec.describe MigrateCreateCommitSignatureWorkerSidekiqQueue, :sidekiq, :redis do include Gitlab::Database::MigrationHelpers include StubWorker diff --git a/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb b/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb index 0a8975402da..e3119be495d 100644 --- a/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb +++ b/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190715193142_migrate_discussion_id_on_promoted_epics.rb') -describe MigrateDiscussionIdOnPromotedEpics do +RSpec.describe MigrateDiscussionIdOnPromotedEpics do let(:migration_class) { described_class::MIGRATION } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/migrate_k8s_service_integration_spec.rb b/spec/migrations/migrate_k8s_service_integration_spec.rb index 660e958eb42..a1b2f2ae841 100644 --- a/spec/migrations/migrate_k8s_service_integration_spec.rb +++ b/spec/migrations/migrate_k8s_service_integration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190517153211_migrate_k8s_service_integration.rb') -describe MigrateK8sServiceIntegration do +RSpec.describe MigrateK8sServiceIntegration do context 'template service' do context 'with namespace' do let!(:service) do diff --git a/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb b/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb index e3462e1d6bd..c8bfeec8049 100644 --- a/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb +++ b/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190606163724_migrate_legacy_managed_clusters_to_unmanaged.rb') -describe MigrateLegacyManagedClustersToUnmanaged do +RSpec.describe MigrateLegacyManagedClustersToUnmanaged do let(:cluster_type) { 'project_type' } let(:created_at) { 1.hour.ago } diff --git a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb b/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb index 2931fba3eb2..1fc92f6ceea 100644 --- a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb +++ b/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190613231640_migrate_managed_clusters_with_no_token_to_unmanaged.rb') -describe MigrateManagedClustersWithNoTokenToUnmanaged do +RSpec.describe MigrateManagedClustersWithNoTokenToUnmanaged do let(:cluster_type) { 'project_type' } let(:created_at) { Date.new(2018, 11, 1).midnight } diff --git a/spec/migrations/migrate_merge_request_mentions_to_db_spec.rb b/spec/migrations/migrate_merge_request_mentions_to_db_spec.rb index aef8fd6490b..83388cc6314 100644 --- a/spec/migrations/migrate_merge_request_mentions_to_db_spec.rb +++ b/spec/migrations/migrate_merge_request_mentions_to_db_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200211155539_migrate_merge_request_mentions_to_db') -describe MigrateMergeRequestMentionsToDb, :migration do +RSpec.describe MigrateMergeRequestMentionsToDb, :migration do let(:users) { table(:users) } let(:projects) { table(:projects) } let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb b/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb index fc5d814a2de..b2c36db2e1d 100644 --- a/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb +++ b/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191118211629_migrate_ops_feature_flags_scopes_target_user_ids.rb') -describe MigrateOpsFeatureFlagsScopesTargetUserIds do +RSpec.describe MigrateOpsFeatureFlagsScopesTargetUserIds do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:flags) { table(:operations_feature_flags) } diff --git a/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb b/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb index 557eb52632f..1181c169f57 100644 --- a/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb +++ b/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190124200344_migrate_storage_migrator_sidekiq_queue.rb') -describe MigrateStorageMigratorSidekiqQueue, :redis do +RSpec.describe MigrateStorageMigratorSidekiqQueue, :redis do include Gitlab::Database::MigrationHelpers include StubWorker diff --git a/spec/migrations/migrate_store_security_reports_sidekiq_queue_spec.rb b/spec/migrations/migrate_store_security_reports_sidekiq_queue_spec.rb index ddffa036af1..4face37bd66 100644 --- a/spec/migrations/migrate_store_security_reports_sidekiq_queue_spec.rb +++ b/spec/migrations/migrate_store_security_reports_sidekiq_queue_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200213220159_migrate_store_security_reports_sidekiq_queue.rb') -describe MigrateStoreSecurityReportsSidekiqQueue, :redis do +RSpec.describe MigrateStoreSecurityReportsSidekiqQueue, :redis do include Gitlab::Database::MigrationHelpers include StubWorker diff --git a/spec/migrations/migrate_sync_security_reports_to_report_approval_rules_sidekiq_queue_spec.rb b/spec/migrations/migrate_sync_security_reports_to_report_approval_rules_sidekiq_queue_spec.rb index 6dfaff06ddb..15c5761bd99 100644 --- a/spec/migrations/migrate_sync_security_reports_to_report_approval_rules_sidekiq_queue_spec.rb +++ b/spec/migrations/migrate_sync_security_reports_to_report_approval_rules_sidekiq_queue_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200213220211_migrate_sync_security_reports_to_report_approval_rules_sidekiq_queue.rb') -describe MigrateSyncSecurityReportsToReportApprovalRulesSidekiqQueue, :redis do +RSpec.describe MigrateSyncSecurityReportsToReportApprovalRulesSidekiqQueue, :redis do include Gitlab::Database::MigrationHelpers include StubWorker diff --git a/spec/migrations/move_limits_from_plans_spec.rb b/spec/migrations/move_limits_from_plans_spec.rb index aeb36100205..16f94ba6dbb 100644 --- a/spec/migrations/move_limits_from_plans_spec.rb +++ b/spec/migrations/move_limits_from_plans_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20191030152934_move_limits_from_plans.rb') -describe MoveLimitsFromPlans do +RSpec.describe MoveLimitsFromPlans do let(:plans) { table(:plans) } let(:plan_limits) { table(:plan_limits) } diff --git a/spec/migrations/nullify_users_role_spec.rb b/spec/migrations/nullify_users_role_spec.rb index b11929ef76f..3cdeb81f362 100644 --- a/spec/migrations/nullify_users_role_spec.rb +++ b/spec/migrations/nullify_users_role_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191104142124_nullify_users_role.rb') -describe NullifyUsersRole do +RSpec.describe NullifyUsersRole do let(:users) { table(:users) } before do diff --git a/spec/migrations/populate_project_statistics_packages_size_spec.rb b/spec/migrations/populate_project_statistics_packages_size_spec.rb index c316a4bc8b7..9024406c614 100644 --- a/spec/migrations/populate_project_statistics_packages_size_spec.rb +++ b/spec/migrations/populate_project_statistics_packages_size_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190418132125_populate_project_statistics_packages_size.rb') -describe PopulateProjectStatisticsPackagesSize do +RSpec.describe PopulateProjectStatisticsPackagesSize do let(:project_statistics) { table(:project_statistics) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb b/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb index d6362528068..2ac912d7979 100644 --- a/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb +++ b/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190520201748_populate_rule_type_on_approval_merge_request_rules.rb') -describe PopulateRuleTypeOnApprovalMergeRequestRules do +RSpec.describe PopulateRuleTypeOnApprovalMergeRequestRules do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/remove_additional_application_settings_rows_spec.rb b/spec/migrations/remove_additional_application_settings_rows_spec.rb index 379fa385b8e..a865e8e8dd7 100644 --- a/spec/migrations/remove_additional_application_settings_rows_spec.rb +++ b/spec/migrations/remove_additional_application_settings_rows_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200420162730_remove_additional_application_settings_rows.rb') -describe RemoveAdditionalApplicationSettingsRows do +RSpec.describe RemoveAdditionalApplicationSettingsRows do let(:application_settings) { table(:application_settings) } it 'removes additional rows from application settings' do diff --git a/spec/migrations/remove_deprecated_jenkins_service_records_spec.rb b/spec/migrations/remove_deprecated_jenkins_service_records_spec.rb index 9c9abd36203..00fde88c528 100644 --- a/spec/migrations/remove_deprecated_jenkins_service_records_spec.rb +++ b/spec/migrations/remove_deprecated_jenkins_service_records_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200511130129_remove_deprecated_jenkins_service_records.rb') require Rails.root.join('db', 'post_migrate', '20200511130130_ensure_deprecated_jenkins_service_records_removal.rb') -shared_examples 'remove DeprecatedJenkinsService records' do +RSpec.shared_examples 'remove DeprecatedJenkinsService records' do let(:services) { table(:services) } before do @@ -19,10 +19,10 @@ shared_examples 'remove DeprecatedJenkinsService records' do end end -describe RemoveDeprecatedJenkinsServiceRecords, :migration do +RSpec.describe RemoveDeprecatedJenkinsServiceRecords, :migration do it_behaves_like 'remove DeprecatedJenkinsService records' end -describe EnsureDeprecatedJenkinsServiceRecordsRemoval, :migration do +RSpec.describe EnsureDeprecatedJenkinsServiceRecordsRemoval, :migration do it_behaves_like 'remove DeprecatedJenkinsService records' end diff --git a/spec/migrations/remove_empty_github_service_templates_spec.rb b/spec/migrations/remove_empty_github_service_templates_spec.rb index 51b29ec6efc..7a77e342efd 100644 --- a/spec/migrations/remove_empty_github_service_templates_spec.rb +++ b/spec/migrations/remove_empty_github_service_templates_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191021101942_remove_empty_github_service_templates.rb') -describe RemoveEmptyGithubServiceTemplates do +RSpec.describe RemoveEmptyGithubServiceTemplates do subject(:migration) { described_class.new } let(:services) do diff --git a/spec/migrations/remove_orphaned_invited_members_spec.rb b/spec/migrations/remove_orphaned_invited_members_spec.rb index 0ed4c15428a..0474b5362be 100644 --- a/spec/migrations/remove_orphaned_invited_members_spec.rb +++ b/spec/migrations/remove_orphaned_invited_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200424050250_remove_orphaned_invited_members.rb') -describe RemoveOrphanedInvitedMembers do +RSpec.describe RemoveOrphanedInvitedMembers do let(:members_table) { table(:members) } let(:users_table) { table(:users) } let(:namespaces_table) { table(:namespaces) } diff --git a/spec/migrations/remove_packages_deprecated_dependencies_spec.rb b/spec/migrations/remove_packages_deprecated_dependencies_spec.rb index 2ba7a3b268b..84c23240af9 100644 --- a/spec/migrations/remove_packages_deprecated_dependencies_spec.rb +++ b/spec/migrations/remove_packages_deprecated_dependencies_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200210135504_remove_packages_deprecated_dependencies.rb') -describe RemovePackagesDeprecatedDependencies do +RSpec.describe RemovePackagesDeprecatedDependencies do let(:projects) { table(:projects) } let(:packages) { table(:packages_packages) } let(:dependency_links) { table(:packages_dependency_links) } diff --git a/spec/migrations/remove_security_dashboard_feature_flag_spec.rb b/spec/migrations/remove_security_dashboard_feature_flag_spec.rb index fa0489526e2..77363aebfe6 100644 --- a/spec/migrations/remove_security_dashboard_feature_flag_spec.rb +++ b/spec/migrations/remove_security_dashboard_feature_flag_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200214034836_remove_security_dashboard_feature_flag.rb') -describe RemoveSecurityDashboardFeatureFlag do +RSpec.describe RemoveSecurityDashboardFeatureFlag do let(:feature_gates) { table(:feature_gates) } subject(:migration) { described_class.new } diff --git a/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb b/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb index 07be7a4ad51..83a79ac9795 100644 --- a/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb +++ b/spec/migrations/rename_security_dashboard_feature_flag_to_instance_security_dashboard_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200212014653_rename_security_dashboard_feature_flag_to_instance_security_dashboard.rb') -describe RenameSecurityDashboardFeatureFlagToInstanceSecurityDashboard do +RSpec.describe RenameSecurityDashboardFeatureFlagToInstanceSecurityDashboard do let(:feature_gates) { table(:feature_gates) } subject(:migration) { described_class.new } diff --git a/spec/migrations/save_instance_administrators_group_id_spec.rb b/spec/migrations/save_instance_administrators_group_id_spec.rb index 74ced009fa5..cb11cd1653a 100644 --- a/spec/migrations/save_instance_administrators_group_id_spec.rb +++ b/spec/migrations/save_instance_administrators_group_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200210092405_save_instance_administrators_group_id') -describe SaveInstanceAdministratorsGroupId do +RSpec.describe SaveInstanceAdministratorsGroupId do let(:application_settings_table) { table(:application_settings) } let(:instance_administrators_group) do diff --git a/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb b/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb index 77721eab77d..37a769bbc52 100644 --- a/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb +++ b/spec/migrations/schedule_backfill_push_rules_id_in_projects_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200325162730_schedule_backfill_push_rules_id_in_projects.rb') -describe ScheduleBackfillPushRulesIdInProjects do +RSpec.describe ScheduleBackfillPushRulesIdInProjects do let(:push_rules) { table(:push_rules) } it 'adds global rule association to application settings' do diff --git a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb b/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb index 30cb68c742c..a51bc374d5f 100644 --- a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb +++ b/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb') -describe ScheduleFillValidTimeForPagesDomainCertificates do +RSpec.describe ScheduleFillValidTimeForPagesDomainCertificates do let(:migration_class) { described_class::MIGRATION } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/schedule_link_lfs_objects_projects_spec.rb b/spec/migrations/schedule_link_lfs_objects_projects_spec.rb index 055ab3cdd83..04ca18de91f 100644 --- a/spec/migrations/schedule_link_lfs_objects_projects_spec.rb +++ b/spec/migrations/schedule_link_lfs_objects_projects_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200310075115_schedule_link_lfs_objects_projects.rb') -describe ScheduleLinkLfsObjectsProjects, :migration, :sidekiq do +RSpec.describe ScheduleLinkLfsObjectsProjects, :migration, :sidekiq do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:fork_networks) { table(:fork_networks) } diff --git a/spec/migrations/schedule_merge_request_assignees_migration_progress_check_spec.rb b/spec/migrations/schedule_merge_request_assignees_migration_progress_check_spec.rb index bea985fabb1..0a69f49f10d 100644 --- a/spec/migrations/schedule_merge_request_assignees_migration_progress_check_spec.rb +++ b/spec/migrations/schedule_merge_request_assignees_migration_progress_check_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190402224749_schedule_merge_request_assignees_migration_progress_check.rb') -describe ScheduleMergeRequestAssigneesMigrationProgressCheck do +RSpec.describe ScheduleMergeRequestAssigneesMigrationProgressCheck do describe '#up' do it 'schedules MergeRequestAssigneesMigrationProgressCheck background job' do expect(BackgroundMigrationWorker).to receive(:perform_async) diff --git a/spec/migrations/schedule_migrate_security_scans_spec.rb b/spec/migrations/schedule_migrate_security_scans_spec.rb index 29e4e2b5cac..4fd17b20666 100644 --- a/spec/migrations/schedule_migrate_security_scans_spec.rb +++ b/spec/migrations/schedule_migrate_security_scans_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200217225719_schedule_migrate_security_scans.rb') # rubocop: disable RSpec/FactoriesInMigrationSpecs -describe ScheduleMigrateSecurityScans, :sidekiq do +RSpec.describe ScheduleMigrateSecurityScans, :sidekiq do let(:migration) { described_class.new } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/schedule_pages_metadata_migration_spec.rb b/spec/migrations/schedule_pages_metadata_migration_spec.rb index 748b9fe1cd1..c37e19eb71c 100644 --- a/spec/migrations/schedule_pages_metadata_migration_spec.rb +++ b/spec/migrations/schedule_pages_metadata_migration_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191002031332_schedule_pages_metadata_migration') -describe SchedulePagesMetadataMigration do +RSpec.describe SchedulePagesMetadataMigration do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb b/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb index d778b47179f..8b26cd589fd 100644 --- a/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb +++ b/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190322132835_schedule_populate_merge_request_assignees_table.rb') -describe SchedulePopulateMergeRequestAssigneesTable do +RSpec.describe SchedulePopulateMergeRequestAssigneesTable do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:namespace) { namespaces.create(name: 'gitlab', path: 'gitlab-org') } diff --git a/spec/migrations/schedule_populate_user_highest_roles_table_spec.rb b/spec/migrations/schedule_populate_user_highest_roles_table_spec.rb index 67e0b994265..c7e5c6f30a6 100644 --- a/spec/migrations/schedule_populate_user_highest_roles_table_spec.rb +++ b/spec/migrations/schedule_populate_user_highest_roles_table_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200311130802_schedule_populate_user_highest_roles_table.rb') -describe SchedulePopulateUserHighestRolesTable do +RSpec.describe SchedulePopulateUserHighestRolesTable do let(:users) { table(:users) } def create_user(id, params = {}) diff --git a/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb b/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb index 4c05f7d57a1..06f1a7e28eb 100644 --- a/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb +++ b/spec/migrations/schedule_recalculate_project_authorizations_second_run_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200204113224_schedule_recalculate_project_authorizations_second_run.rb') -describe ScheduleRecalculateProjectAuthorizationsSecondRun do +RSpec.describe ScheduleRecalculateProjectAuthorizationsSecondRun do let(:users_table) { table(:users) } before do diff --git a/spec/migrations/schedule_recalculate_project_authorizations_spec.rb b/spec/migrations/schedule_recalculate_project_authorizations_spec.rb index d30ebf825ef..9519b103284 100644 --- a/spec/migrations/schedule_recalculate_project_authorizations_spec.rb +++ b/spec/migrations/schedule_recalculate_project_authorizations_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200204113223_schedule_recalculate_project_authorizations.rb') -describe ScheduleRecalculateProjectAuthorizations do +RSpec.describe ScheduleRecalculateProjectAuthorizations do let(:users_table) { table(:users) } let(:namespaces_table) { table(:namespaces) } let(:projects_table) { table(:projects) } diff --git a/spec/migrations/schedule_recalculate_project_authorizations_third_run_spec.rb b/spec/migrations/schedule_recalculate_project_authorizations_third_run_spec.rb index 19ba8984224..300bb940dd8 100644 --- a/spec/migrations/schedule_recalculate_project_authorizations_third_run_spec.rb +++ b/spec/migrations/schedule_recalculate_project_authorizations_third_run_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200204113225_schedule_recalculate_project_authorizations_third_run.rb') -describe ScheduleRecalculateProjectAuthorizationsThirdRun do +RSpec.describe ScheduleRecalculateProjectAuthorizationsThirdRun do let(:users_table) { table(:users) } before do diff --git a/spec/migrations/schedule_sync_issuables_state_id_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_spec.rb index 408e7e6d19d..ecfebbde348 100644 --- a/spec/migrations/schedule_sync_issuables_state_id_spec.rb +++ b/spec/migrations/schedule_sync_issuables_state_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190214112022_schedule_sync_issuables_state_id.rb') -describe ScheduleSyncIssuablesStateId do +RSpec.describe ScheduleSyncIssuablesStateId do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:merge_requests) { table(:merge_requests) } diff --git a/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb index e26a864b8ba..d23f5b69d22 100644 --- a/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb +++ b/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190506135400_schedule_sync_issuables_state_id_where_nil') -describe ScheduleSyncIssuablesStateIdWhereNil do +RSpec.describe ScheduleSyncIssuablesStateIdWhereNil do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:merge_requests) { table(:merge_requests) } diff --git a/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb b/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb index 098fe68927c..949d8d8794f 100644 --- a/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb +++ b/spec/migrations/schedule_update_existing_subgroup_to_match_visibility_level_of_parent_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200110121314_schedule_update_existing_subgroup_to_match_visibility_level_of_parent.rb') -describe ScheduleUpdateExistingSubgroupToMatchVisibilityLevelOfParent do +RSpec.describe ScheduleUpdateExistingSubgroupToMatchVisibilityLevelOfParent do include MigrationHelpers::NamespacesHelpers let(:migration_class) { described_class::MIGRATION } let(:migration_name) { migration_class.to_s.demodulize } diff --git a/spec/migrations/seed_repository_storages_weighted_spec.rb b/spec/migrations/seed_repository_storages_weighted_spec.rb index 9a68ff5fb2f..fb077a3e345 100644 --- a/spec/migrations/seed_repository_storages_weighted_spec.rb +++ b/spec/migrations/seed_repository_storages_weighted_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200526000407_seed_repository_storages_weighted.rb') -describe SeedRepositoryStoragesWeighted do +RSpec.describe SeedRepositoryStoragesWeighted do let(:storages) { { "foo" => {}, "baz" => {} } } let(:application_settings) do table(:application_settings).tap do |klass| diff --git a/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb b/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb index d4f9969b71b..6cab4c16cfb 100644 --- a/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb +++ b/spec/migrations/services_remove_temporary_index_on_project_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200203104214_services_remove_temporary_index_on_project_id.rb') -describe ServicesRemoveTemporaryIndexOnProjectId do +RSpec.describe ServicesRemoveTemporaryIndexOnProjectId do let(:migration_instance) { described_class.new } it 'adds and removes temporary partial index in up and down methods' do diff --git a/spec/migrations/set_issue_id_for_all_versions_spec.rb b/spec/migrations/set_issue_id_for_all_versions_spec.rb index ff281947db8..0908d054e70 100644 --- a/spec/migrations/set_issue_id_for_all_versions_spec.rb +++ b/spec/migrations/set_issue_id_for_all_versions_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190715043954_set_issue_id_for_all_versions.rb') -describe SetIssueIdForAllVersions do +RSpec.describe SetIssueIdForAllVersions do let(:projects) { table(:projects) } let(:issues) { table(:issues) } let(:designs) { table(:design_management_designs) } diff --git a/spec/migrations/sync_issuables_state_id_spec.rb b/spec/migrations/sync_issuables_state_id_spec.rb index 4bd30172cbe..dcddbca6a36 100644 --- a/spec/migrations/sync_issuables_state_id_spec.rb +++ b/spec/migrations/sync_issuables_state_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20190911251732_sync_issuables_state_id') -describe SyncIssuablesStateId do +RSpec.describe SyncIssuablesStateId do let(:migration) { described_class.new } describe '#up' do diff --git a/spec/migrations/truncate_user_fullname_spec.rb b/spec/migrations/truncate_user_fullname_spec.rb index a5e6a0a4fce..cb95c222790 100644 --- a/spec/migrations/truncate_user_fullname_spec.rb +++ b/spec/migrations/truncate_user_fullname_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20190325080727_truncate_user_fullname.rb') -describe TruncateUserFullname do +RSpec.describe TruncateUserFullname do let(:users) { table(:users) } let(:user_short) { create_user(name: 'abc', email: 'test_short@example.com') } diff --git a/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb b/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb index f9523e0e582..8b241d1b28e 100644 --- a/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb +++ b/spec/migrations/update_application_setting_npm_package_requests_forwarding_default_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200221105436_update_application_setting_npm_package_requests_forwarding_default.rb') -describe UpdateApplicationSettingNpmPackageRequestsForwardingDefault do +RSpec.describe UpdateApplicationSettingNpmPackageRequestsForwardingDefault do # Create test data - pipeline and CI/CD jobs. let(:application_settings) { table(:application_settings) } diff --git a/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb b/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb index d149ec230a7..7f5ae892391 100644 --- a/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb +++ b/spec/migrations/update_fingerprint_sha256_within_keys_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20200106071113_update_fingerprint_sha256_within_keys.rb') -describe UpdateFingerprintSha256WithinKeys do +RSpec.describe UpdateFingerprintSha256WithinKeys do let(:key_table) { table(:keys) } describe '#up' do diff --git a/spec/migrations/update_minimum_password_length_spec.rb b/spec/migrations/update_minimum_password_length_spec.rb index ed9c85362f5..a4485dfbcea 100644 --- a/spec/migrations/update_minimum_password_length_spec.rb +++ b/spec/migrations/update_minimum_password_length_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20191205084057_update_minimum_password_length') -describe UpdateMinimumPasswordLength do +RSpec.describe UpdateMinimumPasswordLength do let(:application_settings) { table(:application_settings) } let(:application_setting) do application_settings.create!( diff --git a/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb b/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb index 918c5fb567f..f55d55f94c7 100644 --- a/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb +++ b/spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20200116175538_update_timestamp_softwarelicensespolicy.rb') -describe UpdateTimestampSoftwarelicensespolicy do +RSpec.describe UpdateTimestampSoftwarelicensespolicy do let(:software_licenses_policy) { table(:software_license_policies) } let(:projects) { table(:projects) } let(:licenses) { table(:software_licenses) } diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 9ef77da6f43..9206f14fd37 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ability do +RSpec.describe Ability do context 'using a nil subject' do it 'has no permissions' do expect(described_class.policy_for(nil, nil)).to be_banned diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb index 2c4fa398636..a97574fa524 100644 --- a/spec/models/abuse_report_spec.rb +++ b/spec/models/abuse_report_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AbuseReport do +RSpec.describe AbuseReport do let_it_be(:report, reload: true) { create(:abuse_report) } let_it_be(:user, reload: true) { create(:admin) } subject { report } diff --git a/spec/models/alert_management/alert_assignee_spec.rb b/spec/models/alert_management/alert_assignee_spec.rb index c51a5d543ab..c50a3ec0d01 100644 --- a/spec/models/alert_management/alert_assignee_spec.rb +++ b/spec/models/alert_management/alert_assignee_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AlertManagement::AlertAssignee do +RSpec.describe AlertManagement::AlertAssignee do describe 'associations' do it { is_expected.to belong_to(:alert) } it { is_expected.to belong_to(:assignee) } diff --git a/spec/models/alert_management/alert_spec.rb b/spec/models/alert_management/alert_spec.rb index 4e956d9fc18..f76acd0f91d 100644 --- a/spec/models/alert_management/alert_spec.rb +++ b/spec/models/alert_management/alert_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AlertManagement::Alert do +RSpec.describe AlertManagement::Alert do describe 'associations' do it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:issue) } diff --git a/spec/models/alerting/project_alerting_setting_spec.rb b/spec/models/alerting/project_alerting_setting_spec.rb index 40fbe3a6e78..90c5f8313b0 100644 --- a/spec/models/alerting/project_alerting_setting_spec.rb +++ b/spec/models/alerting/project_alerting_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Alerting::ProjectAlertingSetting do +RSpec.describe Alerting::ProjectAlertingSetting do let_it_be(:project) { create(:project) } subject { create(:project_alerting_setting, project: project) } diff --git a/spec/models/analytics/cycle_analytics/project_stage_spec.rb b/spec/models/analytics/cycle_analytics/project_stage_spec.rb index 9850bfde30e..2e024011553 100644 --- a/spec/models/analytics/cycle_analytics/project_stage_spec.rb +++ b/spec/models/analytics/cycle_analytics/project_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Analytics::CycleAnalytics::ProjectStage do +RSpec.describe Analytics::CycleAnalytics::ProjectStage do describe 'associations' do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/appearance_spec.rb b/spec/models/appearance_spec.rb index 2c32028c3e5..37eddf9a22a 100644 --- a/spec/models/appearance_spec.rb +++ b/spec/models/appearance_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Appearance do +RSpec.describe Appearance do subject { build(:appearance) } it { include(CacheableAttributes) } diff --git a/spec/models/application_record_spec.rb b/spec/models/application_record_spec.rb index 74573d0941c..06ecd674928 100644 --- a/spec/models/application_record_spec.rb +++ b/spec/models/application_record_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ApplicationRecord do +RSpec.describe ApplicationRecord do describe '#id_in' do let(:records) { create_list(:user, 3) } diff --git a/spec/models/application_setting/term_spec.rb b/spec/models/application_setting/term_spec.rb index dd263335b81..82347453437 100644 --- a/spec/models/application_setting/term_spec.rb +++ b/spec/models/application_setting/term_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ApplicationSetting::Term do +RSpec.describe ApplicationSetting::Term do describe 'validations' do it { is_expected.to validate_presence_of(:terms) } end diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index 96bf19439a1..f618e13ca26 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ApplicationSetting do +RSpec.describe ApplicationSetting do using RSpec::Parameterized::TableSyntax subject(:setting) { described_class.create_from_defaults } diff --git a/spec/models/award_emoji_spec.rb b/spec/models/award_emoji_spec.rb index 8b370e80c9b..f268408c095 100644 --- a/spec/models/award_emoji_spec.rb +++ b/spec/models/award_emoji_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AwardEmoji do +RSpec.describe AwardEmoji do describe 'Associations' do it { is_expected.to belong_to(:awardable) } it { is_expected.to belong_to(:user) } diff --git a/spec/models/aws/role_spec.rb b/spec/models/aws/role_spec.rb index d4165567146..612868f6eb0 100644 --- a/spec/models/aws/role_spec.rb +++ b/spec/models/aws/role_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Aws::Role do +RSpec.describe Aws::Role do it { is_expected.to belong_to(:user) } it { is_expected.to validate_length_of(:role_external_id).is_at_least(1).is_at_most(64) } diff --git a/spec/models/badge_spec.rb b/spec/models/badge_spec.rb index fba8f40e99b..f3c95332ca0 100644 --- a/spec/models/badge_spec.rb +++ b/spec/models/badge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Badge do +RSpec.describe Badge do let(:placeholder_url) { 'http://www.example.com/%{project_path}/%{project_id}/%{default_branch}/%{commit_sha}' } describe 'validations' do diff --git a/spec/models/badges/group_badge_spec.rb b/spec/models/badges/group_badge_spec.rb index c297bc957ea..8913a2e6f17 100644 --- a/spec/models/badges/group_badge_spec.rb +++ b/spec/models/badges/group_badge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupBadge do +RSpec.describe GroupBadge do describe 'associations' do it { is_expected.to belong_to(:group) } end diff --git a/spec/models/badges/project_badge_spec.rb b/spec/models/badges/project_badge_spec.rb index c0e85d3de87..9b9836129a6 100644 --- a/spec/models/badges/project_badge_spec.rb +++ b/spec/models/badges/project_badge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectBadge do +RSpec.describe ProjectBadge do let(:placeholder_url) { 'http://www.example.com/%{project_path}/%{project_id}/%{default_branch}/%{commit_sha}' } describe 'associations' do diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb index c2d6406c3fb..bd4832bd978 100644 --- a/spec/models/blob_spec.rb +++ b/spec/models/blob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Blob do +RSpec.describe Blob do include FakeBlobHelpers using RSpec::Parameterized::TableSyntax diff --git a/spec/models/blob_viewer/base_spec.rb b/spec/models/blob_viewer/base_spec.rb index 39c7a34f052..682b6dc3b1d 100644 --- a/spec/models/blob_viewer/base_spec.rb +++ b/spec/models/blob_viewer/base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::Base do +RSpec.describe BlobViewer::Base do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/changelog_spec.rb b/spec/models/blob_viewer/changelog_spec.rb index b71531ff3c2..5346483cfc8 100644 --- a/spec/models/blob_viewer/changelog_spec.rb +++ b/spec/models/blob_viewer/changelog_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::Changelog do +RSpec.describe BlobViewer::Changelog do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/blob_viewer/composer_json_spec.rb b/spec/models/blob_viewer/composer_json_spec.rb index a6bb64ba121..8d66e9e951f 100644 --- a/spec/models/blob_viewer/composer_json_spec.rb +++ b/spec/models/blob_viewer/composer_json_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::ComposerJson do +RSpec.describe BlobViewer::ComposerJson do include FakeBlobHelpers let(:project) { build_stubbed(:project) } diff --git a/spec/models/blob_viewer/gemspec_spec.rb b/spec/models/blob_viewer/gemspec_spec.rb index 291d14e2d72..b6f3e059c7e 100644 --- a/spec/models/blob_viewer/gemspec_spec.rb +++ b/spec/models/blob_viewer/gemspec_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::Gemspec do +RSpec.describe BlobViewer::Gemspec do include FakeBlobHelpers let(:project) { build_stubbed(:project) } diff --git a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb index e645733e02d..cd885d312dc 100644 --- a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb +++ b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::GitlabCiYml do +RSpec.describe BlobViewer::GitlabCiYml do include FakeBlobHelpers include RepoHelpers diff --git a/spec/models/blob_viewer/license_spec.rb b/spec/models/blob_viewer/license_spec.rb index b0426401932..bc970136503 100644 --- a/spec/models/blob_viewer/license_spec.rb +++ b/spec/models/blob_viewer/license_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::License do +RSpec.describe BlobViewer::License do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/blob_viewer/metrics_dashboard_yml_spec.rb b/spec/models/blob_viewer/metrics_dashboard_yml_spec.rb index f5b8586975d..057f0f32158 100644 --- a/spec/models/blob_viewer/metrics_dashboard_yml_spec.rb +++ b/spec/models/blob_viewer/metrics_dashboard_yml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::MetricsDashboardYml do +RSpec.describe BlobViewer::MetricsDashboardYml do include FakeBlobHelpers include RepoHelpers diff --git a/spec/models/blob_viewer/package_json_spec.rb b/spec/models/blob_viewer/package_json_spec.rb index 7f7b1dcfcb3..d2e8ab6575f 100644 --- a/spec/models/blob_viewer/package_json_spec.rb +++ b/spec/models/blob_viewer/package_json_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::PackageJson do +RSpec.describe BlobViewer::PackageJson do include FakeBlobHelpers let(:project) { build_stubbed(:project) } diff --git a/spec/models/blob_viewer/podspec_json_spec.rb b/spec/models/blob_viewer/podspec_json_spec.rb index dd5ed03b77d..61d2602c413 100644 --- a/spec/models/blob_viewer/podspec_json_spec.rb +++ b/spec/models/blob_viewer/podspec_json_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::PodspecJson do +RSpec.describe BlobViewer::PodspecJson do include FakeBlobHelpers let(:project) { build_stubbed(:project) } diff --git a/spec/models/blob_viewer/podspec_spec.rb b/spec/models/blob_viewer/podspec_spec.rb index 2d9b184c5cb..0a0fbcaebd4 100644 --- a/spec/models/blob_viewer/podspec_spec.rb +++ b/spec/models/blob_viewer/podspec_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::Podspec do +RSpec.describe BlobViewer::Podspec do include FakeBlobHelpers let(:project) { build_stubbed(:project) } diff --git a/spec/models/blob_viewer/readme_spec.rb b/spec/models/blob_viewer/readme_spec.rb index 89bc5be94fb..4c5f11d55ff 100644 --- a/spec/models/blob_viewer/readme_spec.rb +++ b/spec/models/blob_viewer/readme_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::Readme do +RSpec.describe BlobViewer::Readme do include FakeBlobHelpers let(:project) { create(:project, :repository, :wiki_repo) } diff --git a/spec/models/blob_viewer/route_map_spec.rb b/spec/models/blob_viewer/route_map_spec.rb index 6c703df5c4c..bb0284d7868 100644 --- a/spec/models/blob_viewer/route_map_spec.rb +++ b/spec/models/blob_viewer/route_map_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::RouteMap do +RSpec.describe BlobViewer::RouteMap do include FakeBlobHelpers let(:project) { build_stubbed(:project) } diff --git a/spec/models/blob_viewer/server_side_spec.rb b/spec/models/blob_viewer/server_side_spec.rb index f95305abe78..284ac4524f7 100644 --- a/spec/models/blob_viewer/server_side_spec.rb +++ b/spec/models/blob_viewer/server_side_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobViewer::ServerSide do +RSpec.describe BlobViewer::ServerSide do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/board_group_recent_visit_spec.rb b/spec/models/board_group_recent_visit_spec.rb index 558be61824f..4d16e1ff839 100644 --- a/spec/models/board_group_recent_visit_spec.rb +++ b/spec/models/board_group_recent_visit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BoardGroupRecentVisit do +RSpec.describe BoardGroupRecentVisit do let(:user) { create(:user) } let(:group) { create(:group) } let(:board) { create(:board, group: group) } diff --git a/spec/models/board_project_recent_visit_spec.rb b/spec/models/board_project_recent_visit_spec.rb index e404fb3bbdb..8e74405fd8c 100644 --- a/spec/models/board_project_recent_visit_spec.rb +++ b/spec/models/board_project_recent_visit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BoardProjectRecentVisit do +RSpec.describe BoardProjectRecentVisit do let(:user) { create(:user) } let(:project) { create(:project) } let(:board) { create(:board, project: project) } diff --git a/spec/models/board_spec.rb b/spec/models/board_spec.rb index 2d5309b4d23..d309b4dbdb9 100644 --- a/spec/models/board_spec.rb +++ b/spec/models/board_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Board do +RSpec.describe Board do let(:project) { create(:project) } let(:other_project) { create(:project) } diff --git a/spec/models/broadcast_message_spec.rb b/spec/models/broadcast_message_spec.rb index 8032f913d86..fc463c6af52 100644 --- a/spec/models/broadcast_message_spec.rb +++ b/spec/models/broadcast_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BroadcastMessage do +RSpec.describe BroadcastMessage do subject { build(:broadcast_message) } it { is_expected.to be_valid } diff --git a/spec/models/chat_name_spec.rb b/spec/models/chat_name_spec.rb index 02594b98665..623e55aad21 100644 --- a/spec/models/chat_name_spec.rb +++ b/spec/models/chat_name_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatName do +RSpec.describe ChatName do let_it_be(:chat_name) { create(:chat_name) } subject { chat_name } diff --git a/spec/models/chat_team_spec.rb b/spec/models/chat_team_spec.rb index 107fdaccc68..08fd05324aa 100644 --- a/spec/models/chat_team_spec.rb +++ b/spec/models/chat_team_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatTeam do +RSpec.describe ChatTeam do let_it_be(:chat_team) { create(:chat_team) } subject { chat_team } diff --git a/spec/models/ci/artifact_blob_spec.rb b/spec/models/ci/artifact_blob_spec.rb index 99983686670..44f895cc1c5 100644 --- a/spec/models/ci/artifact_blob_spec.rb +++ b/spec/models/ci/artifact_blob_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::ArtifactBlob do +RSpec.describe Ci::ArtifactBlob do let_it_be(:project) { create(:project, :public) } let_it_be(:build) { create(:ci_build, :artifacts, project: project) } let(:entry) { build.artifacts_metadata_entry('other_artifacts_0.1.2/another-subdirectory/banana_sample.gif') } diff --git a/spec/models/ci/bridge_spec.rb b/spec/models/ci/bridge_spec.rb index 439648aba5a..3a459e5897a 100644 --- a/spec/models/ci/bridge_spec.rb +++ b/spec/models/ci/bridge_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Bridge do +RSpec.describe Ci::Bridge do let_it_be(:project) { create(:project) } let_it_be(:target_project) { create(:project, name: 'project', namespace: create(:namespace, name: 'my')) } let_it_be(:pipeline) { create(:ci_pipeline, project: project) } diff --git a/spec/models/ci/build_dependencies_spec.rb b/spec/models/ci/build_dependencies_spec.rb index 8f2199ac360..4fa1b3eb5a5 100644 --- a/spec/models/ci/build_dependencies_spec.rb +++ b/spec/models/ci/build_dependencies_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildDependencies do +RSpec.describe Ci::BuildDependencies do let_it_be(:user) { create(:user) } let_it_be(:project, reload: true) { create(:project, :repository) } diff --git a/spec/models/ci/build_metadata_spec.rb b/spec/models/ci/build_metadata_spec.rb index 0f7fa5f8e60..e4d71632957 100644 --- a/spec/models/ci/build_metadata_spec.rb +++ b/spec/models/ci/build_metadata_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildMetadata do +RSpec.describe Ci::BuildMetadata do let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, :repository, group: group, build_timeout: 2000) } diff --git a/spec/models/ci/build_need_spec.rb b/spec/models/ci/build_need_spec.rb index d1186fa981d..d36a3768518 100644 --- a/spec/models/ci/build_need_spec.rb +++ b/spec/models/ci/build_need_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildNeed, model: true do +RSpec.describe Ci::BuildNeed, model: true do let(:build_need) { build(:ci_build_need) } it { is_expected.to belong_to(:build) } diff --git a/spec/models/ci/build_report_result_spec.rb b/spec/models/ci/build_report_result_spec.rb index 078b0d100a1..e78f602feef 100644 --- a/spec/models/ci/build_report_result_spec.rb +++ b/spec/models/ci/build_report_result_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildReportResult do +RSpec.describe Ci::BuildReportResult do let(:build_report_result) { build(:ci_build_report_result, :with_junit_success) } describe 'associations' do diff --git a/spec/models/ci/build_runner_session_spec.rb b/spec/models/ci/build_runner_session_spec.rb index 3e520407884..601c6ad26f9 100644 --- a/spec/models/ci/build_runner_session_spec.rb +++ b/spec/models/ci/build_runner_session_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildRunnerSession, model: true do +RSpec.describe Ci::BuildRunnerSession, model: true do let!(:build) { create(:ci_build, :with_runner_session) } let(:url) { 'https://new.example.com' } diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 4f9c81b39bc..31f94fbbbb4 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Build do +RSpec.describe Ci::Build do let_it_be(:user) { create(:user) } let_it_be(:group, reload: true) { create(:group) } let_it_be(:project, reload: true) { create(:project, :repository, group: group) } diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb index 85873847fca..dab523f67ab 100644 --- a/spec/models/ci/build_trace_chunk_spec.rb +++ b/spec/models/ci/build_trace_chunk_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do +RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do include ExclusiveLeaseHelpers let_it_be(:build) { create(:ci_build, :running) } diff --git a/spec/models/ci/build_trace_chunks/database_spec.rb b/spec/models/ci/build_trace_chunks/database_spec.rb index eb94d7dae38..245625b8046 100644 --- a/spec/models/ci/build_trace_chunks/database_spec.rb +++ b/spec/models/ci/build_trace_chunks/database_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTraceChunks::Database do +RSpec.describe Ci::BuildTraceChunks::Database do let(:data_store) { described_class.new } describe '#available?' do diff --git a/spec/models/ci/build_trace_chunks/fog_spec.rb b/spec/models/ci/build_trace_chunks/fog_spec.rb index b8d78bcd069..7ef3018d87b 100644 --- a/spec/models/ci/build_trace_chunks/fog_spec.rb +++ b/spec/models/ci/build_trace_chunks/fog_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTraceChunks::Fog do +RSpec.describe Ci::BuildTraceChunks::Fog do let(:data_store) { described_class.new } before do diff --git a/spec/models/ci/build_trace_chunks/redis_spec.rb b/spec/models/ci/build_trace_chunks/redis_spec.rb index 6cff33d24fa..c37b8697a4d 100644 --- a/spec/models/ci/build_trace_chunks/redis_spec.rb +++ b/spec/models/ci/build_trace_chunks/redis_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTraceChunks::Redis, :clean_gitlab_redis_shared_state do +RSpec.describe Ci::BuildTraceChunks::Redis, :clean_gitlab_redis_shared_state do let(:data_store) { described_class.new } describe '#available?' do diff --git a/spec/models/ci/build_trace_section_name_spec.rb b/spec/models/ci/build_trace_section_name_spec.rb index 11e2d27ff79..b220e67d48e 100644 --- a/spec/models/ci/build_trace_section_name_spec.rb +++ b/spec/models/ci/build_trace_section_name_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTraceSectionName, model: true do +RSpec.describe Ci::BuildTraceSectionName, model: true do subject { build(:ci_build_trace_section_name) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/ci/build_trace_section_spec.rb b/spec/models/ci/build_trace_section_spec.rb index 5bd3a953ec0..640bd202b3a 100644 --- a/spec/models/ci/build_trace_section_spec.rb +++ b/spec/models/ci/build_trace_section_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTraceSection, model: true do +RSpec.describe Ci::BuildTraceSection, model: true do it { is_expected.to belong_to(:build)} it { is_expected.to belong_to(:project)} it { is_expected.to belong_to(:section_name)} diff --git a/spec/models/ci/build_trace_spec.rb b/spec/models/ci/build_trace_spec.rb index 2471a6fa827..ccfa1b89590 100644 --- a/spec/models/ci/build_trace_spec.rb +++ b/spec/models/ci/build_trace_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::BuildTrace do +RSpec.describe Ci::BuildTrace do let(:build) { build_stubbed(:ci_build) } let(:state) { nil } let(:data) { StringIO.new('the-stream') } diff --git a/spec/models/ci/daily_build_group_report_result_spec.rb b/spec/models/ci/daily_build_group_report_result_spec.rb index f2ce1b5775f..059a5b76b9a 100644 --- a/spec/models/ci/daily_build_group_report_result_spec.rb +++ b/spec/models/ci/daily_build_group_report_result_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::DailyBuildGroupReportResult do +RSpec.describe Ci::DailyBuildGroupReportResult do let(:daily_build_group_report_result) { build(:ci_daily_build_group_report_result)} describe 'associations' do diff --git a/spec/models/ci/freeze_period_status_spec.rb b/spec/models/ci/freeze_period_status_spec.rb index b700ec8c45f..831895cb528 100644 --- a/spec/models/ci/freeze_period_status_spec.rb +++ b/spec/models/ci/freeze_period_status_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe Ci::FreezePeriodStatus do +RSpec.describe Ci::FreezePeriodStatus do let(:project) { create :project } # '0 23 * * 5' == "At 23:00 on Friday."", '0 7 * * 1' == "At 07:00 on Monday."" let(:friday_2300) { '0 23 * * 5' } diff --git a/spec/models/ci/group_spec.rb b/spec/models/ci/group_spec.rb index 868382e3756..dc9aee906ea 100644 --- a/spec/models/ci/group_spec.rb +++ b/spec/models/ci/group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Group do +RSpec.describe Ci::Group do let_it_be(:project) { create(:project) } let!(:jobs) { build_list(:ci_build, 1, :success, project: project) } diff --git a/spec/models/ci/group_variable_spec.rb b/spec/models/ci/group_variable_spec.rb index 610db9bf0e5..c8eac4d8765 100644 --- a/spec/models/ci/group_variable_spec.rb +++ b/spec/models/ci/group_variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::GroupVariable do +RSpec.describe Ci::GroupVariable do subject { build(:ci_group_variable) } it_behaves_like "CI variable" diff --git a/spec/models/ci/instance_variable_spec.rb b/spec/models/ci/instance_variable_spec.rb index 4d69b7ac2f8..8ee2c1b2c8d 100644 --- a/spec/models/ci/instance_variable_spec.rb +++ b/spec/models/ci/instance_variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::InstanceVariable do +RSpec.describe Ci::InstanceVariable do subject { build(:ci_instance_variable) } it_behaves_like "CI variable" diff --git a/spec/models/ci/job_artifact_spec.rb b/spec/models/ci/job_artifact_spec.rb index 17e00533ac3..ae20e351761 100644 --- a/spec/models/ci/job_artifact_spec.rb +++ b/spec/models/ci/job_artifact_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::JobArtifact do +RSpec.describe Ci::JobArtifact do let(:artifact) { create(:ci_job_artifact, :archive) } describe "Associations" do diff --git a/spec/models/ci/job_variable_spec.rb b/spec/models/ci/job_variable_spec.rb index b94a914c784..4aebd3283f0 100644 --- a/spec/models/ci/job_variable_spec.rb +++ b/spec/models/ci/job_variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::JobVariable do +RSpec.describe Ci::JobVariable do subject { build(:ci_job_variable) } it_behaves_like "CI variable" diff --git a/spec/models/ci/legacy_stage_spec.rb b/spec/models/ci/legacy_stage_spec.rb index f503fc10c08..c53f6abb037 100644 --- a/spec/models/ci/legacy_stage_spec.rb +++ b/spec/models/ci/legacy_stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::LegacyStage do +RSpec.describe Ci::LegacyStage do let(:stage) { build(:ci_stage) } let(:pipeline) { stage.pipeline } let(:stage_name) { stage.name } diff --git a/spec/models/ci/persistent_ref_spec.rb b/spec/models/ci/persistent_ref_spec.rb index 89dd9b05331..18552317025 100644 --- a/spec/models/ci/persistent_ref_spec.rb +++ b/spec/models/ci/persistent_ref_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::PersistentRef do +RSpec.describe Ci::PersistentRef do it 'cleans up persistent refs after pipeline finished' do pipeline = create(:ci_pipeline, :running) diff --git a/spec/models/ci/pipeline_config_spec.rb b/spec/models/ci/pipeline_config_spec.rb index 25f514ee5ab..3d033d33df3 100644 --- a/spec/models/ci/pipeline_config_spec.rb +++ b/spec/models/ci/pipeline_config_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::PipelineConfig, type: :model do +RSpec.describe Ci::PipelineConfig, type: :model do it { is_expected.to belong_to(:pipeline) } it { is_expected.to validate_presence_of(:pipeline) } diff --git a/spec/models/ci/pipeline_schedule_spec.rb b/spec/models/ci/pipeline_schedule_spec.rb index 4ba70552f01..949d5f7bd04 100644 --- a/spec/models/ci/pipeline_schedule_spec.rb +++ b/spec/models/ci/pipeline_schedule_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::PipelineSchedule do +RSpec.describe Ci::PipelineSchedule do subject { build(:ci_pipeline_schedule) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/ci/pipeline_schedule_variable_spec.rb b/spec/models/ci/pipeline_schedule_variable_spec.rb index c96a24d5042..fd6b1d3dce0 100644 --- a/spec/models/ci/pipeline_schedule_variable_spec.rb +++ b/spec/models/ci/pipeline_schedule_variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::PipelineScheduleVariable do +RSpec.describe Ci::PipelineScheduleVariable do subject { build(:ci_pipeline_schedule_variable) } it_behaves_like "CI variable" diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 5e4eab3bf3a..7a324bee80b 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Pipeline, :mailer do +RSpec.describe Ci::Pipeline, :mailer do include ProjectForksHelper include StubRequests diff --git a/spec/models/ci/pipeline_variable_spec.rb b/spec/models/ci/pipeline_variable_spec.rb index e8c7ce088e2..04fcaab4c2d 100644 --- a/spec/models/ci/pipeline_variable_spec.rb +++ b/spec/models/ci/pipeline_variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::PipelineVariable do +RSpec.describe Ci::PipelineVariable do subject { build(:ci_pipeline_variable) } it_behaves_like "CI variable" diff --git a/spec/models/ci/processable_spec.rb b/spec/models/ci/processable_spec.rb index e67f740279b..35764e2bbbe 100644 --- a/spec/models/ci/processable_spec.rb +++ b/spec/models/ci/processable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Processable do +RSpec.describe Ci::Processable do let_it_be(:project) { create(:project) } let_it_be(:pipeline) { create(:ci_pipeline, project: project) } diff --git a/spec/models/ci/ref_spec.rb b/spec/models/ci/ref_spec.rb index 3d75cb63141..8b5a2147f77 100644 --- a/spec/models/ci/ref_spec.rb +++ b/spec/models/ci/ref_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Ref do +RSpec.describe Ci::Ref do it { is_expected.to belong_to(:project) } describe '.ensure_for' do diff --git a/spec/models/ci/resource_group_spec.rb b/spec/models/ci/resource_group_spec.rb index ce8b03282bc..9f72d1a82e5 100644 --- a/spec/models/ci/resource_group_spec.rb +++ b/spec/models/ci/resource_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::ResourceGroup do +RSpec.describe Ci::ResourceGroup do describe 'validation' do it 'valids when key includes allowed character' do resource_group = build(:ci_resource_group, key: 'test') diff --git a/spec/models/ci/resource_spec.rb b/spec/models/ci/resource_spec.rb index 27e512e2c45..90f26ef2b31 100644 --- a/spec/models/ci/resource_spec.rb +++ b/spec/models/ci/resource_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Resource do +RSpec.describe Ci::Resource do describe '.free' do subject { described_class.free } diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 296240b1602..b304c31b614 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Runner do +RSpec.describe Ci::Runner do it_behaves_like 'having unique enum values' describe 'validation' do diff --git a/spec/models/ci/sources/pipeline_spec.rb b/spec/models/ci/sources/pipeline_spec.rb index 5023747b487..ccf3140650b 100644 --- a/spec/models/ci/sources/pipeline_spec.rb +++ b/spec/models/ci/sources/pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Sources::Pipeline do +RSpec.describe Ci::Sources::Pipeline do it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:pipeline) } diff --git a/spec/models/ci/stage_spec.rb b/spec/models/ci/stage_spec.rb index d21cc7626b4..3d873a1b9c1 100644 --- a/spec/models/ci/stage_spec.rb +++ b/spec/models/ci/stage_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Stage, :models do +RSpec.describe Ci::Stage, :models do let_it_be(:pipeline) { create(:ci_empty_pipeline) } let(:stage) { create(:ci_stage_entity, pipeline: pipeline, project: pipeline.project) } diff --git a/spec/models/ci/trigger_request_spec.rb b/spec/models/ci/trigger_request_spec.rb index d04349bec92..0d462741089 100644 --- a/spec/models/ci/trigger_request_spec.rb +++ b/spec/models/ci/trigger_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::TriggerRequest do +RSpec.describe Ci::TriggerRequest do describe 'validation' do it 'be invalid if saving a variable' do trigger = build(:ci_trigger_request, variables: { TRIGGER_KEY_1: 'TRIGGER_VALUE_1' } ) diff --git a/spec/models/ci/trigger_spec.rb b/spec/models/ci/trigger_spec.rb index 5b0815f8156..4ba6c6e50f7 100644 --- a/spec/models/ci/trigger_spec.rb +++ b/spec/models/ci/trigger_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Trigger do +RSpec.describe Ci::Trigger do let(:project) { create :project } describe 'associations' do diff --git a/spec/models/ci/variable_spec.rb b/spec/models/ci/variable_spec.rb index 810a0ddfd2e..26a7a2596af 100644 --- a/spec/models/ci/variable_spec.rb +++ b/spec/models/ci/variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Variable do +RSpec.describe Ci::Variable do subject { build(:ci_variable) } it_behaves_like "CI variable" diff --git a/spec/models/clusters/applications/cert_manager_spec.rb b/spec/models/clusters/applications/cert_manager_spec.rb index d7fd0d06b05..7ca7f533a27 100644 --- a/spec/models/clusters/applications/cert_manager_spec.rb +++ b/spec/models/clusters/applications/cert_manager_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::CertManager do +RSpec.describe Clusters::Applications::CertManager do let(:cert_manager) { create(:clusters_applications_cert_manager) } include_examples 'cluster application core specs', :clusters_applications_cert_manager diff --git a/spec/models/clusters/applications/crossplane_spec.rb b/spec/models/clusters/applications/crossplane_spec.rb index ebc675497f4..a41c5f6586b 100644 --- a/spec/models/clusters/applications/crossplane_spec.rb +++ b/spec/models/clusters/applications/crossplane_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Crossplane do +RSpec.describe Clusters::Applications::Crossplane do let(:crossplane) { create(:clusters_applications_crossplane) } include_examples 'cluster application core specs', :clusters_applications_crossplane diff --git a/spec/models/clusters/applications/elastic_stack_spec.rb b/spec/models/clusters/applications/elastic_stack_spec.rb index 50042a4e29a..9ea93c178a6 100644 --- a/spec/models/clusters/applications/elastic_stack_spec.rb +++ b/spec/models/clusters/applications/elastic_stack_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::ElasticStack do +RSpec.describe Clusters::Applications::ElasticStack do include KubernetesHelpers include_examples 'cluster application core specs', :clusters_applications_elastic_stack diff --git a/spec/models/clusters/applications/fluentd_spec.rb b/spec/models/clusters/applications/fluentd_spec.rb index 4e9548990ed..be7b4a87947 100644 --- a/spec/models/clusters/applications/fluentd_spec.rb +++ b/spec/models/clusters/applications/fluentd_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Fluentd do +RSpec.describe Clusters::Applications::Fluentd do let(:waf_log_enabled) { true } let(:cilium_log_enabled) { true } let(:fluentd) { create(:clusters_applications_fluentd, waf_log_enabled: waf_log_enabled, cilium_log_enabled: cilium_log_enabled) } diff --git a/spec/models/clusters/applications/helm_spec.rb b/spec/models/clusters/applications/helm_spec.rb index 87454e1d3e2..6d2ecaa6d47 100644 --- a/spec/models/clusters/applications/helm_spec.rb +++ b/spec/models/clusters/applications/helm_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Helm do +RSpec.describe Clusters::Applications::Helm do include_examples 'cluster application core specs', :clusters_applications_helm describe '.available' do diff --git a/spec/models/clusters/applications/ingress_spec.rb b/spec/models/clusters/applications/ingress_spec.rb index 8aee4eec0d3..d1138f5fa2d 100644 --- a/spec/models/clusters/applications/ingress_spec.rb +++ b/spec/models/clusters/applications/ingress_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Ingress do +RSpec.describe Clusters::Applications::Ingress do let(:ingress) { create(:clusters_applications_ingress) } it_behaves_like 'having unique enum values' diff --git a/spec/models/clusters/applications/jupyter_spec.rb b/spec/models/clusters/applications/jupyter_spec.rb index 937db9217f3..3cf24f1a9ef 100644 --- a/spec/models/clusters/applications/jupyter_spec.rb +++ b/spec/models/clusters/applications/jupyter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Jupyter do +RSpec.describe Clusters::Applications::Jupyter do include_examples 'cluster application core specs', :clusters_applications_jupyter include_examples 'cluster application status specs', :clusters_applications_jupyter include_examples 'cluster application version specs', :clusters_applications_jupyter diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb index 7ff7644e703..b14161ce8e6 100644 --- a/spec/models/clusters/applications/knative_spec.rb +++ b/spec/models/clusters/applications/knative_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Knative do +RSpec.describe Clusters::Applications::Knative do let(:knative) { create(:clusters_applications_knative) } include_examples 'cluster application core specs', :clusters_applications_knative diff --git a/spec/models/clusters/applications/prometheus_spec.rb b/spec/models/clusters/applications/prometheus_spec.rb index 1ed9e207b6b..1215b38a9a2 100644 --- a/spec/models/clusters/applications/prometheus_spec.rb +++ b/spec/models/clusters/applications/prometheus_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Prometheus do +RSpec.describe Clusters::Applications::Prometheus do include KubernetesHelpers include StubRequests diff --git a/spec/models/clusters/applications/runner_spec.rb b/spec/models/clusters/applications/runner_spec.rb index 6ee6711ec4b..fbabfd25b2f 100644 --- a/spec/models/clusters/applications/runner_spec.rb +++ b/spec/models/clusters/applications/runner_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Applications::Runner do +RSpec.describe Clusters::Applications::Runner do let(:ci_runner) { create(:ci_runner) } include_examples 'cluster application core specs', :clusters_applications_runner diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb index 4dd74976028..8b1afd271da 100644 --- a/spec/models/clusters/cluster_spec.rb +++ b/spec/models/clusters/cluster_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Cluster, :use_clean_rails_memory_store_caching do +RSpec.describe Clusters::Cluster, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers include KubernetesHelpers diff --git a/spec/models/clusters/clusters_hierarchy_spec.rb b/spec/models/clusters/clusters_hierarchy_spec.rb index 1957e1fc5ee..5ac561eb2d0 100644 --- a/spec/models/clusters/clusters_hierarchy_spec.rb +++ b/spec/models/clusters/clusters_hierarchy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::ClustersHierarchy do +RSpec.describe Clusters::ClustersHierarchy do describe '#base_and_ancestors' do def base_and_ancestors(clusterable, include_management_project: true) described_class.new(clusterable, include_management_project: include_management_project).base_and_ancestors diff --git a/spec/models/clusters/group_spec.rb b/spec/models/clusters/group_spec.rb index ba145342cb8..3b541c40938 100644 --- a/spec/models/clusters/group_spec.rb +++ b/spec/models/clusters/group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Group do +RSpec.describe Clusters::Group do it { is_expected.to belong_to(:cluster) } it { is_expected.to belong_to(:group) } end diff --git a/spec/models/clusters/platforms/kubernetes_spec.rb b/spec/models/clusters/platforms/kubernetes_spec.rb index f0e6dd53664..de5cd01df55 100644 --- a/spec/models/clusters/platforms/kubernetes_spec.rb +++ b/spec/models/clusters/platforms/kubernetes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Platforms::Kubernetes do +RSpec.describe Clusters::Platforms::Kubernetes do include KubernetesHelpers it { is_expected.to belong_to(:cluster) } diff --git a/spec/models/clusters/project_spec.rb b/spec/models/clusters/project_spec.rb index 671af085d10..e16dfa47898 100644 --- a/spec/models/clusters/project_spec.rb +++ b/spec/models/clusters/project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Project do +RSpec.describe Clusters::Project do it { is_expected.to belong_to(:cluster) } it { is_expected.to belong_to(:project) } it { is_expected.to have_many(:kubernetes_namespaces) } diff --git a/spec/models/clusters/providers/aws_spec.rb b/spec/models/clusters/providers/aws_spec.rb index 05d6e63288e..3b4a48cc5be 100644 --- a/spec/models/clusters/providers/aws_spec.rb +++ b/spec/models/clusters/providers/aws_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Providers::Aws do +RSpec.describe Clusters::Providers::Aws do it { is_expected.to belong_to(:cluster) } it { is_expected.to validate_length_of(:key_name).is_at_least(1).is_at_most(255) } diff --git a/spec/models/clusters/providers/gcp_spec.rb b/spec/models/clusters/providers/gcp_spec.rb index e2fd777d131..ad9ada04875 100644 --- a/spec/models/clusters/providers/gcp_spec.rb +++ b/spec/models/clusters/providers/gcp_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Clusters::Providers::Gcp do +RSpec.describe Clusters::Providers::Gcp do it { is_expected.to belong_to(:cluster) } it { is_expected.to validate_presence_of(:zone) } diff --git a/spec/models/commit_collection_spec.rb b/spec/models/commit_collection_spec.rb index d49b71db5f8..c32416795fb 100644 --- a/spec/models/commit_collection_spec.rb +++ b/spec/models/commit_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CommitCollection do +RSpec.describe CommitCollection do let(:project) { create(:project, :repository) } let(:commit) { project.commit("c1c67abbaf91f624347bb3ae96eabe3a1b742478") } diff --git a/spec/models/commit_range_spec.rb b/spec/models/commit_range_spec.rb index 245e47fa17b..3fb8708c884 100644 --- a/spec/models/commit_range_spec.rb +++ b/spec/models/commit_range_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CommitRange do +RSpec.describe CommitRange do describe 'modules' do subject { described_class } diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index ddda04faaf1..35380acd178 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Commit do +RSpec.describe Commit do let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:personal_snippet) { create(:personal_snippet, :repository) } let_it_be(:project_snippet) { create(:project_snippet, :repository) } diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index 85fc503a1ca..cd0110a787b 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CommitStatus do +RSpec.describe CommitStatus do let_it_be(:project) { create(:project, :repository) } let_it_be(:pipeline) do diff --git a/spec/models/commit_with_pipeline_spec.rb b/spec/models/commit_with_pipeline_spec.rb index e0bb29fec7b..ff451527929 100644 --- a/spec/models/commit_with_pipeline_spec.rb +++ b/spec/models/commit_with_pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CommitWithPipeline do +RSpec.describe CommitWithPipeline do let(:project) { create(:project, :public, :repository) } let(:commit) { described_class.new(project.commit) } diff --git a/spec/models/compare_spec.rb b/spec/models/compare_spec.rb index 43c3580bed2..d395aa359e5 100644 --- a/spec/models/compare_spec.rb +++ b/spec/models/compare_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Compare do +RSpec.describe Compare do include RepoHelpers let(:project) { create(:project, :public, :repository) } diff --git a/spec/models/concerns/access_requestable_spec.rb b/spec/models/concerns/access_requestable_spec.rb index 5c1694e3737..24eb3e8a1e6 100644 --- a/spec/models/concerns/access_requestable_spec.rb +++ b/spec/models/concerns/access_requestable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AccessRequestable do +RSpec.describe AccessRequestable do describe 'Group' do describe '#request_access' do let(:group) { create(:group, :public) } diff --git a/spec/models/concerns/atomic_internal_id_spec.rb b/spec/models/concerns/atomic_internal_id_spec.rb index 93bf7ec10dd..8c3537f1dcc 100644 --- a/spec/models/concerns/atomic_internal_id_spec.rb +++ b/spec/models/concerns/atomic_internal_id_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AtomicInternalId do +RSpec.describe AtomicInternalId do let(:milestone) { build(:milestone) } let(:iid) { double('iid', to_i: 42) } let(:external_iid) { 100 } diff --git a/spec/models/concerns/avatarable_spec.rb b/spec/models/concerns/avatarable_spec.rb index 96e867dbc97..8a8eeea39dc 100644 --- a/spec/models/concerns/avatarable_spec.rb +++ b/spec/models/concerns/avatarable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Avatarable do +RSpec.describe Avatarable do let(:project) { create(:project, :with_avatar) } let(:gitlab_host) { "https://gitlab.example.com" } diff --git a/spec/models/concerns/awardable_spec.rb b/spec/models/concerns/awardable_spec.rb index 29f911fcb04..b5b3772ecb6 100644 --- a/spec/models/concerns/awardable_spec.rb +++ b/spec/models/concerns/awardable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Awardable do +RSpec.describe Awardable do let!(:issue) { create(:issue) } let!(:award_emoji) { create(:award_emoji, :downvote, awardable: issue) } diff --git a/spec/models/concerns/batch_destroy_dependent_associations_spec.rb b/spec/models/concerns/batch_destroy_dependent_associations_spec.rb index d2373926802..a8fcb714c64 100644 --- a/spec/models/concerns/batch_destroy_dependent_associations_spec.rb +++ b/spec/models/concerns/batch_destroy_dependent_associations_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BatchDestroyDependentAssociations do +RSpec.describe BatchDestroyDependentAssociations do class TestProject < ActiveRecord::Base self.table_name = 'projects' diff --git a/spec/models/concerns/blob_language_from_git_attributes_spec.rb b/spec/models/concerns/blob_language_from_git_attributes_spec.rb index 4cb8f042b1d..c07ee15e841 100644 --- a/spec/models/concerns/blob_language_from_git_attributes_spec.rb +++ b/spec/models/concerns/blob_language_from_git_attributes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlobLanguageFromGitAttributes do +RSpec.describe BlobLanguageFromGitAttributes do include FakeBlobHelpers let(:project) { build(:project, :repository) } diff --git a/spec/models/concerns/blocks_json_serialization_spec.rb b/spec/models/concerns/blocks_json_serialization_spec.rb index 32870461019..d811b47fa35 100644 --- a/spec/models/concerns/blocks_json_serialization_spec.rb +++ b/spec/models/concerns/blocks_json_serialization_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BlocksJsonSerialization do +RSpec.describe BlocksJsonSerialization do before do stub_const('DummyModel', Class.new) DummyModel.class_eval do diff --git a/spec/models/concerns/bulk_insert_safe_spec.rb b/spec/models/concerns/bulk_insert_safe_spec.rb index 07d6cee487f..82b0c00b396 100644 --- a/spec/models/concerns/bulk_insert_safe_spec.rb +++ b/spec/models/concerns/bulk_insert_safe_spec.rb @@ -2,57 +2,7 @@ require 'spec_helper' -describe BulkInsertSafe do - class BulkInsertItem < ActiveRecord::Base - include BulkInsertSafe - include ShaAttribute - - validates :name, :enum_value, :secret_value, :sha_value, :jsonb_value, presence: true - - ENUM_VALUES = { - case_1: 1 - }.freeze - - sha_attribute :sha_value - - enum enum_value: ENUM_VALUES - - attr_encrypted :secret_value, - mode: :per_attribute_iv, - algorithm: 'aes-256-gcm', - key: Settings.attr_encrypted_db_key_base_32, - insecure_mode: false - - default_value_for :enum_value, 'case_1' - default_value_for :secret_value, 'my-secret' - default_value_for :sha_value, '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12' - default_value_for :jsonb_value, { "key" => "value" } - - def self.valid_list(count) - Array.new(count) { |n| new(name: "item-#{n}") } - end - - def self.invalid_list(count) - Array.new(count) { new } - end - end - - module InheritedUnsafeMethods - extend ActiveSupport::Concern - - included do - after_save -> { "unsafe" } - end - end - - module InheritedSafeMethods - extend ActiveSupport::Concern - - included do - after_initialize -> { "safe" } - end - end - +RSpec.describe BulkInsertSafe do before(:all) do ActiveRecord::Schema.define do create_table :bulk_insert_items, force: true do |t| @@ -66,100 +16,155 @@ describe BulkInsertSafe do t.index :name, unique: true end end - - BulkInsertItem.reset_column_information end after(:all) do ActiveRecord::Schema.define do drop_table :bulk_insert_items, force: true end + end + + let_it_be(:bulk_insert_item_class) do + Class.new(ActiveRecord::Base) do + self.table_name = 'bulk_insert_items' - BulkInsertItem.reset_column_information + include BulkInsertSafe + include ShaAttribute + + validates :name, :enum_value, :secret_value, :sha_value, :jsonb_value, presence: true + + sha_attribute :sha_value + + enum enum_value: { case_1: 1 } + + attr_encrypted :secret_value, + mode: :per_attribute_iv, + algorithm: 'aes-256-gcm', + key: Settings.attr_encrypted_db_key_base_32, + insecure_mode: false + + default_value_for :enum_value, 'case_1' + default_value_for :secret_value, 'my-secret' + default_value_for :sha_value, '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12' + default_value_for :jsonb_value, { "key" => "value" } + + def self.name + 'BulkInsertItem' + end + + def self.valid_list(count) + Array.new(count) { |n| new(name: "item-#{n}") } + end + + def self.invalid_list(count) + Array.new(count) { new } + end + end end - describe BulkInsertItem do - it_behaves_like 'a BulkInsertSafe model', described_class do - let(:valid_items_for_bulk_insertion) { described_class.valid_list(10) } - let(:invalid_items_for_bulk_insertion) { described_class.invalid_list(10) } + describe 'BulkInsertItem' do + it_behaves_like 'a BulkInsertSafe model' do + let(:target_class) { bulk_insert_item_class.dup } + let(:valid_items_for_bulk_insertion) { target_class.valid_list(10) } + let(:invalid_items_for_bulk_insertion) { target_class.invalid_list(10) } end context 'when inheriting class methods' do + let(:inherited_unsafe_methods_module) do + Module.new do + extend ActiveSupport::Concern + + included do + after_save -> { "unsafe" } + end + end + end + + let(:inherited_safe_methods_module) do + Module.new do + extend ActiveSupport::Concern + + included do + after_initialize -> { "safe" } + end + end + end + it 'raises an error when method is not bulk-insert safe' do - expect { described_class.include(InheritedUnsafeMethods) } - .to raise_error(described_class::MethodNotAllowedError) + expect { bulk_insert_item_class.include(inherited_unsafe_methods_module) } + .to raise_error(bulk_insert_item_class::MethodNotAllowedError) end it 'does not raise an error when method is bulk-insert safe' do - expect { described_class.include(InheritedSafeMethods) }.not_to raise_error + expect { bulk_insert_item_class.include(inherited_safe_methods_module) }.not_to raise_error end end context 'primary keys' do it 'raises error if primary keys are set prior to insertion' do - item = described_class.new(name: 'valid', id: 10) + item = bulk_insert_item_class.new(name: 'valid', id: 10) - expect { described_class.bulk_insert!([item]) } - .to raise_error(described_class::PrimaryKeySetError) + expect { bulk_insert_item_class.bulk_insert!([item]) } + .to raise_error(bulk_insert_item_class::PrimaryKeySetError) end end describe '.bulk_insert!' do it 'inserts items in the given number of batches' do - items = described_class.valid_list(10) + items = bulk_insert_item_class.valid_list(10) expect(ActiveRecord::InsertAll).to receive(:new).twice.and_call_original - described_class.bulk_insert!(items, batch_size: 5) + bulk_insert_item_class.bulk_insert!(items, batch_size: 5) end it 'items can be properly fetched from database' do - items = described_class.valid_list(10) + items = bulk_insert_item_class.valid_list(10) - described_class.bulk_insert!(items) + bulk_insert_item_class.bulk_insert!(items) - attribute_names = described_class.attribute_names - %w[id created_at updated_at] - expect(described_class.last(items.size).pluck(*attribute_names)).to eq( + attribute_names = bulk_insert_item_class.attribute_names - %w[id created_at updated_at] + expect(bulk_insert_item_class.last(items.size).pluck(*attribute_names)).to eq( items.pluck(*attribute_names)) end it 'rolls back the transaction when any item is invalid' do # second batch is bad - all_items = described_class.valid_list(10) + - described_class.invalid_list(10) + all_items = bulk_insert_item_class.valid_list(10) + + bulk_insert_item_class.invalid_list(10) expect do - described_class.bulk_insert!(all_items, batch_size: 2) rescue nil - end.not_to change { described_class.count } + bulk_insert_item_class.bulk_insert!(all_items, batch_size: 2) rescue nil + end.not_to change { bulk_insert_item_class.count } end it 'does nothing and returns an empty array when items are empty' do - expect(described_class.bulk_insert!([])).to eq([]) - expect(described_class.count).to eq(0) + expect(bulk_insert_item_class.bulk_insert!([])).to eq([]) + expect(bulk_insert_item_class.count).to eq(0) end context 'with returns option set' do context 'when is set to :ids' do it 'return an array with the primary key values for all inserted records' do - items = described_class.valid_list(1) + items = bulk_insert_item_class.valid_list(1) - expect(described_class.bulk_insert!(items, returns: :ids)).to contain_exactly(a_kind_of(Integer)) + expect(bulk_insert_item_class.bulk_insert!(items, returns: :ids)).to contain_exactly(a_kind_of(Integer)) end end context 'when is set to nil' do it 'returns an empty array' do - items = described_class.valid_list(1) + items = bulk_insert_item_class.valid_list(1) - expect(described_class.bulk_insert!(items, returns: nil)).to eq([]) + expect(bulk_insert_item_class.bulk_insert!(items, returns: nil)).to eq([]) end end context 'when is set to anything else' do it 'raises an error' do - items = described_class.valid_list(1) + items = bulk_insert_item_class.valid_list(1) - expect { described_class.bulk_insert!([items], returns: [:id, :name]) } + expect { bulk_insert_item_class.bulk_insert!([items], returns: [:id, :name]) } .to raise_error(ArgumentError, "returns needs to be :ids or nil") end end @@ -167,20 +172,20 @@ describe BulkInsertSafe do end context 'when duplicate items are to be inserted' do - let!(:existing_object) { described_class.create!(name: 'duplicate', secret_value: 'old value') } - let(:new_object) { described_class.new(name: 'duplicate', secret_value: 'new value') } + let!(:existing_object) { bulk_insert_item_class.create!(name: 'duplicate', secret_value: 'old value') } + let(:new_object) { bulk_insert_item_class.new(name: 'duplicate', secret_value: 'new value') } describe '.bulk_insert!' do context 'when skip_duplicates is set to false' do it 'raises an exception' do - expect { described_class.bulk_insert!([new_object], skip_duplicates: false) } + expect { bulk_insert_item_class.bulk_insert!([new_object], skip_duplicates: false) } .to raise_error(ActiveRecord::RecordNotUnique) end end context 'when skip_duplicates is set to true' do it 'does not update existing object' do - described_class.bulk_insert!([new_object], skip_duplicates: true) + bulk_insert_item_class.bulk_insert!([new_object], skip_duplicates: true) expect(existing_object.reload.secret_value).to eq('old value') end @@ -189,7 +194,7 @@ describe BulkInsertSafe do describe '.bulk_upsert!' do it 'updates existing object' do - described_class.bulk_upsert!([new_object], unique_by: %w[name]) + bulk_insert_item_class.bulk_upsert!([new_object], unique_by: %w[name]) expect(existing_object.reload.secret_value).to eq('new value') end diff --git a/spec/models/concerns/bulk_insertable_associations_spec.rb b/spec/models/concerns/bulk_insertable_associations_spec.rb index 6359b2c57ef..5a40639e493 100644 --- a/spec/models/concerns/bulk_insertable_associations_spec.rb +++ b/spec/models/concerns/bulk_insertable_associations_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BulkInsertableAssociations do +RSpec.describe BulkInsertableAssociations do class BulkFoo < ApplicationRecord include BulkInsertSafe diff --git a/spec/models/concerns/cache_markdown_field_spec.rb b/spec/models/concerns/cache_markdown_field_spec.rb index c46ebcf324c..5f8c65e429e 100644 --- a/spec/models/concerns/cache_markdown_field_spec.rb +++ b/spec/models/concerns/cache_markdown_field_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CacheMarkdownField, :clean_gitlab_redis_cache do +RSpec.describe CacheMarkdownField, :clean_gitlab_redis_cache do let(:ar_class) do Class.new(ActiveRecord::Base) do self.table_name = 'issues' diff --git a/spec/models/concerns/cacheable_attributes_spec.rb b/spec/models/concerns/cacheable_attributes_spec.rb index 6694b2aba22..f2877bed9cf 100644 --- a/spec/models/concerns/cacheable_attributes_spec.rb +++ b/spec/models/concerns/cacheable_attributes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CacheableAttributes do +RSpec.describe CacheableAttributes do let(:minimal_test_class) do Class.new do include ActiveModel::Model diff --git a/spec/models/concerns/case_sensitivity_spec.rb b/spec/models/concerns/case_sensitivity_spec.rb index 9819f656f0d..521b47c63fd 100644 --- a/spec/models/concerns/case_sensitivity_spec.rb +++ b/spec/models/concerns/case_sensitivity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CaseSensitivity do +RSpec.describe CaseSensitivity do describe '.iwhere' do let(:connection) { ActiveRecord::Base.connection } let(:model) do diff --git a/spec/models/concerns/checksummable_spec.rb b/spec/models/concerns/checksummable_spec.rb index 017077bd297..b469b2e5c18 100644 --- a/spec/models/concerns/checksummable_spec.rb +++ b/spec/models/concerns/checksummable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Checksummable do +RSpec.describe Checksummable do describe ".hexdigest" do let(:fake_class) do Class.new do diff --git a/spec/models/concerns/chronic_duration_attribute_spec.rb b/spec/models/concerns/chronic_duration_attribute_spec.rb index e41d75568f7..e6dbf403b63 100644 --- a/spec/models/concerns/chronic_duration_attribute_spec.rb +++ b/spec/models/concerns/chronic_duration_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -shared_examples 'ChronicDurationAttribute reader' do +RSpec.shared_examples 'ChronicDurationAttribute reader' do it 'contains dynamically created reader method' do expect(subject.class).to be_public_method_defined(virtual_field) end @@ -22,7 +22,7 @@ shared_examples 'ChronicDurationAttribute reader' do end end -shared_examples 'ChronicDurationAttribute writer' do +RSpec.shared_examples 'ChronicDurationAttribute writer' do it 'contains dynamically created writer method' do expect(subject.class).to be_public_method_defined("#{virtual_field}=") end @@ -94,7 +94,7 @@ shared_examples 'ChronicDurationAttribute writer' do end end -describe 'ChronicDurationAttribute' do +RSpec.describe 'ChronicDurationAttribute' do context 'when default value is not set' do let(:source_field) {:maximum_timeout} let(:virtual_field) {:maximum_timeout_human_readable} @@ -118,7 +118,7 @@ describe 'ChronicDurationAttribute' do end end -describe 'ChronicDurationAttribute - reader' do +RSpec.describe 'ChronicDurationAttribute - reader' do let(:source_field) {:timeout} let(:virtual_field) {:timeout_human_readable} diff --git a/spec/models/concerns/ci/has_ref_spec.rb b/spec/models/concerns/ci/has_ref_spec.rb index b98f915018b..69f2fdb21e1 100644 --- a/spec/models/concerns/ci/has_ref_spec.rb +++ b/spec/models/concerns/ci/has_ref_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::HasRef do +RSpec.describe Ci::HasRef do describe '#branch?' do let(:build) { create(:ci_build) } diff --git a/spec/models/concerns/ci/has_status_spec.rb b/spec/models/concerns/ci/has_status_spec.rb index ae2eb17af43..fe46b63781d 100644 --- a/spec/models/concerns/ci/has_status_spec.rb +++ b/spec/models/concerns/ci/has_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::HasStatus do +RSpec.describe Ci::HasStatus do describe '.slow_composite_status' do using RSpec::Parameterized::TableSyntax diff --git a/spec/models/concerns/ci/has_variable_spec.rb b/spec/models/concerns/ci/has_variable_spec.rb index c132fe47c3c..b5390281064 100644 --- a/spec/models/concerns/ci/has_variable_spec.rb +++ b/spec/models/concerns/ci/has_variable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::HasVariable do +RSpec.describe Ci::HasVariable do subject { build(:ci_variable) } it { is_expected.to validate_presence_of(:key) } diff --git a/spec/models/concerns/ci/maskable_spec.rb b/spec/models/concerns/ci/maskable_spec.rb index 01861b39165..840a08b6060 100644 --- a/spec/models/concerns/ci/maskable_spec.rb +++ b/spec/models/concerns/ci/maskable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Ci::Maskable do +RSpec.describe Ci::Maskable do let(:variable) { build(:ci_variable) } describe 'masked value validations' do diff --git a/spec/models/concerns/delete_with_limit_spec.rb b/spec/models/concerns/delete_with_limit_spec.rb index 52085f970f3..0259a1ea4fb 100644 --- a/spec/models/concerns/delete_with_limit_spec.rb +++ b/spec/models/concerns/delete_with_limit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeleteWithLimit do +RSpec.describe DeleteWithLimit do describe '.delete_with_limit' do it 'deletes a limited amount of rows' do create_list(:web_hook_log, 4) diff --git a/spec/models/concerns/deployment_platform_spec.rb b/spec/models/concerns/deployment_platform_spec.rb index 9164c3a75c5..b5b7efa0c47 100644 --- a/spec/models/concerns/deployment_platform_spec.rb +++ b/spec/models/concerns/deployment_platform_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeploymentPlatform do +RSpec.describe DeploymentPlatform do let(:project) { create(:project) } describe '#deployment_platform' do diff --git a/spec/models/concerns/deprecated_assignee_spec.rb b/spec/models/concerns/deprecated_assignee_spec.rb index e394de0aa34..630d9ea601f 100644 --- a/spec/models/concerns/deprecated_assignee_spec.rb +++ b/spec/models/concerns/deprecated_assignee_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeprecatedAssignee do +RSpec.describe DeprecatedAssignee do let(:user) { create(:user) } describe '#assignee_id=' do diff --git a/spec/models/concerns/discussion_on_diff_spec.rb b/spec/models/concerns/discussion_on_diff_spec.rb index f091861bd41..dd5d422f12d 100644 --- a/spec/models/concerns/discussion_on_diff_spec.rb +++ b/spec/models/concerns/discussion_on_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiscussionOnDiff do +RSpec.describe DiscussionOnDiff do subject { create(:diff_note_on_merge_request, line_number: 18).to_discussion } describe "#truncated_diff_lines" do diff --git a/spec/models/concerns/each_batch_spec.rb b/spec/models/concerns/each_batch_spec.rb index ee3d9aea505..3c93c8a7a79 100644 --- a/spec/models/concerns/each_batch_spec.rb +++ b/spec/models/concerns/each_batch_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EachBatch do +RSpec.describe EachBatch do describe '.each_batch' do let(:model) do Class.new(ActiveRecord::Base) do diff --git a/spec/models/concerns/editable_spec.rb b/spec/models/concerns/editable_spec.rb index 4a4a3ca5687..1d26629d0aa 100644 --- a/spec/models/concerns/editable_spec.rb +++ b/spec/models/concerns/editable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Editable do +RSpec.describe Editable do describe '#edited?' do let(:issue) { create(:issue, last_edited_at: nil) } let(:edited_issue) { create(:issue, created_at: 3.days.ago, last_edited_at: 2.days.ago) } diff --git a/spec/models/concerns/expirable_spec.rb b/spec/models/concerns/expirable_spec.rb index f4f5eab5b86..b20d759fc3f 100644 --- a/spec/models/concerns/expirable_spec.rb +++ b/spec/models/concerns/expirable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Expirable do +RSpec.describe Expirable do describe 'ProjectMember' do let(:no_expire) { create(:project_member) } let(:expire_later) { create(:project_member, expires_at: Time.current + 6.days) } diff --git a/spec/models/concerns/faster_cache_keys_spec.rb b/spec/models/concerns/faster_cache_keys_spec.rb index 7830acbae3d..ab6e809b3f7 100644 --- a/spec/models/concerns/faster_cache_keys_spec.rb +++ b/spec/models/concerns/faster_cache_keys_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe FasterCacheKeys do +RSpec.describe FasterCacheKeys do describe '#cache_key' do it 'returns a String' do # We're using a fixed string here so it's easier to set an expectation for diff --git a/spec/models/concerns/featurable_spec.rb b/spec/models/concerns/featurable_spec.rb index 89720e3652c..cc01820cc97 100644 --- a/spec/models/concerns/featurable_spec.rb +++ b/spec/models/concerns/featurable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Featurable do +RSpec.describe Featurable do let_it_be(:user) { create(:user) } let(:project) { create(:project) } let(:feature_class) { subject.class } diff --git a/spec/models/concerns/feature_gate_spec.rb b/spec/models/concerns/feature_gate_spec.rb index 276d3d9e1d5..6106708a32d 100644 --- a/spec/models/concerns/feature_gate_spec.rb +++ b/spec/models/concerns/feature_gate_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe FeatureGate do +RSpec.describe FeatureGate do describe 'User' do describe '#flipper_id' do context 'when user is not persisted' do diff --git a/spec/models/concerns/from_union_spec.rb b/spec/models/concerns/from_union_spec.rb index 735e14b47ec..9819a6ec3de 100644 --- a/spec/models/concerns/from_union_spec.rb +++ b/spec/models/concerns/from_union_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe FromUnion do +RSpec.describe FromUnion do describe '.from_union' do let(:model) do Class.new(ActiveRecord::Base) do diff --git a/spec/models/concerns/group_descendant_spec.rb b/spec/models/concerns/group_descendant_spec.rb index 47419770d0f..b29fa910ee6 100644 --- a/spec/models/concerns/group_descendant_spec.rb +++ b/spec/models/concerns/group_descendant_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupDescendant do +RSpec.describe GroupDescendant do let(:parent) { create(:group) } let(:subgroup) { create(:group, parent: parent) } let(:subsub_group) { create(:group, parent: subgroup) } diff --git a/spec/models/concerns/has_environment_scope_spec.rb b/spec/models/concerns/has_environment_scope_spec.rb index a6e1ba59263..0cc997709c9 100644 --- a/spec/models/concerns/has_environment_scope_spec.rb +++ b/spec/models/concerns/has_environment_scope_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe HasEnvironmentScope do +RSpec.describe HasEnvironmentScope do subject { build(:ci_variable) } it { is_expected.to allow_value('*').for(:environment_scope) } diff --git a/spec/models/concerns/has_user_type_spec.rb b/spec/models/concerns/has_user_type_spec.rb index f12eee414f9..9496bb57b8b 100644 --- a/spec/models/concerns/has_user_type_spec.rb +++ b/spec/models/concerns/has_user_type_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe User do +RSpec.describe User do specify 'types consistency checks', :aggregate_failures do expect(described_class::USER_TYPES.keys) .to match_array(%w[human ghost alert_bot project_bot support_bot service_user visual_review_bot migration_bot]) diff --git a/spec/models/concerns/ignorable_columns_spec.rb b/spec/models/concerns/ignorable_columns_spec.rb index 018b1296c62..a5eff154a0b 100644 --- a/spec/models/concerns/ignorable_columns_spec.rb +++ b/spec/models/concerns/ignorable_columns_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IgnorableColumns do +RSpec.describe IgnorableColumns do let(:record_class) do Class.new(ApplicationRecord) do include IgnorableColumns diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 74ee7a87b7b..51da6ee0bbd 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Issuable do +RSpec.describe Issuable do include ProjectForksHelper let(:issuable_class) { Issue } diff --git a/spec/models/concerns/limitable_spec.rb b/spec/models/concerns/limitable_spec.rb index ca0a257be7a..753e2a8ee5e 100644 --- a/spec/models/concerns/limitable_spec.rb +++ b/spec/models/concerns/limitable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Limitable do +RSpec.describe Limitable do let(:minimal_test_class) do Class.new do include ActiveModel::Model diff --git a/spec/models/concerns/loaded_in_group_list_spec.rb b/spec/models/concerns/loaded_in_group_list_spec.rb index 509811822e0..c37943022ba 100644 --- a/spec/models/concerns/loaded_in_group_list_spec.rb +++ b/spec/models/concerns/loaded_in_group_list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LoadedInGroupList do +RSpec.describe LoadedInGroupList do let(:parent) { create(:group) } subject(:found_group) { Group.with_selects_for_list.find_by(id: parent.id) } diff --git a/spec/models/concerns/manual_inverse_association_spec.rb b/spec/models/concerns/manual_inverse_association_spec.rb index ee32e3b165b..1349d2cc680 100644 --- a/spec/models/concerns/manual_inverse_association_spec.rb +++ b/spec/models/concerns/manual_inverse_association_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ManualInverseAssociation do +RSpec.describe ManualInverseAssociation do let(:model) do Class.new(MergeRequest) do belongs_to :manual_association, class_name: 'MergeRequestDiff', foreign_key: :latest_merge_request_diff_id diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb index 03fd1c69654..758b5aa2ce4 100644 --- a/spec/models/concerns/mentionable_spec.rb +++ b/spec/models/concerns/mentionable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Mentionable do +RSpec.describe Mentionable do before do stub_const('Example', Class.new) Example.class_eval do @@ -67,7 +67,7 @@ describe Mentionable do end end -describe Issue, "Mentionable" do +RSpec.describe Issue, "Mentionable" do describe '#mentioned_users' do let!(:user) { create(:user, username: 'stranger') } let!(:user2) { create(:user, username: 'john') } @@ -222,7 +222,7 @@ describe Issue, "Mentionable" do end end -describe Commit, 'Mentionable' do +RSpec.describe Commit, 'Mentionable' do let(:project) { create(:project, :public, :repository) } let(:commit) { project.commit } @@ -291,7 +291,7 @@ describe Commit, 'Mentionable' do end end -describe MergeRequest, 'Mentionable' do +RSpec.describe MergeRequest, 'Mentionable' do describe '#store_mentions!' do it_behaves_like 'mentions in description', :merge_request it_behaves_like 'mentions in notes', :merge_request do @@ -312,7 +312,7 @@ describe MergeRequest, 'Mentionable' do end end -describe Snippet, 'Mentionable' do +RSpec.describe Snippet, 'Mentionable' do describe '#store_mentions!' do it_behaves_like 'mentions in description', :project_snippet it_behaves_like 'mentions in notes', :project_snippet do @@ -329,7 +329,7 @@ describe Snippet, 'Mentionable' do end end -describe PersonalSnippet, 'Mentionable' do +RSpec.describe PersonalSnippet, 'Mentionable' do describe '#store_mentions!' do it_behaves_like 'mentions in description', :personal_snippet it_behaves_like 'mentions in notes', :personal_snippet do @@ -346,7 +346,7 @@ describe PersonalSnippet, 'Mentionable' do end end -describe DesignManagement::Design do +RSpec.describe DesignManagement::Design do describe '#store_mentions!' do it_behaves_like 'mentions in notes', :design do let(:note) { create(:diff_note_on_design) } diff --git a/spec/models/concerns/milestoneable_spec.rb b/spec/models/concerns/milestoneable_spec.rb index 0b19c0542ee..15352a1453c 100644 --- a/spec/models/concerns/milestoneable_spec.rb +++ b/spec/models/concerns/milestoneable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Milestoneable do +RSpec.describe Milestoneable do let(:user) { create(:user) } let(:milestone) { create(:milestone, project: project) } diff --git a/spec/models/concerns/milestoneish_spec.rb b/spec/models/concerns/milestoneish_spec.rb index 8c43a12aa15..58cd054efd5 100644 --- a/spec/models/concerns/milestoneish_spec.rb +++ b/spec/models/concerns/milestoneish_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Milestone, 'Milestoneish' do +RSpec.describe Milestone, 'Milestoneish' do let(:author) { create(:user) } let(:assignee) { create(:user) } let(:non_member) { create(:user) } diff --git a/spec/models/concerns/noteable_spec.rb b/spec/models/concerns/noteable_spec.rb index 3fdd707420f..bb7374bf46c 100644 --- a/spec/models/concerns/noteable_spec.rb +++ b/spec/models/concerns/noteable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Noteable do +RSpec.describe Noteable do let!(:active_diff_note1) { create(:diff_note_on_merge_request) } let(:project) { active_diff_note1.project } subject { active_diff_note1.noteable } diff --git a/spec/models/concerns/optionally_search_spec.rb b/spec/models/concerns/optionally_search_spec.rb index e1eb4cf8cd2..c8e2e6da51f 100644 --- a/spec/models/concerns/optionally_search_spec.rb +++ b/spec/models/concerns/optionally_search_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OptionallySearch do +RSpec.describe OptionallySearch do describe '.search' do let(:model) do Class.new do diff --git a/spec/models/concerns/participable_spec.rb b/spec/models/concerns/participable_spec.rb index 3d5937c4fc6..3376e337dc9 100644 --- a/spec/models/concerns/participable_spec.rb +++ b/spec/models/concerns/participable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Participable do +RSpec.describe Participable do let(:model) do Class.new do include Participable diff --git a/spec/models/concerns/presentable_spec.rb b/spec/models/concerns/presentable_spec.rb index 9db868dd348..871e122e409 100644 --- a/spec/models/concerns/presentable_spec.rb +++ b/spec/models/concerns/presentable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Presentable do +RSpec.describe Presentable do let(:build) { Ci::Build.new } describe '#present' do diff --git a/spec/models/concerns/project_api_compatibility_spec.rb b/spec/models/concerns/project_api_compatibility_spec.rb index f5722f88aac..7a69406cb71 100644 --- a/spec/models/concerns/project_api_compatibility_spec.rb +++ b/spec/models/concerns/project_api_compatibility_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectAPICompatibility do +RSpec.describe ProjectAPICompatibility do let(:project) { create(:project) } # git_strategy diff --git a/spec/models/concerns/project_features_compatibility_spec.rb b/spec/models/concerns/project_features_compatibility_spec.rb index 8346c4ad4cc..ba70ff563a8 100644 --- a/spec/models/concerns/project_features_compatibility_spec.rb +++ b/spec/models/concerns/project_features_compatibility_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectFeaturesCompatibility do +RSpec.describe ProjectFeaturesCompatibility do let(:project) { create(:project) } let(:features_enabled) { %w(issues wiki builds merge_requests snippets) } let(:features) { features_enabled + %w(repository pages) } diff --git a/spec/models/concerns/prometheus_adapter_spec.rb b/spec/models/concerns/prometheus_adapter_spec.rb index fdc98ba74b8..e795e2b06cb 100644 --- a/spec/models/concerns/prometheus_adapter_spec.rb +++ b/spec/models/concerns/prometheus_adapter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PrometheusAdapter, :use_clean_rails_memory_store_caching do +RSpec.describe PrometheusAdapter, :use_clean_rails_memory_store_caching do include PrometheusHelpers include ReactiveCachingHelpers diff --git a/spec/models/concerns/protected_ref_access_spec.rb b/spec/models/concerns/protected_ref_access_spec.rb index f63ad958ed3..750a5eba303 100644 --- a/spec/models/concerns/protected_ref_access_spec.rb +++ b/spec/models/concerns/protected_ref_access_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProtectedRefAccess do +RSpec.describe ProtectedRefAccess do include ExternalAuthorizationServiceHelpers subject(:protected_ref_access) do diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb index c7427da7368..425dc70e7a1 100644 --- a/spec/models/concerns/reactive_caching_spec.rb +++ b/spec/models/concerns/reactive_caching_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ReactiveCaching, :use_clean_rails_memory_store_caching do +RSpec.describe ReactiveCaching, :use_clean_rails_memory_store_caching do include ExclusiveLeaseHelpers include ReactiveCachingHelpers diff --git a/spec/models/concerns/redactable_spec.rb b/spec/models/concerns/redactable_spec.rb index 3f6a2e2410c..bb59e04adf1 100644 --- a/spec/models/concerns/redactable_spec.rb +++ b/spec/models/concerns/redactable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Redactable do +RSpec.describe Redactable do before do stub_commonmark_sourcepos_disabled end diff --git a/spec/models/concerns/redis_cacheable_spec.rb b/spec/models/concerns/redis_cacheable_spec.rb index 1cf6afcc167..c270f23defb 100644 --- a/spec/models/concerns/redis_cacheable_spec.rb +++ b/spec/models/concerns/redis_cacheable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RedisCacheable do +RSpec.describe RedisCacheable do let(:model) do Struct.new(:id, :attributes) do def read_attribute(attribute) diff --git a/spec/models/concerns/resolvable_discussion_spec.rb b/spec/models/concerns/resolvable_discussion_spec.rb index 95553fb13a6..c91ddfee944 100644 --- a/spec/models/concerns/resolvable_discussion_spec.rb +++ b/spec/models/concerns/resolvable_discussion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Discussion, ResolvableDiscussion do +RSpec.describe Discussion, ResolvableDiscussion do subject { described_class.new([first_note, second_note, third_note]) } let(:first_note) { create(:discussion_note_on_merge_request) } diff --git a/spec/models/concerns/resolvable_note_spec.rb b/spec/models/concerns/resolvable_note_spec.rb index 12e50ac807e..69c58a5cfe5 100644 --- a/spec/models/concerns/resolvable_note_spec.rb +++ b/spec/models/concerns/resolvable_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Note, ResolvableNote do +RSpec.describe Note, ResolvableNote do let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } diff --git a/spec/models/concerns/routable_spec.rb b/spec/models/concerns/routable_spec.rb index c891fdcb6b5..15d754861b2 100644 --- a/spec/models/concerns/routable_spec.rb +++ b/spec/models/concerns/routable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Group, 'Routable' do +RSpec.describe Group, 'Routable' do let!(:group) { create(:group, name: 'foo') } describe 'Validations' do @@ -164,7 +164,7 @@ describe Group, 'Routable' do end end -describe Project, 'Routable' do +RSpec.describe Project, 'Routable' do describe '#full_path' do let(:project) { build_stubbed(:project) } diff --git a/spec/models/concerns/safe_url_spec.rb b/spec/models/concerns/safe_url_spec.rb index e523e6a15e4..3d38c05bf11 100644 --- a/spec/models/concerns/safe_url_spec.rb +++ b/spec/models/concerns/safe_url_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SafeUrl do +RSpec.describe SafeUrl do describe '#safe_url' do let(:safe_url_test_class) do Class.new do diff --git a/spec/models/concerns/schedulable_spec.rb b/spec/models/concerns/schedulable_spec.rb index 38ae2112e01..875c2d80e55 100644 --- a/spec/models/concerns/schedulable_spec.rb +++ b/spec/models/concerns/schedulable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Schedulable do +RSpec.describe Schedulable do shared_examples 'before_save callback' do it 'updates next_run_at' do expect { object.save! }.to change { object.next_run_at } diff --git a/spec/models/concerns/sha256_attribute_spec.rb b/spec/models/concerns/sha256_attribute_spec.rb index 213723c2dcb..c247865d77f 100644 --- a/spec/models/concerns/sha256_attribute_spec.rb +++ b/spec/models/concerns/sha256_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sha256Attribute do +RSpec.describe Sha256Attribute do let(:model) { Class.new { include Sha256Attribute } } before do diff --git a/spec/models/concerns/sha_attribute_spec.rb b/spec/models/concerns/sha_attribute_spec.rb index 0d4dbfb215e..50748efcda4 100644 --- a/spec/models/concerns/sha_attribute_spec.rb +++ b/spec/models/concerns/sha_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ShaAttribute do +RSpec.describe ShaAttribute do let(:model) { Class.new { include ShaAttribute } } before do diff --git a/spec/models/concerns/sortable_spec.rb b/spec/models/concerns/sortable_spec.rb index a1fe5c0928d..bbfdaeec64c 100644 --- a/spec/models/concerns/sortable_spec.rb +++ b/spec/models/concerns/sortable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Sortable do +RSpec.describe Sortable do describe '.order_by' do let(:arel_table) { Group.arel_table } let(:relation) { Group.all } diff --git a/spec/models/concerns/spammable_spec.rb b/spec/models/concerns/spammable_spec.rb index a8d27e174b7..d4fcb2e99eb 100644 --- a/spec/models/concerns/spammable_spec.rb +++ b/spec/models/concerns/spammable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Spammable do +RSpec.describe Spammable do let(:issue) { create(:issue, description: 'Test Desc.') } describe 'Associations' do diff --git a/spec/models/concerns/stepable_spec.rb b/spec/models/concerns/stepable_spec.rb index 51356c3eaf6..e442e4f0664 100644 --- a/spec/models/concerns/stepable_spec.rb +++ b/spec/models/concerns/stepable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Stepable do +RSpec.describe Stepable do let(:described_class) do Class.new do include Stepable diff --git a/spec/models/concerns/strip_attribute_spec.rb b/spec/models/concerns/strip_attribute_spec.rb index 5c0d1042e06..812f0a015f7 100644 --- a/spec/models/concerns/strip_attribute_spec.rb +++ b/spec/models/concerns/strip_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe StripAttribute do +RSpec.describe StripAttribute do let(:milestone) { create(:milestone) } describe ".strip_attributes" do diff --git a/spec/models/concerns/subscribable_spec.rb b/spec/models/concerns/subscribable_spec.rb index f189cd7633c..2a43e748e58 100644 --- a/spec/models/concerns/subscribable_spec.rb +++ b/spec/models/concerns/subscribable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Subscribable, 'Subscribable' do +RSpec.describe Subscribable, 'Subscribable' do let(:project) { create(:project) } let(:resource) { create(:issue, project: project) } let(:user_1) { create(:user) } diff --git a/spec/models/concerns/token_authenticatable_spec.rb b/spec/models/concerns/token_authenticatable_spec.rb index 36eb8fdaba4..e0e764fc63c 100644 --- a/spec/models/concerns/token_authenticatable_spec.rb +++ b/spec/models/concerns/token_authenticatable_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -shared_examples 'TokenAuthenticatable' do +RSpec.shared_examples 'TokenAuthenticatable' do describe 'dynamically defined methods' do it { expect(described_class).to respond_to("find_by_#{token_field}") } it { is_expected.to respond_to("ensure_#{token_field}") } @@ -11,7 +11,7 @@ shared_examples 'TokenAuthenticatable' do end end -describe User, 'TokenAuthenticatable' do +RSpec.describe User, 'TokenAuthenticatable' do let(:token_field) { :feed_token } it_behaves_like 'TokenAuthenticatable' @@ -23,7 +23,7 @@ describe User, 'TokenAuthenticatable' do end end -describe ApplicationSetting, 'TokenAuthenticatable' do +RSpec.describe ApplicationSetting, 'TokenAuthenticatable' do let(:token_field) { :runners_registration_token } let(:settings) { described_class.new } @@ -100,7 +100,7 @@ describe ApplicationSetting, 'TokenAuthenticatable' do end end -describe PersonalAccessToken, 'TokenAuthenticatable' do +RSpec.describe PersonalAccessToken, 'TokenAuthenticatable' do shared_examples 'changes personal access token' do it 'sets new token' do subject @@ -205,7 +205,7 @@ describe PersonalAccessToken, 'TokenAuthenticatable' do end end -describe Ci::Build, 'TokenAuthenticatable' do +RSpec.describe Ci::Build, 'TokenAuthenticatable' do let(:token_field) { :token } let(:build) { FactoryBot.build(:ci_build) } diff --git a/spec/models/concerns/token_authenticatable_strategies/base_spec.rb b/spec/models/concerns/token_authenticatable_strategies/base_spec.rb index 7332da309d5..bccef9b9554 100644 --- a/spec/models/concerns/token_authenticatable_strategies/base_spec.rb +++ b/spec/models/concerns/token_authenticatable_strategies/base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe TokenAuthenticatableStrategies::Base do +RSpec.describe TokenAuthenticatableStrategies::Base do let(:instance) { double(:instance) } let(:field) { double(:field) } diff --git a/spec/models/concerns/token_authenticatable_strategies/encrypted_spec.rb b/spec/models/concerns/token_authenticatable_strategies/encrypted_spec.rb index 70f41981b3b..f6b8cf7def4 100644 --- a/spec/models/concerns/token_authenticatable_strategies/encrypted_spec.rb +++ b/spec/models/concerns/token_authenticatable_strategies/encrypted_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe TokenAuthenticatableStrategies::Encrypted do +RSpec.describe TokenAuthenticatableStrategies::Encrypted do let(:model) { double(:model) } let(:instance) { double(:instance) } diff --git a/spec/models/concerns/uniquify_spec.rb b/spec/models/concerns/uniquify_spec.rb index 9ba35702ba6..9b79e4d4154 100644 --- a/spec/models/concerns/uniquify_spec.rb +++ b/spec/models/concerns/uniquify_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Uniquify do +RSpec.describe Uniquify do let(:uniquify) { described_class.new } describe "#string" do diff --git a/spec/models/concerns/usage_statistics_spec.rb b/spec/models/concerns/usage_statistics_spec.rb index f99f0a13317..15ccd08eda9 100644 --- a/spec/models/concerns/usage_statistics_spec.rb +++ b/spec/models/concerns/usage_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe UsageStatistics do +RSpec.describe UsageStatistics do describe '.distinct_count_by' do let_it_be(:issue_1) { create(:issue) } let_it_be(:issue_2) { create(:issue) } diff --git a/spec/models/concerns/where_composite_spec.rb b/spec/models/concerns/where_composite_spec.rb index 1c0951d90d0..fb23e6bfe1d 100644 --- a/spec/models/concerns/where_composite_spec.rb +++ b/spec/models/concerns/where_composite_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe WhereComposite do +RSpec.describe WhereComposite do describe '.where_composite' do let_it_be(:test_table_name) { "test_table_#{SecureRandom.hex(10)}" } diff --git a/spec/models/concerns/x509_serial_number_attribute_spec.rb b/spec/models/concerns/x509_serial_number_attribute_spec.rb index 18a1d85204c..88550823748 100644 --- a/spec/models/concerns/x509_serial_number_attribute_spec.rb +++ b/spec/models/concerns/x509_serial_number_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe X509SerialNumberAttribute do +RSpec.describe X509SerialNumberAttribute do let(:model) { Class.new { include X509SerialNumberAttribute } } before do diff --git a/spec/models/container_registry/event_spec.rb b/spec/models/container_registry/event_spec.rb index 54ff218f2a8..21a3ab5363a 100644 --- a/spec/models/container_registry/event_spec.rb +++ b/spec/models/container_registry/event_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ContainerRegistry::Event do +RSpec.describe ContainerRegistry::Event do using RSpec::Parameterized::TableSyntax let_it_be(:group) { create(:group, name: 'group') } diff --git a/spec/models/container_repository_spec.rb b/spec/models/container_repository_spec.rb index 4f23a905e93..953f92d103b 100644 --- a/spec/models/container_repository_spec.rb +++ b/spec/models/container_repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ContainerRepository do +RSpec.describe ContainerRepository do let(:group) { create(:group, name: 'group') } let(:project) { create(:project, path: 'test', group: group) } diff --git a/spec/models/cycle_analytics/code_spec.rb b/spec/models/cycle_analytics/code_spec.rb index f6ab8e0ece6..8900c49a662 100644 --- a/spec/models/cycle_analytics/code_spec.rb +++ b/spec/models/cycle_analytics/code_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#code' do +RSpec.describe 'CycleAnalytics#code' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/issue_spec.rb b/spec/models/cycle_analytics/issue_spec.rb index b4ab763e0e6..9372ef5f0e6 100644 --- a/spec/models/cycle_analytics/issue_spec.rb +++ b/spec/models/cycle_analytics/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#issue' do +RSpec.describe 'CycleAnalytics#issue' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/plan_spec.rb b/spec/models/cycle_analytics/plan_spec.rb index 6765b2e2cbc..364694a11e1 100644 --- a/spec/models/cycle_analytics/plan_spec.rb +++ b/spec/models/cycle_analytics/plan_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#plan' do +RSpec.describe 'CycleAnalytics#plan' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/production_spec.rb b/spec/models/cycle_analytics/production_spec.rb index 2f2bcd63acd..cf4d57d6b73 100644 --- a/spec/models/cycle_analytics/production_spec.rb +++ b/spec/models/cycle_analytics/production_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#production' do +RSpec.describe 'CycleAnalytics#production' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/project_level_spec.rb b/spec/models/cycle_analytics/project_level_spec.rb index bb296351a29..c2d421c03d8 100644 --- a/spec/models/cycle_analytics/project_level_spec.rb +++ b/spec/models/cycle_analytics/project_level_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CycleAnalytics::ProjectLevel do +RSpec.describe CycleAnalytics::ProjectLevel do let_it_be(:project) { create(:project, :repository) } let_it_be(:from_date) { 10.days.ago } let_it_be(:user) { project.owner } diff --git a/spec/models/cycle_analytics/review_spec.rb b/spec/models/cycle_analytics/review_spec.rb index 25e8f1441d3..6ebbcebd71d 100644 --- a/spec/models/cycle_analytics/review_spec.rb +++ b/spec/models/cycle_analytics/review_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#review' do +RSpec.describe 'CycleAnalytics#review' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/staging_spec.rb b/spec/models/cycle_analytics/staging_spec.rb index effbc7056cc..024625d229f 100644 --- a/spec/models/cycle_analytics/staging_spec.rb +++ b/spec/models/cycle_analytics/staging_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#staging' do +RSpec.describe 'CycleAnalytics#staging' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/test_spec.rb b/spec/models/cycle_analytics/test_spec.rb index 7e7ba4d9994..7010d69f8a4 100644 --- a/spec/models/cycle_analytics/test_spec.rb +++ b/spec/models/cycle_analytics/test_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe 'CycleAnalytics#test' do +RSpec.describe 'CycleAnalytics#test' do extend CycleAnalyticsHelpers::TestGeneration let_it_be(:project) { create(:project, :repository) } diff --git a/spec/models/deploy_key_spec.rb b/spec/models/deploy_key_spec.rb index ec6cfb6b826..00114a94b56 100644 --- a/spec/models/deploy_key_spec.rb +++ b/spec/models/deploy_key_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeployKey, :mailer do +RSpec.describe DeployKey, :mailer do describe "Associations" do it { is_expected.to have_many(:deploy_keys_projects) } it { is_expected.to have_many(:projects) } diff --git a/spec/models/deploy_keys_project_spec.rb b/spec/models/deploy_keys_project_spec.rb index 1dbae78a01d..ccc2c64e02c 100644 --- a/spec/models/deploy_keys_project_spec.rb +++ b/spec/models/deploy_keys_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeployKeysProject do +RSpec.describe DeployKeysProject do describe "Associations" do it { is_expected.to belong_to(:deploy_key) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/deploy_token_spec.rb b/spec/models/deploy_token_spec.rb index 819e2850644..9fd3751be13 100644 --- a/spec/models/deploy_token_spec.rb +++ b/spec/models/deploy_token_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeployToken do +RSpec.describe DeployToken do subject(:deploy_token) { create(:deploy_token) } it { is_expected.to have_many :project_deploy_tokens } diff --git a/spec/models/deployment_cluster_spec.rb b/spec/models/deployment_cluster_spec.rb index 8bb09e9a510..dc9cbe4b082 100644 --- a/spec/models/deployment_cluster_spec.rb +++ b/spec/models/deployment_cluster_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeploymentCluster do +RSpec.describe DeploymentCluster do let(:cluster) { create(:cluster) } let(:deployment) { create(:deployment) } let(:kubernetes_namespace) { 'an-example-namespace' } diff --git a/spec/models/deployment_merge_request_spec.rb b/spec/models/deployment_merge_request_spec.rb index fd5be52d47c..29834691fa4 100644 --- a/spec/models/deployment_merge_request_spec.rb +++ b/spec/models/deployment_merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeploymentMergeRequest do +RSpec.describe DeploymentMergeRequest do let(:mr) { create(:merge_request, :merged) } let(:deployment) { create(:deployment, :success, project: project) } let(:project) { mr.project } diff --git a/spec/models/deployment_metrics_spec.rb b/spec/models/deployment_metrics_spec.rb index 5a4ae0bbe79..d0474777eb7 100644 --- a/spec/models/deployment_metrics_spec.rb +++ b/spec/models/deployment_metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DeploymentMetrics do +RSpec.describe DeploymentMetrics do describe '#has_metrics?' do subject { described_class.new(deployment.project, deployment).has_metrics? } diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb index ac2a4c9877d..b320390711e 100644 --- a/spec/models/deployment_spec.rb +++ b/spec/models/deployment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Deployment do +RSpec.describe Deployment do subject { build(:deployment) } it { is_expected.to belong_to(:project).required } diff --git a/spec/models/description_version_spec.rb b/spec/models/description_version_spec.rb index 5ec34c0cde4..7c094f7a0a0 100644 --- a/spec/models/description_version_spec.rb +++ b/spec/models/description_version_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DescriptionVersion do +RSpec.describe DescriptionVersion do describe 'associations' do it { is_expected.to belong_to :issue } it { is_expected.to belong_to :merge_request } diff --git a/spec/models/design_management/action_spec.rb b/spec/models/design_management/action_spec.rb index 753c31b1549..59c58191718 100644 --- a/spec/models/design_management/action_spec.rb +++ b/spec/models/design_management/action_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe DesignManagement::Action do +RSpec.describe DesignManagement::Action do describe 'relations' do it { is_expected.to belong_to(:design) } it { is_expected.to belong_to(:version) } diff --git a/spec/models/design_management/design_action_spec.rb b/spec/models/design_management/design_action_spec.rb index da4ad41dfcb..958b1dd9124 100644 --- a/spec/models/design_management/design_action_spec.rb +++ b/spec/models/design_management/design_action_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe DesignManagement::DesignAction do +RSpec.describe DesignManagement::DesignAction do describe 'validations' do describe 'the design' do let(:fail_validation) { raise_error(/design/i) } diff --git a/spec/models/design_management/design_at_version_spec.rb b/spec/models/design_management/design_at_version_spec.rb index f6fa8df243c..2c640ee5c2c 100644 --- a/spec/models/design_management/design_at_version_spec.rb +++ b/spec/models/design_management/design_at_version_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DesignManagement::DesignAtVersion do +RSpec.describe DesignManagement::DesignAtVersion do include DesignManagementTestHelpers let_it_be(:issue, reload: true) { create(:issue) } diff --git a/spec/models/design_management/design_collection_spec.rb b/spec/models/design_management/design_collection_spec.rb index bd48f742042..c5e290da759 100644 --- a/spec/models/design_management/design_collection_spec.rb +++ b/spec/models/design_management/design_collection_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe DesignManagement::DesignCollection do +RSpec.describe DesignManagement::DesignCollection do include DesignManagementTestHelpers let_it_be(:issue, reload: true) { create(:issue) } diff --git a/spec/models/design_management/design_spec.rb b/spec/models/design_management/design_spec.rb index bc1f54f057e..345147390c0 100644 --- a/spec/models/design_management/design_spec.rb +++ b/spec/models/design_management/design_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DesignManagement::Design do +RSpec.describe DesignManagement::Design do include DesignManagementTestHelpers let_it_be(:issue) { create(:issue) } diff --git a/spec/models/design_management/repository_spec.rb b/spec/models/design_management/repository_spec.rb index 996316eeec9..0115e0c139c 100644 --- a/spec/models/design_management/repository_spec.rb +++ b/spec/models/design_management/repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DesignManagement::Repository do +RSpec.describe DesignManagement::Repository do let(:project) { create(:project) } let(:repository) { described_class.new(project) } diff --git a/spec/models/design_management/version_spec.rb b/spec/models/design_management/version_spec.rb index ab6958ea94a..cd52f4129dc 100644 --- a/spec/models/design_management/version_spec.rb +++ b/spec/models/design_management/version_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe DesignManagement::Version do +RSpec.describe DesignManagement::Version do let_it_be(:issue) { create(:issue) } describe 'relations' do diff --git a/spec/models/design_user_mention_spec.rb b/spec/models/design_user_mention_spec.rb index 03c77c73c8d..944a82c5edf 100644 --- a/spec/models/design_user_mention_spec.rb +++ b/spec/models/design_user_mention_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DesignUserMention do +RSpec.describe DesignUserMention do describe 'associations' do it { is_expected.to belong_to(:design) } it { is_expected.to belong_to(:note) } diff --git a/spec/models/dev_ops_score/metric_spec.rb b/spec/models/dev_ops_score/metric_spec.rb index 89212d5ca26..60001d0667d 100644 --- a/spec/models/dev_ops_score/metric_spec.rb +++ b/spec/models/dev_ops_score/metric_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DevOpsScore::Metric do +RSpec.describe DevOpsScore::Metric do let(:conv_dev_index) { create(:dev_ops_score_metric) } describe '#percentage_score' do diff --git a/spec/models/diff_discussion_spec.rb b/spec/models/diff_discussion_spec.rb index cfeb4382927..26b311fe629 100644 --- a/spec/models/diff_discussion_spec.rb +++ b/spec/models/diff_discussion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiffDiscussion do +RSpec.describe DiffDiscussion do include RepoHelpers subject { described_class.new([diff_note]) } diff --git a/spec/models/diff_note_position_spec.rb b/spec/models/diff_note_position_spec.rb index d93e0af5526..aa9e6b4e824 100644 --- a/spec/models/diff_note_position_spec.rb +++ b/spec/models/diff_note_position_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiffNotePosition, type: :model do +RSpec.describe DiffNotePosition, type: :model do describe '.create_or_update_by' do context 'when a diff note' do let(:note) { create(:diff_note_on_merge_request) } diff --git a/spec/models/diff_note_spec.rb b/spec/models/diff_note_spec.rb index 8bfe2ac7a6c..8a6176bf045 100644 --- a/spec/models/diff_note_spec.rb +++ b/spec/models/diff_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiffNote do +RSpec.describe DiffNote do include RepoHelpers let_it_be(:merge_request) { create(:merge_request) } diff --git a/spec/models/diff_viewer/base_spec.rb b/spec/models/diff_viewer/base_spec.rb index 0a1c4c5560e..57c62788ee9 100644 --- a/spec/models/diff_viewer/base_spec.rb +++ b/spec/models/diff_viewer/base_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiffViewer::Base do +RSpec.describe DiffViewer::Base do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/diff_viewer/server_side_spec.rb b/spec/models/diff_viewer/server_side_spec.rb index 0a14eae26f3..686dd1249be 100644 --- a/spec/models/diff_viewer/server_side_spec.rb +++ b/spec/models/diff_viewer/server_side_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DiffViewer::ServerSide do +RSpec.describe DiffViewer::ServerSide do let_it_be(:project) { create(:project, :repository) } let(:commit) { project.commit_by(oid: '570e7b2abdd848b95f2f578043fc23bd6f6fd24d') } let!(:diff_file) { commit.diffs.diff_file_with_new_path('files/ruby/popen.rb') } diff --git a/spec/models/discussion_spec.rb b/spec/models/discussion_spec.rb index 950bdec4d00..021940be0c2 100644 --- a/spec/models/discussion_spec.rb +++ b/spec/models/discussion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Discussion do +RSpec.describe Discussion do subject { described_class.new([first_note, second_note, third_note]) } let(:first_note) { create(:diff_note_on_merge_request) } diff --git a/spec/models/draft_note_spec.rb b/spec/models/draft_note_spec.rb index b880d3c5b97..64b06bf5c8f 100644 --- a/spec/models/draft_note_spec.rb +++ b/spec/models/draft_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DraftNote do +RSpec.describe DraftNote do include RepoHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/email_spec.rb b/spec/models/email_spec.rb index f7b194abcee..ffdc621dd4c 100644 --- a/spec/models/email_spec.rb +++ b/spec/models/email_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Email do +RSpec.describe Email do describe 'modules' do subject { described_class } diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index 303ae3b8edd..6cbb8a0a1c8 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Environment, :use_clean_rails_memory_store_caching do +RSpec.describe Environment, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers using RSpec::Parameterized::TableSyntax include RepoHelpers diff --git a/spec/models/environment_status_spec.rb b/spec/models/environment_status_spec.rb index 10283b54796..7eefb8f714a 100644 --- a/spec/models/environment_status_spec.rb +++ b/spec/models/environment_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EnvironmentStatus do +RSpec.describe EnvironmentStatus do include ProjectForksHelper let(:deployment) { create(:deployment, :succeed, :review_app) } diff --git a/spec/models/error_tracking/project_error_tracking_setting_spec.rb b/spec/models/error_tracking/project_error_tracking_setting_spec.rb index b564c48a9c1..72ed11f6c74 100644 --- a/spec/models/error_tracking/project_error_tracking_setting_spec.rb +++ b/spec/models/error_tracking/project_error_tracking_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ErrorTracking::ProjectErrorTrackingSetting do +RSpec.describe ErrorTracking::ProjectErrorTrackingSetting do include ReactiveCachingHelpers include Gitlab::Routing diff --git a/spec/models/event_collection_spec.rb b/spec/models/event_collection_spec.rb index 17cf328f852..cf95a8f8d32 100644 --- a/spec/models/event_collection_spec.rb +++ b/spec/models/event_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EventCollection do +RSpec.describe EventCollection do include DesignManagementTestHelpers describe '#to_a' do diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 14066b1e9d2..51929c02c2f 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Event do +RSpec.describe Event do describe "Associations" do it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:target) } diff --git a/spec/models/external_issue_spec.rb b/spec/models/external_issue_spec.rb index b8d85d49b07..47b13ff50cf 100644 --- a/spec/models/external_issue_spec.rb +++ b/spec/models/external_issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ExternalIssue do +RSpec.describe ExternalIssue do let(:project) { double('project', id: 1, to_reference: 'namespace1/project1') } let(:issue) { described_class.new('EXT-1234', project) } diff --git a/spec/models/external_pull_request_spec.rb b/spec/models/external_pull_request_spec.rb index e85d5b2f6c7..e0822fc177a 100644 --- a/spec/models/external_pull_request_spec.rb +++ b/spec/models/external_pull_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ExternalPullRequest do +RSpec.describe ExternalPullRequest do let(:project) { create(:project) } let(:source_branch) { 'the-branch' } let(:status) { :open } diff --git a/spec/models/fork_network_member_spec.rb b/spec/models/fork_network_member_spec.rb index d7a0dd5be65..b34eb7964ca 100644 --- a/spec/models/fork_network_member_spec.rb +++ b/spec/models/fork_network_member_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ForkNetworkMember do +RSpec.describe ForkNetworkMember do describe 'validations' do it { is_expected.to validate_presence_of(:project) } it { is_expected.to validate_presence_of(:fork_network) } diff --git a/spec/models/fork_network_spec.rb b/spec/models/fork_network_spec.rb index 5ec0f8d6b02..c2ef1fdcb5f 100644 --- a/spec/models/fork_network_spec.rb +++ b/spec/models/fork_network_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ForkNetwork do +RSpec.describe ForkNetwork do include ProjectForksHelper describe '#add_root_as_member' do diff --git a/spec/models/generic_commit_status_spec.rb b/spec/models/generic_commit_status_spec.rb index c8ed898122b..6fe5a1407a9 100644 --- a/spec/models/generic_commit_status_spec.rb +++ b/spec/models/generic_commit_status_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GenericCommitStatus do +RSpec.describe GenericCommitStatus do let(:project) { create(:project) } let(:pipeline) { create(:ci_pipeline, project: project) } let(:external_url) { 'http://example.gitlab.com/status' } diff --git a/spec/models/gpg_key_spec.rb b/spec/models/gpg_key_spec.rb index b9c914e2506..7ecde04e3df 100644 --- a/spec/models/gpg_key_spec.rb +++ b/spec/models/gpg_key_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GpgKey do +RSpec.describe GpgKey do describe "associations" do it { is_expected.to belong_to(:user) } it { is_expected.to have_many(:subkeys) } diff --git a/spec/models/gpg_key_subkey_spec.rb b/spec/models/gpg_key_subkey_spec.rb index 5f80cc02924..c1d9e2bde43 100644 --- a/spec/models/gpg_key_subkey_spec.rb +++ b/spec/models/gpg_key_subkey_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GpgKeySubkey do +RSpec.describe GpgKeySubkey do subject { build(:gpg_key_subkey) } describe 'associations' do diff --git a/spec/models/grafana_integration_spec.rb b/spec/models/grafana_integration_spec.rb index 662e8b1dd61..79f102919ac 100644 --- a/spec/models/grafana_integration_spec.rb +++ b/spec/models/grafana_integration_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GrafanaIntegration do +RSpec.describe GrafanaIntegration do describe 'associations' do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/group_custom_attribute_spec.rb b/spec/models/group_custom_attribute_spec.rb index 7d60c74b62b..1d8afa71377 100644 --- a/spec/models/group_custom_attribute_spec.rb +++ b/spec/models/group_custom_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupCustomAttribute do +RSpec.describe GroupCustomAttribute do describe 'assocations' do it { is_expected.to belong_to(:group) } end diff --git a/spec/models/group_group_link_spec.rb b/spec/models/group_group_link_spec.rb index 54e622b2f22..03cc9d7e64c 100644 --- a/spec/models/group_group_link_spec.rb +++ b/spec/models/group_group_link_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupGroupLink do +RSpec.describe GroupGroupLink do let_it_be(:group) { create(:group) } let_it_be(:shared_group) { create(:group) } let_it_be(:group_group_link) do diff --git a/spec/models/group_label_spec.rb b/spec/models/group_label_spec.rb index a3a5c631c3d..ec9244d5eb5 100644 --- a/spec/models/group_label_spec.rb +++ b/spec/models/group_label_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupLabel do +RSpec.describe GroupLabel do describe 'relationships' do it { is_expected.to belong_to(:group) } end diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 93cb6d83489..da1bf026f60 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Group do +RSpec.describe Group do let!(:group) { create(:group) } describe 'associations' do diff --git a/spec/models/guest_spec.rb b/spec/models/guest_spec.rb index 57eb077031c..975b64cb855 100644 --- a/spec/models/guest_spec.rb +++ b/spec/models/guest_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Guest do +RSpec.describe Guest do let_it_be(:public_project, reload: true) { create(:project, :public) } let_it_be(:private_project) { create(:project, :private) } let_it_be(:internal_project) { create(:project, :internal) } diff --git a/spec/models/hooks/active_hook_filter_spec.rb b/spec/models/hooks/active_hook_filter_spec.rb index 1249c793f7f..1f693ce9fde 100644 --- a/spec/models/hooks/active_hook_filter_spec.rb +++ b/spec/models/hooks/active_hook_filter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ActiveHookFilter do +RSpec.describe ActiveHookFilter do subject(:filter) { described_class.new(hook) } describe '#matches?' do diff --git a/spec/models/hooks/project_hook_spec.rb b/spec/models/hooks/project_hook_spec.rb index ccf8171049d..69fbc4c3b4f 100644 --- a/spec/models/hooks/project_hook_spec.rb +++ b/spec/models/hooks/project_hook_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectHook do +RSpec.describe ProjectHook do describe 'associations' do it { is_expected.to belong_to :project } end diff --git a/spec/models/hooks/service_hook_spec.rb b/spec/models/hooks/service_hook_spec.rb index 936c2fbad27..f7045d7ac5e 100644 --- a/spec/models/hooks/service_hook_spec.rb +++ b/spec/models/hooks/service_hook_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ServiceHook do +RSpec.describe ServiceHook do describe 'associations' do it { is_expected.to belong_to :service } end diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb index 2e836c19e3c..e56d08c1847 100644 --- a/spec/models/hooks/system_hook_spec.rb +++ b/spec/models/hooks/system_hook_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe SystemHook do +RSpec.describe SystemHook do context 'default attributes' do let(:system_hook) { build(:system_hook) } diff --git a/spec/models/hooks/web_hook_log_spec.rb b/spec/models/hooks/web_hook_log_spec.rb index 128601794cf..8dd9cf9e84a 100644 --- a/spec/models/hooks/web_hook_log_spec.rb +++ b/spec/models/hooks/web_hook_log_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe WebHookLog do +RSpec.describe WebHookLog do it { is_expected.to belong_to(:web_hook) } it { is_expected.to serialize(:request_headers).as(Hash) } diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb index 025c11d6407..3fc1ad6eb0d 100644 --- a/spec/models/hooks/web_hook_spec.rb +++ b/spec/models/hooks/web_hook_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe WebHook do +RSpec.describe WebHook do let(:hook) { build(:project_hook) } describe 'associations' do diff --git a/spec/models/identity_spec.rb b/spec/models/identity_spec.rb index 9f120775a3c..696d33b7beb 100644 --- a/spec/models/identity_spec.rb +++ b/spec/models/identity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Identity do +RSpec.describe Identity do describe 'relations' do it { is_expected.to belong_to(:user) } end diff --git a/spec/models/import_export_upload_spec.rb b/spec/models/import_export_upload_spec.rb index 18a714f4d98..46a611852ab 100644 --- a/spec/models/import_export_upload_spec.rb +++ b/spec/models/import_export_upload_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ImportExportUpload do +RSpec.describe ImportExportUpload do subject { described_class.new(project: create(:project)) } shared_examples 'stores the Import/Export file' do |method| diff --git a/spec/models/import_failure_spec.rb b/spec/models/import_failure_spec.rb index d286a4ad314..cdef125e890 100644 --- a/spec/models/import_failure_spec.rb +++ b/spec/models/import_failure_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ImportFailure do +RSpec.describe ImportFailure do describe 'Scopes' do let_it_be(:project) { create(:project) } let_it_be(:correlation_id) { 'ABC' } diff --git a/spec/models/incident_management/project_incident_management_setting_spec.rb b/spec/models/incident_management/project_incident_management_setting_spec.rb index ac3f97e2d89..aa85d7845c7 100644 --- a/spec/models/incident_management/project_incident_management_setting_spec.rb +++ b/spec/models/incident_management/project_incident_management_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IncidentManagement::ProjectIncidentManagementSetting do +RSpec.describe IncidentManagement::ProjectIncidentManagementSetting do let_it_be(:project) { create(:project, :repository, create_templates: :issue) } describe 'Associations' do diff --git a/spec/models/instance_configuration_spec.rb b/spec/models/instance_configuration_spec.rb index 747e9dc2faa..383e548c324 100644 --- a/spec/models/instance_configuration_spec.rb +++ b/spec/models/instance_configuration_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe InstanceConfiguration do +RSpec.describe InstanceConfiguration do context 'without cache' do describe '#settings' do describe '#ssh_algorithms_hashes' do diff --git a/spec/models/internal_id_spec.rb b/spec/models/internal_id_spec.rb index 0dfb59cf43a..751e8724872 100644 --- a/spec/models/internal_id_spec.rb +++ b/spec/models/internal_id_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe InternalId do +RSpec.describe InternalId do let(:project) { create(:project) } let(:usage) { :issues } let(:issue) { build(:issue, project: project) } diff --git a/spec/models/issue/metrics_spec.rb b/spec/models/issue/metrics_spec.rb index dc22d26e2f9..966e4321378 100644 --- a/spec/models/issue/metrics_spec.rb +++ b/spec/models/issue/metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Issue::Metrics do +RSpec.describe Issue::Metrics do let(:project) { create(:project) } subject { create(:issue, project: project) } diff --git a/spec/models/issue_collection_spec.rb b/spec/models/issue_collection_spec.rb index 7fc635f100f..d67bd8debce 100644 --- a/spec/models/issue_collection_spec.rb +++ b/spec/models/issue_collection_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IssueCollection do +RSpec.describe IssueCollection do let(:user) { create(:user) } let(:project) { create(:project) } let(:issue1) { create(:issue, project: project) } diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 291cccd72db..4221b5e5f7a 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Issue do +RSpec.describe Issue do include ExternalAuthorizationServiceHelpers describe "Associations" do diff --git a/spec/models/iteration_spec.rb b/spec/models/iteration_spec.rb index ae14adf9106..2ffbad92809 100644 --- a/spec/models/iteration_spec.rb +++ b/spec/models/iteration_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Iteration do +RSpec.describe Iteration do let_it_be(:project) { create(:project) } let_it_be(:group) { create(:group) } diff --git a/spec/models/jira_import_state_spec.rb b/spec/models/jira_import_state_spec.rb index d2535636c63..e982b7353ba 100644 --- a/spec/models/jira_import_state_spec.rb +++ b/spec/models/jira_import_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe JiraImportState do +RSpec.describe JiraImportState do describe "associations" do it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:user) } diff --git a/spec/models/key_spec.rb b/spec/models/key_spec.rb index 8cdedbcdedf..1e14864676c 100644 --- a/spec/models/key_spec.rb +++ b/spec/models/key_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Key, :mailer do +RSpec.describe Key, :mailer do describe "Associations" do it { is_expected.to belong_to(:user) } end diff --git a/spec/models/label_link_spec.rb b/spec/models/label_link_spec.rb index 7a179dcb419..a95481f3083 100644 --- a/spec/models/label_link_spec.rb +++ b/spec/models/label_link_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LabelLink do +RSpec.describe LabelLink do it { expect(build(:label_link)).to be_valid } it { is_expected.to belong_to(:label) } diff --git a/spec/models/label_note_spec.rb b/spec/models/label_note_spec.rb index 34560acfa9e..0bf202ce2b1 100644 --- a/spec/models/label_note_spec.rb +++ b/spec/models/label_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LabelNote do +RSpec.describe LabelNote do let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user) } let_it_be(:label) { create(:label, project: project) } diff --git a/spec/models/label_priority_spec.rb b/spec/models/label_priority_spec.rb index 1a93468290f..db961d5a4e6 100644 --- a/spec/models/label_priority_spec.rb +++ b/spec/models/label_priority_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LabelPriority do +RSpec.describe LabelPriority do describe 'relationships' do it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:label) } diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb index dc878c2d3c0..e1abfd9d8e5 100644 --- a/spec/models/label_spec.rb +++ b/spec/models/label_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Label do +RSpec.describe Label do describe 'modules' do it { is_expected.to include_module(Referable) } it { is_expected.to include_module(Subscribable) } diff --git a/spec/models/legacy_diff_discussion_spec.rb b/spec/models/legacy_diff_discussion_spec.rb index 49ea319fbd1..4f90fe7d7f0 100644 --- a/spec/models/legacy_diff_discussion_spec.rb +++ b/spec/models/legacy_diff_discussion_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LegacyDiffDiscussion do +RSpec.describe LegacyDiffDiscussion do subject { create(:legacy_diff_note_on_merge_request).to_discussion } describe '#reply_attributes' do diff --git a/spec/models/lfs_download_object_spec.rb b/spec/models/lfs_download_object_spec.rb index d7522fbb969..d1c323cd177 100644 --- a/spec/models/lfs_download_object_spec.rb +++ b/spec/models/lfs_download_object_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LfsDownloadObject do +RSpec.describe LfsDownloadObject do let(:oid) { 'cd293be6cea034bd45a0352775a219ef5dc7825ce55d1f7dae9762d80ce64411' } let(:link) { 'http://www.example.com' } let(:size) { 1 } diff --git a/spec/models/lfs_file_lock_spec.rb b/spec/models/lfs_file_lock_spec.rb index 0a47ded43fb..d3f79c7c7cf 100644 --- a/spec/models/lfs_file_lock_spec.rb +++ b/spec/models/lfs_file_lock_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LfsFileLock do +RSpec.describe LfsFileLock do let_it_be(:lfs_file_lock, reload: true) { create(:lfs_file_lock) } subject { lfs_file_lock } diff --git a/spec/models/lfs_object_spec.rb b/spec/models/lfs_object_spec.rb index 09a64dabb08..36d45f17392 100644 --- a/spec/models/lfs_object_spec.rb +++ b/spec/models/lfs_object_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LfsObject do +RSpec.describe LfsObject do context 'scopes' do describe '.not_existing_in_project' do it 'contains only lfs objects not linked to the project' do diff --git a/spec/models/lfs_objects_project_spec.rb b/spec/models/lfs_objects_project_spec.rb index 31300828a43..71009a6f28f 100644 --- a/spec/models/lfs_objects_project_spec.rb +++ b/spec/models/lfs_objects_project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LfsObjectsProject do +RSpec.describe LfsObjectsProject do let_it_be(:project) { create(:project) } subject do diff --git a/spec/models/license_template_spec.rb b/spec/models/license_template_spec.rb index 7037277e580..515f728f515 100644 --- a/spec/models/license_template_spec.rb +++ b/spec/models/license_template_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe LicenseTemplate do +RSpec.describe LicenseTemplate do describe '#content' do it 'calls a proc exactly once if provided' do content_proc = -> { 'bar' } diff --git a/spec/models/list_spec.rb b/spec/models/list_spec.rb index bc9124e73af..37158584062 100644 --- a/spec/models/list_spec.rb +++ b/spec/models/list_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe List do +RSpec.describe List do it_behaves_like 'having unique enum values' describe 'relationships' do diff --git a/spec/models/list_user_preference_spec.rb b/spec/models/list_user_preference_spec.rb index 10a7bf41f4e..fde0481e301 100644 --- a/spec/models/list_user_preference_spec.rb +++ b/spec/models/list_user_preference_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ListUserPreference do +RSpec.describe ListUserPreference do let_it_be(:user) { create(:user) } let_it_be(:list) { create(:list) } diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 7c40bb24b56..6cb35fd1be8 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Member do +RSpec.describe Member do include ExclusiveLeaseHelpers using RSpec::Parameterized::TableSyntax diff --git a/spec/models/members/group_member_spec.rb b/spec/models/members/group_member_spec.rb index fdb71b7ec7d..94091d5268e 100644 --- a/spec/models/members/group_member_spec.rb +++ b/spec/models/members/group_member_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GroupMember do +RSpec.describe GroupMember do context 'scopes' do shared_examples '.count_users_by_group_id' do it 'counts users by group ID' do diff --git a/spec/models/members/project_member_spec.rb b/spec/models/members/project_member_spec.rb index fdb9457b211..f25f8933184 100644 --- a/spec/models/members/project_member_spec.rb +++ b/spec/models/members/project_member_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectMember do +RSpec.describe ProjectMember do describe 'associations' do it { is_expected.to belong_to(:project).with_foreign_key(:source_id) } end diff --git a/spec/models/merge_request/metrics_spec.rb b/spec/models/merge_request/metrics_spec.rb index bd97cabc11e..4d9e768ecc6 100644 --- a/spec/models/merge_request/metrics_spec.rb +++ b/spec/models/merge_request/metrics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequest::Metrics do +RSpec.describe MergeRequest::Metrics do describe 'associations' do it { is_expected.to belong_to(:merge_request) } it { is_expected.to belong_to(:latest_closed_by).class_name('User') } diff --git a/spec/models/merge_request_assignee_spec.rb b/spec/models/merge_request_assignee_spec.rb index bd2df428ed0..d287392bf7f 100644 --- a/spec/models/merge_request_assignee_spec.rb +++ b/spec/models/merge_request_assignee_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequestAssignee do +RSpec.describe MergeRequestAssignee do let(:merge_request) { create(:merge_request) } subject { merge_request.merge_request_assignees.build(assignee: create(:user)) } diff --git a/spec/models/merge_request_context_commit_diff_file_spec.rb b/spec/models/merge_request_context_commit_diff_file_spec.rb index 37d44662326..7a098639b57 100644 --- a/spec/models/merge_request_context_commit_diff_file_spec.rb +++ b/spec/models/merge_request_context_commit_diff_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequestContextCommitDiffFile do +RSpec.describe MergeRequestContextCommitDiffFile do describe 'associations' do it { is_expected.to belong_to(:merge_request_context_commit) } end diff --git a/spec/models/merge_request_context_commit_spec.rb b/spec/models/merge_request_context_commit_spec.rb index 5a1bf9874ac..29ef2fab9ad 100644 --- a/spec/models/merge_request_context_commit_spec.rb +++ b/spec/models/merge_request_context_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequestContextCommit do +RSpec.describe MergeRequestContextCommit do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.project } let(:raw_repository) { project.repository.raw_repository } diff --git a/spec/models/merge_request_diff_commit_spec.rb b/spec/models/merge_request_diff_commit_spec.rb index 62430b08c5c..5ea0145e60f 100644 --- a/spec/models/merge_request_diff_commit_spec.rb +++ b/spec/models/merge_request_diff_commit_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequestDiffCommit do +RSpec.describe MergeRequestDiffCommit do let(:merge_request) { create(:merge_request) } let(:project) { merge_request.project } diff --git a/spec/models/merge_request_diff_file_spec.rb b/spec/models/merge_request_diff_file_spec.rb index 40f7be5dc8f..25971f63338 100644 --- a/spec/models/merge_request_diff_file_spec.rb +++ b/spec/models/merge_request_diff_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequestDiffFile do +RSpec.describe MergeRequestDiffFile do it_behaves_like 'a BulkInsertSafe model', MergeRequestDiffFile do let(:valid_items_for_bulk_insertion) { build_list(:merge_request_diff_file, 10) } let(:invalid_items_for_bulk_insertion) { [] } # class does not have any validations defined diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 0839dde696a..550c29f75ff 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequestDiff do +RSpec.describe MergeRequestDiff do using RSpec::Parameterized::TableSyntax include RepoHelpers diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 031b0688c7b..3e743da41e3 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MergeRequest do +RSpec.describe MergeRequest do include RepoHelpers include ProjectForksHelper include ReactiveCachingHelpers diff --git a/spec/models/metrics/dashboard/annotation_spec.rb b/spec/models/metrics/dashboard/annotation_spec.rb index 3cba31ffdfe..bd4baeb8851 100644 --- a/spec/models/metrics/dashboard/annotation_spec.rb +++ b/spec/models/metrics/dashboard/annotation_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Metrics::Dashboard::Annotation do +RSpec.describe Metrics::Dashboard::Annotation do using RSpec::Parameterized::TableSyntax describe 'associations' do diff --git a/spec/models/metrics/users_starred_dashboard_spec.rb b/spec/models/metrics/users_starred_dashboard_spec.rb index 6cb14ae569e..c89344c0a1c 100644 --- a/spec/models/metrics/users_starred_dashboard_spec.rb +++ b/spec/models/metrics/users_starred_dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Metrics::UsersStarredDashboard do +RSpec.describe Metrics::UsersStarredDashboard do describe 'associations' do it { is_expected.to belong_to(:project).inverse_of(:metrics_users_starred_dashboards) } it { is_expected.to belong_to(:user).inverse_of(:metrics_users_starred_dashboards) } diff --git a/spec/models/milestone_note_spec.rb b/spec/models/milestone_note_spec.rb index aad65cf0346..058272dd5ec 100644 --- a/spec/models/milestone_note_spec.rb +++ b/spec/models/milestone_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MilestoneNote do +RSpec.describe MilestoneNote do describe '.from_event' do let(:author) { create(:user) } let(:project) { create(:project, :repository) } diff --git a/spec/models/milestone_release_spec.rb b/spec/models/milestone_release_spec.rb index 28cec7bbc17..3c781545d8a 100644 --- a/spec/models/milestone_release_spec.rb +++ b/spec/models/milestone_release_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MilestoneRelease do +RSpec.describe MilestoneRelease do let(:project) { create(:project) } let(:release) { create(:release, project: project) } let(:milestone) { create(:milestone, project: project) } diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 33f84da27f6..b52b035e130 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Milestone do +RSpec.describe Milestone do it_behaves_like 'a timebox', :milestone describe 'MilestoneStruct#serializable_hash' do diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb index ed7ef8b2b8e..c090c6834d1 100644 --- a/spec/models/namespace_spec.rb +++ b/spec/models/namespace_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Namespace do +RSpec.describe Namespace do include ProjectForksHelper include GitHelpers diff --git a/spec/models/network/graph_spec.rb b/spec/models/network/graph_spec.rb index 232172fde76..a393aace39c 100644 --- a/spec/models/network/graph_spec.rb +++ b/spec/models/network/graph_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Network::Graph do +RSpec.describe Network::Graph do let(:project) { create(:project, :repository) } let!(:note_on_commit) { create(:note_on_commit, project: project) } diff --git a/spec/models/note_diff_file_spec.rb b/spec/models/note_diff_file_spec.rb index 11108016b8e..1ece1dfea59 100644 --- a/spec/models/note_diff_file_spec.rb +++ b/spec/models/note_diff_file_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe NoteDiffFile do +RSpec.describe NoteDiffFile do describe 'associations' do it { is_expected.to belong_to(:diff_note) } end diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index af3fdcfaa2e..e6e6a8c35cf 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Note do +RSpec.describe Note do include RepoHelpers describe 'associations' do diff --git a/spec/models/notification_recipient_spec.rb b/spec/models/notification_recipient_spec.rb index 05aeafaa4d4..8429f577dc6 100644 --- a/spec/models/notification_recipient_spec.rb +++ b/spec/models/notification_recipient_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe NotificationRecipient do +RSpec.describe NotificationRecipient do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let(:target) { create(:issue, project: project) } diff --git a/spec/models/oauth_access_grant_spec.rb b/spec/models/oauth_access_grant_spec.rb index 955dae906f3..ca67944752d 100644 --- a/spec/models/oauth_access_grant_spec.rb +++ b/spec/models/oauth_access_grant_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OauthAccessGrant do +RSpec.describe OauthAccessGrant do let(:user) { create(:user) } let(:application) { create(:oauth_application, owner: user) } diff --git a/spec/models/oauth_access_token_spec.rb b/spec/models/oauth_access_token_spec.rb index 0a1c576a5e7..65a7f6410cf 100644 --- a/spec/models/oauth_access_token_spec.rb +++ b/spec/models/oauth_access_token_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OauthAccessToken do +RSpec.describe OauthAccessToken do let(:user) { create(:user) } let(:app_one) { create(:oauth_application) } let(:app_two) { create(:oauth_application) } diff --git a/spec/models/pages/lookup_path_spec.rb b/spec/models/pages/lookup_path_spec.rb index c05d4c82634..38bd9b39a56 100644 --- a/spec/models/pages/lookup_path_spec.rb +++ b/spec/models/pages/lookup_path_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Pages::LookupPath do +RSpec.describe Pages::LookupPath do let(:project) do instance_double(Project, id: 12345, diff --git a/spec/models/pages/virtual_domain_spec.rb b/spec/models/pages/virtual_domain_spec.rb index a5310738482..38f5f4d2538 100644 --- a/spec/models/pages/virtual_domain_spec.rb +++ b/spec/models/pages/virtual_domain_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Pages::VirtualDomain do +RSpec.describe Pages::VirtualDomain do describe '#certificate and #key pair' do let(:domain) { nil } let(:project) { instance_double(Project) } diff --git a/spec/models/pages_domain_acme_order_spec.rb b/spec/models/pages_domain_acme_order_spec.rb index 4ffb4fc7389..4a104203e39 100644 --- a/spec/models/pages_domain_acme_order_spec.rb +++ b/spec/models/pages_domain_acme_order_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PagesDomainAcmeOrder do +RSpec.describe PagesDomainAcmeOrder do using RSpec::Parameterized::TableSyntax describe '.expired' do diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb index fc7694530d0..d283389e29e 100644 --- a/spec/models/pages_domain_spec.rb +++ b/spec/models/pages_domain_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PagesDomain do +RSpec.describe PagesDomain do using RSpec::Parameterized::TableSyntax subject(:pages_domain) { described_class.new } diff --git a/spec/models/performance_monitoring/prometheus_dashboard_spec.rb b/spec/models/performance_monitoring/prometheus_dashboard_spec.rb index a56903e51fd..61174a7d0c5 100644 --- a/spec/models/performance_monitoring/prometheus_dashboard_spec.rb +++ b/spec/models/performance_monitoring/prometheus_dashboard_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusDashboard do +RSpec.describe PerformanceMonitoring::PrometheusDashboard do let(:json_content) do { "dashboard" => "Dashboard Title", diff --git a/spec/models/performance_monitoring/prometheus_metric_spec.rb b/spec/models/performance_monitoring/prometheus_metric_spec.rb index 83f687aa90e..b5b9cd58aa8 100644 --- a/spec/models/performance_monitoring/prometheus_metric_spec.rb +++ b/spec/models/performance_monitoring/prometheus_metric_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusMetric do +RSpec.describe PerformanceMonitoring::PrometheusMetric do let(:json_content) do { "id" => "metric_of_ages", diff --git a/spec/models/performance_monitoring/prometheus_panel_group_spec.rb b/spec/models/performance_monitoring/prometheus_panel_group_spec.rb index ecf7e13a9a3..9e92cb27954 100644 --- a/spec/models/performance_monitoring/prometheus_panel_group_spec.rb +++ b/spec/models/performance_monitoring/prometheus_panel_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusPanelGroup do +RSpec.describe PerformanceMonitoring::PrometheusPanelGroup do let(:json_content) do { "group" => "Group Title", diff --git a/spec/models/performance_monitoring/prometheus_panel_spec.rb b/spec/models/performance_monitoring/prometheus_panel_spec.rb index 127b9e8183a..c5c6b1fdafd 100644 --- a/spec/models/performance_monitoring/prometheus_panel_spec.rb +++ b/spec/models/performance_monitoring/prometheus_panel_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PerformanceMonitoring::PrometheusPanel do +RSpec.describe PerformanceMonitoring::PrometheusPanel do let(:json_content) do { "max_value" => 1, diff --git a/spec/models/personal_access_token_spec.rb b/spec/models/personal_access_token_spec.rb index 6fe4bb443a4..b9cb5477c54 100644 --- a/spec/models/personal_access_token_spec.rb +++ b/spec/models/personal_access_token_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PersonalAccessToken do +RSpec.describe PersonalAccessToken do subject { described_class } describe '.build' do diff --git a/spec/models/personal_snippet_spec.rb b/spec/models/personal_snippet_spec.rb index fb96d6e8bc3..10d70fed1ee 100644 --- a/spec/models/personal_snippet_spec.rb +++ b/spec/models/personal_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PersonalSnippet do +RSpec.describe PersonalSnippet do describe '#embeddable?' do [ { snippet: :public, embeddable: true }, diff --git a/spec/models/plan_limits_spec.rb b/spec/models/plan_limits_spec.rb index 1366f088623..0eecdfc643e 100644 --- a/spec/models/plan_limits_spec.rb +++ b/spec/models/plan_limits_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PlanLimits do +RSpec.describe PlanLimits do let(:plan_limits) { create(:plan_limits) } let(:model) { ProjectHook } let(:count) { model.count } diff --git a/spec/models/plan_spec.rb b/spec/models/plan_spec.rb index ad055e20af1..490c6b1bbf7 100644 --- a/spec/models/plan_spec.rb +++ b/spec/models/plan_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Plan do +RSpec.describe Plan do describe '#default?' do subject { plan.default? } diff --git a/spec/models/pool_repository_spec.rb b/spec/models/pool_repository_spec.rb index ae00f9df89e..92b3e41cd18 100644 --- a/spec/models/pool_repository_spec.rb +++ b/spec/models/pool_repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PoolRepository do +RSpec.describe PoolRepository do describe 'associations' do it { is_expected.to belong_to(:shard) } it { is_expected.to belong_to(:source_project) } diff --git a/spec/models/postgresql/replication_slot_spec.rb b/spec/models/postgresql/replication_slot_spec.rb index d435fccc09a..02a4d783b84 100644 --- a/spec/models/postgresql/replication_slot_spec.rb +++ b/spec/models/postgresql/replication_slot_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Postgresql::ReplicationSlot do +RSpec.describe Postgresql::ReplicationSlot do describe '.in_use?' do it 'returns true when replication slots are present' do expect(described_class).to receive(:exists?).and_return(true) diff --git a/spec/models/programming_language_spec.rb b/spec/models/programming_language_spec.rb index b327d360461..f2201eabd1c 100644 --- a/spec/models/programming_language_spec.rb +++ b/spec/models/programming_language_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProgrammingLanguage do +RSpec.describe ProgrammingLanguage do it { is_expected.to respond_to(:name) } it { is_expected.to respond_to(:color) } diff --git a/spec/models/project_authorization_spec.rb b/spec/models/project_authorization_spec.rb index 6f06fe4e55a..c517fc8be55 100644 --- a/spec/models/project_authorization_spec.rb +++ b/spec/models/project_authorization_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectAuthorization do +RSpec.describe ProjectAuthorization do let(:user) { create(:user) } let(:project1) { create(:project) } let(:project2) { create(:project) } diff --git a/spec/models/project_auto_devops_spec.rb b/spec/models/project_auto_devops_spec.rb index 5af25ac1437..8313879114f 100644 --- a/spec/models/project_auto_devops_spec.rb +++ b/spec/models/project_auto_devops_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectAutoDevops do +RSpec.describe ProjectAutoDevops do let_it_be(:project) { build(:project) } it_behaves_like 'having unique enum values' diff --git a/spec/models/project_ci_cd_setting_spec.rb b/spec/models/project_ci_cd_setting_spec.rb index ecca371ce4e..698465e854a 100644 --- a/spec/models/project_ci_cd_setting_spec.rb +++ b/spec/models/project_ci_cd_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectCiCdSetting do +RSpec.describe ProjectCiCdSetting do describe 'validations' do it 'validates default_git_depth is between 0 and 1000 or nil' do expect(subject).to validate_numericality_of(:default_git_depth) diff --git a/spec/models/project_custom_attribute_spec.rb b/spec/models/project_custom_attribute_spec.rb index 80638676b49..25ee1e60819 100644 --- a/spec/models/project_custom_attribute_spec.rb +++ b/spec/models/project_custom_attribute_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectCustomAttribute do +RSpec.describe ProjectCustomAttribute do describe 'assocations' do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/project_daily_statistic_spec.rb b/spec/models/project_daily_statistic_spec.rb index 86210af15d8..8dbabdb3829 100644 --- a/spec/models/project_daily_statistic_spec.rb +++ b/spec/models/project_daily_statistic_spec.rb @@ -2,6 +2,6 @@ require 'spec_helper' -describe ProjectDailyStatistic do +RSpec.describe ProjectDailyStatistic do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/project_export_job_spec.rb b/spec/models/project_export_job_spec.rb index dc39d0e401d..5a2b1443f8b 100644 --- a/spec/models/project_export_job_spec.rb +++ b/spec/models/project_export_job_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectExportJob, type: :model do +RSpec.describe ProjectExportJob, type: :model do let(:project) { create(:project) } let!(:job1) { create(:project_export_job, project: project, status: 0) } let!(:job2) { create(:project_export_job, project: project, status: 2) } diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb index e33ea75bc5d..c927c8fd1f9 100644 --- a/spec/models/project_feature_spec.rb +++ b/spec/models/project_feature_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectFeature do +RSpec.describe ProjectFeature do using RSpec::Parameterized::TableSyntax let(:project) { create(:project) } diff --git a/spec/models/project_group_link_spec.rb b/spec/models/project_group_link_spec.rb index 8ef29e8a876..c925d87170c 100644 --- a/spec/models/project_group_link_spec.rb +++ b/spec/models/project_group_link_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectGroupLink do +RSpec.describe ProjectGroupLink do describe "Associations" do it { is_expected.to belong_to(:group) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/project_import_data_spec.rb b/spec/models/project_import_data_spec.rb index fe47811f074..50a2ee42084 100644 --- a/spec/models/project_import_data_spec.rb +++ b/spec/models/project_import_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectImportData do +RSpec.describe ProjectImportData do describe '#merge_data' do it 'writes the Hash to the attribute if it is nil' do row = described_class.new diff --git a/spec/models/project_import_state_spec.rb b/spec/models/project_import_state_spec.rb index f3b83c036b5..6a0402d43a8 100644 --- a/spec/models/project_import_state_spec.rb +++ b/spec/models/project_import_state_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectImportState, type: :model do +RSpec.describe ProjectImportState, type: :model do let_it_be(:correlation_id) { 'cid' } let_it_be(:import_state, refind: true) { create(:import_state, correlation_id_value: correlation_id) } diff --git a/spec/models/project_label_spec.rb b/spec/models/project_label_spec.rb index 330aab9f856..f451c2905e6 100644 --- a/spec/models/project_label_spec.rb +++ b/spec/models/project_label_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectLabel do +RSpec.describe ProjectLabel do describe 'relationships' do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/project_metrics_setting_spec.rb b/spec/models/project_metrics_setting_spec.rb index adfbbbc3a45..6639f9cb208 100644 --- a/spec/models/project_metrics_setting_spec.rb +++ b/spec/models/project_metrics_setting_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectMetricsSetting do +RSpec.describe ProjectMetricsSetting do describe 'Associations' do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/project_repository_spec.rb b/spec/models/project_repository_spec.rb index c966447fedc..6852ca0097d 100644 --- a/spec/models/project_repository_spec.rb +++ b/spec/models/project_repository_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectRepository do +RSpec.describe ProjectRepository do describe 'associations' do it { is_expected.to belong_to(:shard) } it { is_expected.to belong_to(:project) } diff --git a/spec/models/project_services/alerts_service_spec.rb b/spec/models/project_services/alerts_service_spec.rb index 4e63ece26d8..db25885c76a 100644 --- a/spec/models/project_services/alerts_service_spec.rb +++ b/spec/models/project_services/alerts_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AlertsService do +RSpec.describe AlertsService do let_it_be(:project) { create(:project) } let(:service_params) { { project: project, active: active } } let(:active) { true } diff --git a/spec/models/project_services/asana_service_spec.rb b/spec/models/project_services/asana_service_spec.rb index 8b6f2888c0a..7a6fe4b1537 100644 --- a/spec/models/project_services/asana_service_spec.rb +++ b/spec/models/project_services/asana_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AsanaService do +RSpec.describe AsanaService do describe 'Associations' do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/assembla_service_spec.rb b/spec/models/project_services/assembla_service_spec.rb index 2c86c0ec7be..207add6f090 100644 --- a/spec/models/project_services/assembla_service_spec.rb +++ b/spec/models/project_services/assembla_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe AssemblaService do +RSpec.describe AssemblaService do include StubRequests describe "Associations" do diff --git a/spec/models/project_services/bamboo_service_spec.rb b/spec/models/project_services/bamboo_service_spec.rb index c1efa3a4348..4d2474cc56a 100644 --- a/spec/models/project_services/bamboo_service_spec.rb +++ b/spec/models/project_services/bamboo_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BambooService, :use_clean_rails_memory_store_caching do +RSpec.describe BambooService, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers include StubRequests diff --git a/spec/models/project_services/bugzilla_service_spec.rb b/spec/models/project_services/bugzilla_service_spec.rb index 6818db48fee..560c7c3ee83 100644 --- a/spec/models/project_services/bugzilla_service_spec.rb +++ b/spec/models/project_services/bugzilla_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BugzillaService do +RSpec.describe BugzillaService do describe 'Associations' do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/buildkite_service_spec.rb b/spec/models/project_services/buildkite_service_spec.rb index 8b6fa36eaa5..ff717a59e7b 100644 --- a/spec/models/project_services/buildkite_service_spec.rb +++ b/spec/models/project_services/buildkite_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe BuildkiteService, :use_clean_rails_memory_store_caching do +RSpec.describe BuildkiteService, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers include StubRequests diff --git a/spec/models/project_services/campfire_service_spec.rb b/spec/models/project_services/campfire_service_spec.rb index 0d3dd89e93b..ea3990b339b 100644 --- a/spec/models/project_services/campfire_service_spec.rb +++ b/spec/models/project_services/campfire_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CampfireService do +RSpec.describe CampfireService do include StubRequests describe 'Associations' do diff --git a/spec/models/project_services/chat_message/base_message_spec.rb b/spec/models/project_services/chat_message/base_message_spec.rb index 8f80cf0b074..a7ddf230758 100644 --- a/spec/models/project_services/chat_message/base_message_spec.rb +++ b/spec/models/project_services/chat_message/base_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::BaseMessage do +RSpec.describe ChatMessage::BaseMessage do let(:base_message) { described_class.new(args) } let(:args) { { project_url: 'https://gitlab-domain.com' } } diff --git a/spec/models/project_services/chat_message/deployment_message_spec.rb b/spec/models/project_services/chat_message/deployment_message_spec.rb index 42c1689db3d..9c361f90ae0 100644 --- a/spec/models/project_services/chat_message/deployment_message_spec.rb +++ b/spec/models/project_services/chat_message/deployment_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::DeploymentMessage do +RSpec.describe ChatMessage::DeploymentMessage do describe '#pretext' do it 'returns a message with the data returned by the deployment data builder' do environment = create(:environment, name: "myenvironment") diff --git a/spec/models/project_services/chat_message/issue_message_spec.rb b/spec/models/project_services/chat_message/issue_message_spec.rb index c4d10be8331..051f4780ba4 100644 --- a/spec/models/project_services/chat_message/issue_message_spec.rb +++ b/spec/models/project_services/chat_message/issue_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::IssueMessage do +RSpec.describe ChatMessage::IssueMessage do subject { described_class.new(args) } let(:args) do diff --git a/spec/models/project_services/chat_message/merge_message_spec.rb b/spec/models/project_services/chat_message/merge_message_spec.rb index 6063ef4ecb3..45be5212508 100644 --- a/spec/models/project_services/chat_message/merge_message_spec.rb +++ b/spec/models/project_services/chat_message/merge_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::MergeMessage do +RSpec.describe ChatMessage::MergeMessage do subject { described_class.new(args) } let(:args) do diff --git a/spec/models/project_services/chat_message/note_message_spec.rb b/spec/models/project_services/chat_message/note_message_spec.rb index 5e7987dc0f6..6a741365d55 100644 --- a/spec/models/project_services/chat_message/note_message_spec.rb +++ b/spec/models/project_services/chat_message/note_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::NoteMessage do +RSpec.describe ChatMessage::NoteMessage do subject { described_class.new(args) } let(:color) { '#345' } diff --git a/spec/models/project_services/chat_message/pipeline_message_spec.rb b/spec/models/project_services/chat_message/pipeline_message_spec.rb index a7171577063..4eb2f57315b 100644 --- a/spec/models/project_services/chat_message/pipeline_message_spec.rb +++ b/spec/models/project_services/chat_message/pipeline_message_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'spec_helper' -describe ChatMessage::PipelineMessage do +RSpec.describe ChatMessage::PipelineMessage do subject { described_class.new(args) } let(:args) do diff --git a/spec/models/project_services/chat_message/push_message_spec.rb b/spec/models/project_services/chat_message/push_message_spec.rb index 9d990508ab2..e3ba4c2aefe 100644 --- a/spec/models/project_services/chat_message/push_message_spec.rb +++ b/spec/models/project_services/chat_message/push_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::PushMessage do +RSpec.describe ChatMessage::PushMessage do subject { described_class.new(args) } let(:args) do diff --git a/spec/models/project_services/chat_message/wiki_page_message_spec.rb b/spec/models/project_services/chat_message/wiki_page_message_spec.rb index 1346a43335e..04c9e5934be 100644 --- a/spec/models/project_services/chat_message/wiki_page_message_spec.rb +++ b/spec/models/project_services/chat_message/wiki_page_message_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatMessage::WikiPageMessage do +RSpec.describe ChatMessage::WikiPageMessage do subject { described_class.new(args) } let(:args) do diff --git a/spec/models/project_services/chat_notification_service_spec.rb b/spec/models/project_services/chat_notification_service_spec.rb index 1caec5c6eb7..77a1377c138 100644 --- a/spec/models/project_services/chat_notification_service_spec.rb +++ b/spec/models/project_services/chat_notification_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ChatNotificationService do +RSpec.describe ChatNotificationService do describe 'Associations' do before do allow(subject).to receive(:activated?).and_return(true) diff --git a/spec/models/project_services/custom_issue_tracker_service_spec.rb b/spec/models/project_services/custom_issue_tracker_service_spec.rb index f2232ae8e9a..881ae60a680 100644 --- a/spec/models/project_services/custom_issue_tracker_service_spec.rb +++ b/spec/models/project_services/custom_issue_tracker_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe CustomIssueTrackerService do +RSpec.describe CustomIssueTrackerService do describe 'Associations' do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/data_fields_spec.rb b/spec/models/project_services/data_fields_spec.rb index 6b388a7222b..9a3042f9f8d 100644 --- a/spec/models/project_services/data_fields_spec.rb +++ b/spec/models/project_services/data_fields_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DataFields do +RSpec.describe DataFields do let(:url) { 'http://url.com' } let(:username) { 'username_one' } let(:properties) do diff --git a/spec/models/project_services/discord_service_spec.rb b/spec/models/project_services/discord_service_spec.rb index b5a54676dd7..d4bd08ddeb6 100644 --- a/spec/models/project_services/discord_service_spec.rb +++ b/spec/models/project_services/discord_service_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe DiscordService do +RSpec.describe DiscordService do it_behaves_like "chat service", "Discord notifications" do let(:client) { Discordrb::Webhooks::Client } let(:client_arguments) { { url: webhook_url } } diff --git a/spec/models/project_services/drone_ci_service_spec.rb b/spec/models/project_services/drone_ci_service_spec.rb index 1ee9c5f90c6..9aaf4f7a644 100644 --- a/spec/models/project_services/drone_ci_service_spec.rb +++ b/spec/models/project_services/drone_ci_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe DroneCiService, :use_clean_rails_memory_store_caching do +RSpec.describe DroneCiService, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers describe 'associations' do diff --git a/spec/models/project_services/emails_on_push_service_spec.rb b/spec/models/project_services/emails_on_push_service_spec.rb index 44db95afc57..6954a72f9c1 100644 --- a/spec/models/project_services/emails_on_push_service_spec.rb +++ b/spec/models/project_services/emails_on_push_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe EmailsOnPushService do +RSpec.describe EmailsOnPushService do describe 'Validations' do context 'when service is active' do before do diff --git a/spec/models/project_services/external_wiki_service_spec.rb b/spec/models/project_services/external_wiki_service_spec.rb index f8d88a944a5..c6891401a0f 100644 --- a/spec/models/project_services/external_wiki_service_spec.rb +++ b/spec/models/project_services/external_wiki_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ExternalWikiService do +RSpec.describe ExternalWikiService do describe "Associations" do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/flowdock_service_spec.rb b/spec/models/project_services/flowdock_service_spec.rb index c1ebe69ee66..94a49fb3080 100644 --- a/spec/models/project_services/flowdock_service_spec.rb +++ b/spec/models/project_services/flowdock_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe FlowdockService do +RSpec.describe FlowdockService do describe "Associations" do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb index ba861aefe3c..a6b7cb05836 100644 --- a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb +++ b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe GitlabIssueTrackerService do +RSpec.describe GitlabIssueTrackerService do describe "Associations" do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/hangouts_chat_service_spec.rb b/spec/models/project_services/hangouts_chat_service_spec.rb index 0505ac9b49c..042e32439d1 100644 --- a/spec/models/project_services/hangouts_chat_service_spec.rb +++ b/spec/models/project_services/hangouts_chat_service_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe HangoutsChatService do +RSpec.describe HangoutsChatService do it_behaves_like "chat service", "Hangouts Chat" do let(:client) { HangoutsChat::Sender } let(:client_arguments) { webhook_url } diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb index c25edf81352..667e6cc85ab 100644 --- a/spec/models/project_services/hipchat_service_spec.rb +++ b/spec/models/project_services/hipchat_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe HipchatService do +RSpec.describe HipchatService do describe "Associations" do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/irker_service_spec.rb b/spec/models/project_services/irker_service_spec.rb index 88a93eef214..07963947de8 100644 --- a/spec/models/project_services/irker_service_spec.rb +++ b/spec/models/project_services/irker_service_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'socket' require 'json' -describe IrkerService do +RSpec.describe IrkerService do describe 'Associations' do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/issue_tracker_data_spec.rb b/spec/models/project_services/issue_tracker_data_spec.rb index db617cf0abb..3ddb7d9250f 100644 --- a/spec/models/project_services/issue_tracker_data_spec.rb +++ b/spec/models/project_services/issue_tracker_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IssueTrackerData do +RSpec.describe IssueTrackerData do let(:service) { create(:custom_issue_tracker_service, active: false, properties: {}) } describe 'Associations' do diff --git a/spec/models/project_services/issue_tracker_service_spec.rb b/spec/models/project_services/issue_tracker_service_spec.rb index f1cdee5c4a3..5b12c7330b8 100644 --- a/spec/models/project_services/issue_tracker_service_spec.rb +++ b/spec/models/project_services/issue_tracker_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe IssueTrackerService do +RSpec.describe IssueTrackerService do describe 'Validations' do let(:project) { create :project } diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb index 5e2dd5f3fc9..e0b8b861462 100644 --- a/spec/models/project_services/jira_service_spec.rb +++ b/spec/models/project_services/jira_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe JiraService do +RSpec.describe JiraService do include AssetsHelpers let(:url) { 'http://jira.example.com' } diff --git a/spec/models/project_services/jira_tracker_data_spec.rb b/spec/models/project_services/jira_tracker_data_spec.rb index 12f6b99e8a7..844036dc372 100644 --- a/spec/models/project_services/jira_tracker_data_spec.rb +++ b/spec/models/project_services/jira_tracker_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe JiraTrackerData do +RSpec.describe JiraTrackerData do let(:service) { create(:jira_service, active: false) } describe 'Associations' do diff --git a/spec/models/project_services/mattermost_service_spec.rb b/spec/models/project_services/mattermost_service_spec.rb index 5b974985706..af1944ea77d 100644 --- a/spec/models/project_services/mattermost_service_spec.rb +++ b/spec/models/project_services/mattermost_service_spec.rb @@ -2,6 +2,6 @@ require 'spec_helper' -describe MattermostService do +RSpec.describe MattermostService do it_behaves_like "slack or mattermost notifications", "Mattermost" end diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb index 836181929e3..4fff3bc56cc 100644 --- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb +++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MattermostSlashCommandsService do +RSpec.describe MattermostSlashCommandsService do it_behaves_like "chat slash commands service" context 'Mattermost API' do diff --git a/spec/models/project_services/microsoft_teams_service_spec.rb b/spec/models/project_services/microsoft_teams_service_spec.rb index 425599c73d4..610feb52827 100644 --- a/spec/models/project_services/microsoft_teams_service_spec.rb +++ b/spec/models/project_services/microsoft_teams_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe MicrosoftTeamsService do +RSpec.describe MicrosoftTeamsService do let(:chat_service) { described_class.new } let(:webhook_url) { 'https://example.gitlab.com/' } diff --git a/spec/models/project_services/open_project_service_spec.rb b/spec/models/project_services/open_project_service_spec.rb index 8e373a31e62..1abaab0ceff 100644 --- a/spec/models/project_services/open_project_service_spec.rb +++ b/spec/models/project_services/open_project_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OpenProjectService do +RSpec.describe OpenProjectService do describe 'Validations' do context 'when service is active' do before do diff --git a/spec/models/project_services/open_project_tracker_data_spec.rb b/spec/models/project_services/open_project_tracker_data_spec.rb index 0d387bbf69b..e6a3963ba87 100644 --- a/spec/models/project_services/open_project_tracker_data_spec.rb +++ b/spec/models/project_services/open_project_tracker_data_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe OpenProjectTrackerData do +RSpec.describe OpenProjectTrackerData do describe 'Associations' do it { is_expected.to belong_to(:service) } end diff --git a/spec/models/project_services/packagist_service_spec.rb b/spec/models/project_services/packagist_service_spec.rb index 53f18a1bdd9..f710385b6e2 100644 --- a/spec/models/project_services/packagist_service_spec.rb +++ b/spec/models/project_services/packagist_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PackagistService do +RSpec.describe PackagistService do describe "Associations" do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/pipelines_email_service_spec.rb b/spec/models/project_services/pipelines_email_service_spec.rb index de1edf2099a..9a8386c619e 100644 --- a/spec/models/project_services/pipelines_email_service_spec.rb +++ b/spec/models/project_services/pipelines_email_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PipelinesEmailService, :mailer do +RSpec.describe PipelinesEmailService, :mailer do let(:pipeline) do create(:ci_pipeline, :failed, project: project, diff --git a/spec/models/project_services/pivotaltracker_service_spec.rb b/spec/models/project_services/pivotaltracker_service_spec.rb index dde46c82df6..8de85cc7fa5 100644 --- a/spec/models/project_services/pivotaltracker_service_spec.rb +++ b/spec/models/project_services/pivotaltracker_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PivotaltrackerService do +RSpec.describe PivotaltrackerService do include StubRequests describe 'Associations' do diff --git a/spec/models/project_services/prometheus_service_spec.rb b/spec/models/project_services/prometheus_service_spec.rb index db3cbe23ad3..c119f6b4330 100644 --- a/spec/models/project_services/prometheus_service_spec.rb +++ b/spec/models/project_services/prometheus_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PrometheusService, :use_clean_rails_memory_store_caching do +RSpec.describe PrometheusService, :use_clean_rails_memory_store_caching do include PrometheusHelpers include ReactiveCachingHelpers diff --git a/spec/models/project_services/pushover_service_spec.rb b/spec/models/project_services/pushover_service_spec.rb index 380f02739bc..b7d3b8987b8 100644 --- a/spec/models/project_services/pushover_service_spec.rb +++ b/spec/models/project_services/pushover_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PushoverService do +RSpec.describe PushoverService do include StubRequests describe 'Associations' do diff --git a/spec/models/project_services/redmine_service_spec.rb b/spec/models/project_services/redmine_service_spec.rb index 4024de38505..b9be3940d34 100644 --- a/spec/models/project_services/redmine_service_spec.rb +++ b/spec/models/project_services/redmine_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe RedmineService do +RSpec.describe RedmineService do describe 'Associations' do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_services/slack_service_spec.rb b/spec/models/project_services/slack_service_spec.rb index 93036ac7ec4..0b35b9e7b30 100644 --- a/spec/models/project_services/slack_service_spec.rb +++ b/spec/models/project_services/slack_service_spec.rb @@ -2,6 +2,6 @@ require 'spec_helper' -describe SlackService do +RSpec.describe SlackService do it_behaves_like "slack or mattermost notifications", 'Slack' end diff --git a/spec/models/project_services/slack_slash_commands_service_spec.rb b/spec/models/project_services/slack_slash_commands_service_spec.rb index 8c57907d064..95c87ef01bc 100644 --- a/spec/models/project_services/slack_slash_commands_service_spec.rb +++ b/spec/models/project_services/slack_slash_commands_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe SlackSlashCommandsService do +RSpec.describe SlackSlashCommandsService do it_behaves_like "chat slash commands service" describe '#trigger' do diff --git a/spec/models/project_services/teamcity_service_spec.rb b/spec/models/project_services/teamcity_service_spec.rb index 0dd77b68588..a3fda33664a 100644 --- a/spec/models/project_services/teamcity_service_spec.rb +++ b/spec/models/project_services/teamcity_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe TeamcityService, :use_clean_rails_memory_store_caching do +RSpec.describe TeamcityService, :use_clean_rails_memory_store_caching do include ReactiveCachingHelpers include StubRequests diff --git a/spec/models/project_services/unify_circuit_service_spec.rb b/spec/models/project_services/unify_circuit_service_spec.rb index 51079ea5395..73702aa8471 100644 --- a/spec/models/project_services/unify_circuit_service_spec.rb +++ b/spec/models/project_services/unify_circuit_service_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe UnifyCircuitService do +RSpec.describe UnifyCircuitService do it_behaves_like "chat service", "Unify Circuit" do let(:client_arguments) { webhook_url } let(:content_key) { :subject } diff --git a/spec/models/project_services/webex_teams_service_spec.rb b/spec/models/project_services/webex_teams_service_spec.rb index 38977ef3b7d..bd73d0c93b8 100644 --- a/spec/models/project_services/webex_teams_service_spec.rb +++ b/spec/models/project_services/webex_teams_service_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe WebexTeamsService do +RSpec.describe WebexTeamsService do it_behaves_like "chat service", "Webex Teams" do let(:client_arguments) { webhook_url } let(:content_key) { :markdown } diff --git a/spec/models/project_services/youtrack_service_spec.rb b/spec/models/project_services/youtrack_service_spec.rb index c82a3cc1bcf..4339b44e1de 100644 --- a/spec/models/project_services/youtrack_service_spec.rb +++ b/spec/models/project_services/youtrack_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe YoutrackService do +RSpec.describe YoutrackService do describe 'Associations' do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } diff --git a/spec/models/project_setting_spec.rb b/spec/models/project_setting_spec.rb index 5cfb932eb2a..5572304d666 100644 --- a/spec/models/project_setting_spec.rb +++ b/spec/models/project_setting_spec.rb @@ -2,6 +2,6 @@ require 'spec_helper' -describe ProjectSetting, type: :model do +RSpec.describe ProjectSetting, type: :model do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/project_snippet_spec.rb b/spec/models/project_snippet_spec.rb index c17a24dc7cf..464b9b1da84 100644 --- a/spec/models/project_snippet_spec.rb +++ b/spec/models/project_snippet_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectSnippet do +RSpec.describe ProjectSnippet do describe "Associations" do it { is_expected.to belong_to(:project) } end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index d39cde016a5..756ce1d3527 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe Project do +RSpec.describe Project do include ProjectForksHelper include GitHelpers include ExternalAuthorizationServiceHelpers diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index 4bc6130387a..c093ce39ef2 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectStatistics do +RSpec.describe ProjectStatistics do let(:project) { create :project } let(:statistics) { project.statistics } diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb index 24652a1d706..34ec856459c 100644 --- a/spec/models/project_team_spec.rb +++ b/spec/models/project_team_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe ProjectTeam do +RSpec.describe ProjectTeam do let(:maintainer) { create(:user) } let(:reporter) { create(:user) } let(:guest) { create(:user) } diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index aff2b248642..d9c5fed542e 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe ProjectWiki do +RSpec.describe ProjectWiki do it_behaves_like 'wiki model' do let(:wiki_container) { create(:project, :wiki_repo, namespace: user.namespace) } let(:wiki_container_without_repo) { create(:project, namespace: user.namespace) } diff --git a/spec/models/prometheus_alert_event_spec.rb b/spec/models/prometheus_alert_event_spec.rb index 85e57cb08c3..913ca7db0be 100644 --- a/spec/models/prometheus_alert_event_spec.rb +++ b/spec/models/prometheus_alert_event_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PrometheusAlertEvent do +RSpec.describe PrometheusAlertEvent do subject { build(:prometheus_alert_event) } let(:alert) { subject.prometheus_alert } diff --git a/spec/models/prometheus_alert_spec.rb b/spec/models/prometheus_alert_spec.rb index 1409cf65fee..357ddbf63f5 100644 --- a/spec/models/prometheus_alert_spec.rb +++ b/spec/models/prometheus_alert_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PrometheusAlert do +RSpec.describe PrometheusAlert do let_it_be(:project) { build(:project) } let(:metric) { build(:prometheus_metric) } diff --git a/spec/models/prometheus_metric_spec.rb b/spec/models/prometheus_metric_spec.rb index 93abef063cb..ed561c8b399 100644 --- a/spec/models/prometheus_metric_spec.rb +++ b/spec/models/prometheus_metric_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -describe PrometheusMetric do +RSpec.describe PrometheusMetric do subject { build(:prometheus_metric) } it_behaves_like 'having unique enum values' diff --git a/spec/services/alert_management/create_alert_issue_service_spec.rb b/spec/services/alert_management/create_alert_issue_service_spec.rb index edcc7782727..195ce383537 100644 --- a/spec/services/alert_management/create_alert_issue_service_spec.rb +++ b/spec/services/alert_management/create_alert_issue_service_spec.rb @@ -66,88 +66,6 @@ RSpec.describe AlertManagement::CreateAlertIssueService do end end - shared_examples 'sets issue labels' do - let(:title) { 'incident' } - let(:color) { '#CC0033' } - let(:description) do - <<~DESCRIPTION.chomp - Denotes a disruption to IT services and \ - the associated issues require immediate attention - DESCRIPTION - end - - shared_examples 'existing label' do - it 'does not create new label' do - expect { execute }.not_to change(Label, :count) - end - - it 'adds the existing label' do - execute - - expect(created_issue.labels).to eq([label]) - end - end - - shared_examples 'new label' do - it 'adds newly created label' do - expect { execute }.to change(Label, :count).by(1) - end - - it 'sets label attributes' do - execute - - created_label = project.reload.labels.last! - expect(created_issue.labels).to eq([created_label]) - expect(created_label.title).to eq(title) - expect(created_label.color).to eq(color) - expect(created_label.description).to eq(description) - end - end - - context 'with predefined project label' do - it_behaves_like 'existing label' do - let!(:label) { create(:label, project: project, title: title) } - end - end - - context 'with predefined group label' do - it_behaves_like 'existing label' do - let!(:label) { create(:group_label, group: group, title: title) } - end - end - - context 'without label' do - it_behaves_like 'new label' - end - - context 'with duplicate labels', issue: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/65042' do - before do - # Replicate race condition to create duplicates - build(:label, project: project, title: title).save!(validate: false) - build(:label, project: project, title: title).save!(validate: false) - end - - it 'create an issue without labels' do - # Verify we have duplicates - expect(project.labels.size).to eq(2) - expect(project.labels.map(&:title)).to all(eq(title)) - - message = <<~MESSAGE.chomp - Cannot create incident issue with labels ["#{title}"] for \ - "#{project.full_name}": Labels is invalid. - Retrying without labels. - MESSAGE - - expect(Gitlab::AppLogger) - .to receive(:info) - .with(message) - - expect(execute).to be_success - expect(created_issue.labels).to be_empty - end - end - end - context 'when a user is allowed to create an issue' do let(:can_create) { true } @@ -162,18 +80,20 @@ RSpec.describe AlertManagement::CreateAlertIssueService do context 'when the alert is prometheus alert' do let(:alert) { prometheus_alert } + let(:issue) { subject.payload[:issue] } it_behaves_like 'creating an alert issue' it_behaves_like 'setting an issue attributes' - it_behaves_like 'sets issue labels' + it_behaves_like 'create alert issue sets issue labels' end context 'when the alert is generic' do let(:alert) { generic_alert } + let(:issue) { subject.payload[:issue] } it_behaves_like 'creating an alert issue' it_behaves_like 'setting an issue attributes' - it_behaves_like 'sets issue labels' + it_behaves_like 'create alert issue sets issue labels' end context 'when issue cannot be created' do diff --git a/spec/services/incident_management/create_incident_label_service_spec.rb b/spec/services/incident_management/create_incident_label_service_spec.rb new file mode 100644 index 00000000000..f2274119be5 --- /dev/null +++ b/spec/services/incident_management/create_incident_label_service_spec.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe IncidentManagement::CreateIncidentLabelService do + let_it_be(:project) { create(:project, :private) } + let_it_be(:user) { User.alert_bot } + let(:service) { described_class.new(project, user) } + + subject(:execute) { service.execute } + + describe 'execute' do + let(:title) { described_class::LABEL_PROPERTIES[:title] } + let(:color) { described_class::LABEL_PROPERTIES[:color] } + let(:description) { described_class::LABEL_PROPERTIES[:description] } + + shared_examples 'existing label' do + it 'returns the existing label' do + expect { execute }.not_to change(Label, :count) + + expect(execute).to be_success + expect(execute.payload).to eq(label: label) + end + end + + shared_examples 'new label' do + it 'creates a new label' do + expect { execute }.to change(Label, :count).by(1) + + label = project.reload.labels.last + expect(execute).to be_success + expect(execute.payload).to eq(label: label) + expect(label.title).to eq(title) + expect(label.color).to eq(color) + expect(label.description).to eq(description) + end + end + + context 'with predefined project label' do + it_behaves_like 'existing label' do + let!(:label) { create(:label, project: project, title: title) } + end + end + + context 'with predefined group label' do + let(:project) { create(:project, group: group) } + let(:group) { create(:group) } + + it_behaves_like 'existing label' do + let!(:label) { create(:group_label, group: group, title: title) } + end + end + + context 'without label' do + it_behaves_like 'new label' + end + + context 'with duplicate labels', issue: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/65042' do + before do + # Replicate race condition to create duplicates + build(:label, project: project, title: title).save!(validate: false) + build(:label, project: project, title: title).save!(validate: false) + end + + it 'create an issue without labels' do + # Verify we have duplicates + expect(project.labels.size).to eq(2) + expect(project.labels.map(&:title)).to all(eq(title)) + + message = <<~MESSAGE.chomp + Cannot create incident label "incident" \ + for "#{project.full_name}": Title has already been taken. + MESSAGE + + expect(service).to receive(:log_info).with(message) + expect(execute).to be_error + expect(execute.payload[:label]).to be_kind_of(Label) + expect(execute.message).to eq('Title has already been taken') + end + end + end +end diff --git a/spec/services/incident_management/create_issue_service_spec.rb b/spec/services/incident_management/create_issue_service_spec.rb index b513b649a8b..dab9a149458 100644 --- a/spec/services/incident_management/create_issue_service_spec.rb +++ b/spec/services/incident_management/create_issue_service_spec.rb @@ -199,80 +199,7 @@ RSpec.describe IncidentManagement::CreateIssueService do end describe "label `incident`" do - let(:title) { 'incident' } - let(:color) { '#CC0033' } - let(:description) do - <<~DESCRIPTION.chomp - Denotes a disruption to IT services and \ - the associated issues require immediate attention - DESCRIPTION - end - - shared_examples 'existing label' do - it 'adds the existing label' do - expect { subject }.not_to change(Label, :count) - - expect(issue.labels).to eq([label]) - end - end - - shared_examples 'new label' do - it 'adds newly created label' do - expect { subject }.to change(Label, :count).by(1) - - label = project.reload.labels.last - expect(issue.labels).to eq([label]) - expect(label.title).to eq(title) - expect(label.color).to eq(color) - expect(label.description).to eq(description) - end - end - - context 'with predefined project label' do - it_behaves_like 'existing label' do - let!(:label) { create(:label, project: project, title: title) } - end - end - - context 'with predefined group label' do - let(:project) { create(:project, group: group) } - let(:group) { create(:group) } - - it_behaves_like 'existing label' do - let!(:label) { create(:group_label, group: group, title: title) } - end - end - - context 'without label' do - it_behaves_like 'new label' - end - - context 'with duplicate labels', issue: 'https://gitlab.com/gitlab-org/gitlab-foss/issues/65042' do - before do - # Replicate race condition to create duplicates - build(:label, project: project, title: title).save!(validate: false) - build(:label, project: project, title: title).save!(validate: false) - end - - it 'create an issue without labels' do - # Verify we have duplicates - expect(project.labels.size).to eq(2) - expect(project.labels.map(&:title)).to all(eq(title)) - - message = <<~MESSAGE.chomp - Cannot create incident issue with labels ["#{title}"] for \ - "#{project.full_name}": Labels is invalid. - Retrying without labels. - MESSAGE - - expect(service) - .to receive(:log_info) - .with(message) - - expect(subject).to include(status: :success) - expect(issue.labels).to be_empty - end - end + it_behaves_like 'create alert issue sets issue labels' end end diff --git a/spec/support/shared_examples/create_alert_issue_shared_examples.rb b/spec/support/shared_examples/create_alert_issue_shared_examples.rb new file mode 100644 index 00000000000..9f4e1c4335a --- /dev/null +++ b/spec/support/shared_examples/create_alert_issue_shared_examples.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'create alert issue sets issue labels' do + let(:title) { IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES[:title] } + let!(:label) { create(:label, project: project, title: title) } + let(:label_service) { instance_double(IncidentManagement::CreateIncidentLabelService, execute: label_service_response) } + + before do + allow(IncidentManagement::CreateIncidentLabelService).to receive(:new).with(project, user).and_return(label_service) + end + + context 'when create incident label responds with success' do + let(:label_service_response) { ServiceResponse.success(payload: { label: label }) } + + it 'adds label to issue' do + expect(issue.labels).to eq([label]) + end + end + + context 'when create incident label responds with error' do + let(:label_service_response) { ServiceResponse.error(payload: { label: label }, message: 'label error') } + + it 'creates an issue without labels' do + expect(issue.labels).to be_empty + end + end +end |