diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-13 00:08:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-13 00:08:10 +0300 |
commit | a6b21afb09a4b91e47db93b2443205bd4eef84e6 (patch) | |
tree | 75914410f8e34a0fadc6d9998f84d20c7fedf075 /spec | |
parent | 31f59b55c63f6a7add79c5987731387ae3a4f7ab (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
18 files changed, 220 insertions, 57 deletions
diff --git a/spec/frontend/frequent_items/mock_data.js b/spec/frontend/frequent_items/mock_data.js index 5e15b4b33e0..6563daee6c3 100644 --- a/spec/frontend/frequent_items/mock_data.js +++ b/spec/frontend/frequent_items/mock_data.js @@ -69,7 +69,7 @@ export const mockFrequentGroups = [ }, ]; -export const mockSearchedGroups = [mockRawGroup]; +export const mockSearchedGroups = { data: [mockRawGroup] }; export const mockProcessedSearchedGroups = [mockGroup]; export const mockProject = { diff --git a/spec/frontend/invite_members/components/group_select_spec.js b/spec/frontend/invite_members/components/group_select_spec.js index 3186e5c6212..bd90832f497 100644 --- a/spec/frontend/invite_members/components/group_select_spec.js +++ b/spec/frontend/invite_members/components/group_select_spec.js @@ -10,6 +10,14 @@ jest.mock('~/api/groups_api'); const group1 = { id: 1, full_name: 'Group One', avatar_url: 'test' }; const group2 = { id: 2, full_name: 'Group Two', avatar_url: 'test' }; const allGroups = [group1, group2]; +const headers = { + 'X-Next-Page': 2, + 'X-Page': 1, + 'X-Per-Page': 20, + 'X-Prev-Page': '', + 'X-Total': 40, + 'X-Total-Pages': 2, +}; describe('GroupSelect', () => { let wrapper; @@ -25,7 +33,7 @@ describe('GroupSelect', () => { }; beforeEach(() => { - getGroups.mockResolvedValueOnce(allGroups); + getGroups.mockResolvedValueOnce({ data: allGroups, headers }); }); const findListbox = () => wrapper.findComponent(GlCollapsibleListbox); @@ -121,4 +129,60 @@ describe('GroupSelect', () => { expect(findListboxToggle().text()).toBe(group1.full_name); }); }); + + describe('infinite scroll', () => { + it('sets infinite scroll related props', async () => { + createComponent(); + await waitForPromises(); + + expect(findListbox().props()).toMatchObject({ + infiniteScroll: true, + infiniteScrollLoading: false, + totalItems: 40, + }); + }); + + describe('when `bottom-reached` event is fired', () => { + it('indicates new groups are loading and adds them to the listbox', async () => { + createComponent(); + await waitForPromises(); + + const infiniteScrollGroup = { + id: 3, + full_name: 'Infinite scroll group', + avatar_url: 'test', + }; + + getGroups.mockResolvedValueOnce({ data: [infiniteScrollGroup], headers }); + + findListbox().vm.$emit('bottom-reached'); + await nextTick(); + + expect(findListbox().props('infiniteScrollLoading')).toBe(true); + + await waitForPromises(); + + expect(findListbox().props('items')[2]).toMatchObject({ + value: infiniteScrollGroup.id, + id: infiniteScrollGroup.id, + name: infiniteScrollGroup.full_name, + avatarUrl: infiniteScrollGroup.avatar_url, + }); + }); + + describe('when API request fails', () => { + it('emits `error` event', async () => { + createComponent(); + await waitForPromises(); + + getGroups.mockRejectedValueOnce(); + + findListbox().vm.$emit('bottom-reached'); + await waitForPromises(); + + expect(wrapper.emitted('error')).toEqual([[GroupSelect.i18n.errorMessage]]); + }); + }); + }); + }); }); diff --git a/spec/frontend/invite_members/components/invite_groups_modal_spec.js b/spec/frontend/invite_members/components/invite_groups_modal_spec.js index 2a3ecd44e7a..4136de75545 100644 --- a/spec/frontend/invite_members/components/invite_groups_modal_spec.js +++ b/spec/frontend/invite_members/components/invite_groups_modal_spec.js @@ -1,4 +1,4 @@ -import { GlModal, GlSprintf } from '@gitlab/ui'; +import { GlModal, GlSprintf, GlAlert } from '@gitlab/ui'; import { nextTick } from 'vue'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import Api from '~/api'; @@ -250,4 +250,15 @@ describe('InviteGroupsModal', () => { }); }); }); + + describe('when group select emits an error event', () => { + it('displays error alert', async () => { + createComponent(); + + findGroupSelect().vm.$emit('error', GroupSelect.i18n.errorMessage); + await nextTick(); + + expect(wrapper.findComponent(GlAlert).text()).toBe(GroupSelect.i18n.errorMessage); + }); + }); }); diff --git a/spec/frontend/pipelines/pipelines_artifacts_spec.js b/spec/frontend/pipelines/pipelines_artifacts_spec.js index 9fedbaf9b56..1abc2887682 100644 --- a/spec/frontend/pipelines/pipelines_artifacts_spec.js +++ b/spec/frontend/pipelines/pipelines_artifacts_spec.js @@ -1,4 +1,9 @@ -import { GlDropdown, GlDropdownItem, GlSprintf } from '@gitlab/ui'; +import { + GlDisclosureDropdown, + GlDisclosureDropdownItem, + GlDisclosureDropdownGroup, + GlSprintf, +} from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import PipelineArtifacts from '~/pipelines/components/pipelines_list/pipelines_artifacts.vue'; @@ -25,25 +30,27 @@ describe('Pipelines Artifacts dropdown', () => { }, stubs: { GlSprintf, + GlDisclosureDropdown, + GlDisclosureDropdownItem, + GlDisclosureDropdownGroup, }, }); }; - const findDropdown = () => wrapper.findComponent(GlDropdown); - const findFirstGlDropdownItem = () => wrapper.findComponent(GlDropdownItem); - const findAllGlDropdownItems = () => - wrapper.findComponent(GlDropdown).findAllComponents(GlDropdownItem); + const findGlDropdown = () => wrapper.findComponent(GlDisclosureDropdown); + const findFirstGlDropdownItem = () => wrapper.findComponent(GlDisclosureDropdownItem); it('should render a dropdown with all the provided artifacts', () => { createComponent(); - expect(findAllGlDropdownItems()).toHaveLength(artifacts.length); + const [{ items }] = findGlDropdown().props('items'); + expect(items).toHaveLength(artifacts.length); }); it('should render a link with the provided path', () => { createComponent(); - expect(findFirstGlDropdownItem().attributes('href')).toBe(artifacts[0].path); + expect(findFirstGlDropdownItem().props('item').href).toBe(artifacts[0].path); expect(findFirstGlDropdownItem().text()).toBe(artifacts[0].name); }); @@ -51,7 +58,7 @@ describe('Pipelines Artifacts dropdown', () => { it('should not render the dropdown', () => { createComponent({ mockArtifacts: [] }); - expect(findDropdown().exists()).toBe(false); + expect(findGlDropdown().exists()).toBe(false); }); }); }); diff --git a/spec/frontend/work_items/components/work_item_detail_spec.js b/spec/frontend/work_items/components/work_item_detail_spec.js index 14a6ada16bd..7ceae935d2d 100644 --- a/spec/frontend/work_items/components/work_item_detail_spec.js +++ b/spec/frontend/work_items/components/work_item_detail_spec.js @@ -5,10 +5,11 @@ import { GlSkeletonLoader, GlButton, GlEmptyState, + GlIntersectionObserver, } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; import VueApollo from 'vue-apollo'; +import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { isLoggedIn } from '~/lib/utils/common_utils'; import createMockApollo from 'helpers/mock_apollo_helper'; import waitForPromises from 'helpers/wait_for_promises'; @@ -67,15 +68,20 @@ describe('WorkItemDetail component', () => { const findCreatedUpdated = () => wrapper.findComponent(WorkItemCreatedUpdated); const findWorkItemDescription = () => wrapper.findComponent(WorkItemDescription); const findWorkItemAttributesWrapper = () => wrapper.findComponent(WorkItemAttributesWrapper); - const findParent = () => wrapper.find('[data-testid="work-item-parent"]'); + const findParent = () => wrapper.findByTestId('work-item-parent'); const findParentButton = () => findParent().findComponent(GlButton); - const findCloseButton = () => wrapper.find('[data-testid="work-item-close"]'); - const findWorkItemType = () => wrapper.find('[data-testid="work-item-type"]'); + const findCloseButton = () => wrapper.findByTestId('work-item-close'); + const findWorkItemType = () => wrapper.findByTestId('work-item-type'); const findHierarchyTree = () => wrapper.findComponent(WorkItemTree); const findNotesWidget = () => wrapper.findComponent(WorkItemNotes); const findModal = () => wrapper.findComponent(WorkItemDetailModal); const findAbuseCategorySelector = () => wrapper.findComponent(AbuseCategorySelector); const findWorkItemTodos = () => wrapper.findComponent(WorkItemTodos); + const findIntersectionObserver = () => wrapper.findComponent(GlIntersectionObserver); + const findStickyHeader = () => wrapper.findByTestId('work-item-sticky-header'); + const findWorkItemTwoColumnViewContainer = () => wrapper.findByTestId('work-item-overview'); + const findRightSidebar = () => wrapper.findByTestId('work-item-overview-right-sidebar'); + const triggerPageScroll = () => findIntersectionObserver().vm.$emit('disappear'); const createComponent = ({ isModal = false, @@ -92,7 +98,7 @@ describe('WorkItemDetail component', () => { confidentialityMock, ]; - wrapper = shallowMount(WorkItemDetail, { + wrapper = shallowMountExtended(WorkItemDetail, { apolloProvider: createMockApollo(handlers), isLoggedIn: isLoggedIn(), propsData: { @@ -646,4 +652,56 @@ describe('WorkItemDetail component', () => { expect(findAlert().text()).toBe(updateError); }); }); + + describe('work item two column view', () => { + describe('when `workItemsMvc2Enabled` is false', () => { + beforeEach(async () => { + createComponent({ workItemsMvc2Enabled: false }); + await waitForPromises(); + }); + + it('does not have the `work-item-overview` class', () => { + expect(findWorkItemTwoColumnViewContainer().classes()).not.toContain('work-item-overview'); + }); + + it('does not have sticky header', () => { + expect(findIntersectionObserver().exists()).toBe(false); + expect(findStickyHeader().exists()).toBe(false); + }); + + it('does not have right sidebar', () => { + expect(findRightSidebar().exists()).toBe(false); + }); + }); + + describe('when `workItemsMvc2Enabled` is true', () => { + beforeEach(async () => { + createComponent({ workItemsMvc2Enabled: true }); + await waitForPromises(); + }); + + it('has the `work-item-overview` class', () => { + expect(findWorkItemTwoColumnViewContainer().classes()).toContain('work-item-overview'); + }); + + it('does not show sticky header by default', () => { + expect(findStickyHeader().exists()).toBe(false); + }); + + it('has the sticky header when the page is scrolled', async () => { + expect(findIntersectionObserver().exists()).toBe(true); + + global.pageYOffset = 100; + triggerPageScroll(); + + await nextTick(); + + expect(findStickyHeader().exists()).toBe(true); + }); + + it('has the right sidebar', () => { + expect(findRightSidebar().exists()).toBe(true); + }); + }); + }); }); diff --git a/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb b/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb index 05b67a8a93f..cc329c48c5f 100644 --- a/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb +++ b/spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb @@ -98,7 +98,7 @@ RSpec.describe Gitlab::Cluster::Mixins::PumaCluster do loop do line = process.readline puts "PUMA_DEBUG: #{line}" if ENV['PUMA_DEBUG'] - break if line =~ output + break if line.match?(output) end end end diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 226d91e4a35..feaef8015f2 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1173,7 +1173,50 @@ RSpec.describe Gitlab::Git::Repository, feature_category: :source_code_managemen commit_result.newrev end - subject { repository.new_blobs(newrevs).to_a } + subject { repository.new_blobs(newrevs) } + + describe 'memoization' do + context 'when the fix_new_blobs_memoization feature flag is disabled' do + before do + stub_feature_flags(fix_new_blobs_memoization: false) + end + + context 'when called with different revisions' do + it 'calls blobs with the same arguments and memoizes the result' do # for documenting bug behaviour + expect(repository).to receive(:blobs).twice.with(["--not", "--all", "--not", "revision1"], kind_of(Hash)) + .and_return(['first_result'], ['second_result']) + expect(repository.new_blobs(['revision1'])).to eq(['first_result']) + expect(repository.new_blobs(['revision2'])).to eq(['second_result']) + expect(repository.new_blobs(['revision1'])).to eq(['first_result']) + expect(repository.new_blobs(['revision2'])).to eq(['second_result']) + end + end + end + + context 'when the fix_new_blobs_memoization feature flag is enabled' do + before do + allow(repository).to receive(:blobs).once.with(["--not", "--all", "--not", "revision1"], kind_of(Hash)) + .and_return(['first result']) + repository.new_blobs(['revision1']) + end + + it 'calls blobs only once' do + expect(repository.new_blobs(['revision1'])).to eq(['first result']) + end + + context 'when called with a different revision' do + before do + allow(repository).to receive(:blobs).once.with(["--not", "--all", "--not", "revision2"], kind_of(Hash)) + .and_return(['second result']) + repository.new_blobs(['revision2']) + end + + it 'memoizes the different arguments' do + expect(repository.new_blobs(['revision2'])).to eq(['second result']) + end + end + end + end shared_examples '#new_blobs with revisions' do before do @@ -1195,7 +1238,9 @@ RSpec.describe Gitlab::Git::Repository, feature_category: :source_code_managemen it 'memoizes results' do expect(subject).to match_array(expected_blobs) - expect(subject).to match_array(expected_blobs) + + # call subject again + expect(repository.new_blobs(newrevs)).to match_array(expected_blobs) end end diff --git a/spec/lib/gitlab/pagination/keyset/in_operator_optimization/query_builder_spec.rb b/spec/lib/gitlab/pagination/keyset/in_operator_optimization/query_builder_spec.rb index 28f6919e6bc..1c67c9e0b95 100644 --- a/spec/lib/gitlab/pagination/keyset/in_operator_optimization/query_builder_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/in_operator_optimization/query_builder_spec.rb @@ -156,14 +156,6 @@ RSpec.describe Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder let(:batch_size) { 1 } it_behaves_like 'correct ordering examples' - - context 'when key_set_optimizer_ignored_columns feature flag is disabled' do - before do - stub_feature_flags(key_set_optimizer_ignored_columns: false) - end - - it_behaves_like 'correct ordering examples' - end end context 'when iterating records with LIMIT 3' do diff --git a/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb b/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb index c20f3c96734..3fe858f33da 100644 --- a/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/in_operator_optimization/strategies/record_loader_strategy_spec.rb @@ -83,16 +83,6 @@ RSpec.describe Gitlab::Pagination::Keyset::InOperatorOptimization::Strategies::R model.default_select_columns.map { |column| "(#{described_class::RECORDS_COLUMN}).#{column.name}" } ) end - - context 'when the key_set_optimizer_ignored_columns feature flag is disabled' do - before do - stub_feature_flags(key_set_optimizer_ignored_columns: false) - end - - it 'does not specify the selected column names' do - expect(strategy.final_projections).to contain_exactly("(#{described_class::RECORDS_COLUMN}).*") - end - end end end end diff --git a/spec/lib/gitlab/pagination/keyset/order_spec.rb b/spec/lib/gitlab/pagination/keyset/order_spec.rb index a8bdafb1ce8..05bb0bb8b3a 100644 --- a/spec/lib/gitlab/pagination/keyset/order_spec.rb +++ b/spec/lib/gitlab/pagination/keyset/order_spec.rb @@ -702,16 +702,6 @@ RSpec.describe Gitlab::Pagination::Keyset::Order do end end - context 'when key_set_optimizer_ignored_columns feature flag is disabled' do - before do - stub_feature_flags(key_set_optimizer_ignored_columns: false) - end - - it 'returns items in the correct order' do - expect(items).to eq(expected_results) - end - end - it 'returns items in the correct order' do expect(items).to eq(expected_results) end diff --git a/spec/mailers/emails/in_product_marketing_spec.rb b/spec/mailers/emails/in_product_marketing_spec.rb index 5419c9e6798..2d332dd99d6 100644 --- a/spec/mailers/emails/in_product_marketing_spec.rb +++ b/spec/mailers/emails/in_product_marketing_spec.rb @@ -80,7 +80,7 @@ RSpec.describe Emails::InProductMarketing do is_expected.to have_body_text(message.subtitle) is_expected.to have_body_text(CGI.unescapeHTML(message.cta_link)) - if track =~ /(create|verify)/ + if /create|verify/.match?(track) is_expected.to have_body_text(message.invite_text) is_expected.to have_body_text(CGI.unescapeHTML(message.invite_link)) else diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eb7796cb55a..4d66784d943 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -152,7 +152,7 @@ RSpec.configure do |config| # Admin controller specs get auto admin mode enabled since they are # protected by the 'EnforcesAdminAuthentication' concern - metadata[:enable_admin_mode] = true if location =~ %r{(ee)?/spec/controllers/admin/} + metadata[:enable_admin_mode] = true if %r{(ee)?/spec/controllers/admin/}.match?(location) end config.define_derived_metadata(file_path: %r{(ee)?/spec/.+_docs\.rb\z}) do |metadata| diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index a855e4468ca..392743fda4a 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -5,6 +5,7 @@ require 'capybara/rails' require 'capybara/rspec' require 'capybara-screenshot/rspec' require 'selenium-webdriver' +require 'gitlab/utils/all' # Give CI some extra time timeout = ENV['CI'] || ENV['CI_SERVER'] ? 30 : 10 @@ -117,7 +118,7 @@ Capybara.register_driver :firefox do |app| options.add_argument("--window-size=#{CAPYBARA_WINDOW_SIZE.join(',')}") # Run headless by default unless WEBDRIVER_HEADLESS specified - options.add_argument("--headless") unless ENV['WEBDRIVER_HEADLESS'] =~ /^(false|no|0)$/i + options.add_argument("--headless") unless Gitlab::Utils.to_boolean(ENV['WEBDRIVER_HEADLESS'], default: false) Capybara::Selenium::Driver.new( app, diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb index da4954c1a5f..b95adb3fe4d 100644 --- a/spec/support/helpers/test_env.rb +++ b/spec/support/helpers/test_env.rb @@ -523,7 +523,7 @@ module TestEnv def component_matches_git_sha?(component_folder, expected_version) # Not a git SHA, so return early - return false unless expected_version =~ ::Gitlab::Git::COMMIT_ID + return false unless ::Gitlab::Git::COMMIT_ID.match?(expected_version) return false unless Dir.exist?(component_folder) diff --git a/spec/support/shared_contexts/features/integrations/integrations_shared_context.rb b/spec/support/shared_contexts/features/integrations/integrations_shared_context.rb index 21d9dccbb8d..8c17136b1e2 100644 --- a/spec/support/shared_contexts/features/integrations/integrations_shared_context.rb +++ b/spec/support/shared_contexts/features/integrations/integrations_shared_context.rb @@ -56,7 +56,7 @@ RSpec.shared_context 'with integration' do hash.merge!(k => 'key:value') elsif integration == 'packagist' && k == :server hash.merge!(k => 'https://packagist.example.com') - elsif k =~ /^(.*_url|url|webhook)/ + elsif /^(.*_url|url|webhook)/.match?(k) hash.merge!(k => "http://example.com") elsif integration_klass.method_defined?("#{k}?") hash.merge!(k => true) diff --git a/spec/support/shared_examples/features/discussion_comments_shared_example.rb b/spec/support/shared_examples/features/discussion_comments_shared_example.rb index d6f1efc09fc..ac8055138d7 100644 --- a/spec/support/shared_examples/features/discussion_comments_shared_example.rb +++ b/spec/support/shared_examples/features/discussion_comments_shared_example.rb @@ -284,7 +284,7 @@ RSpec.shared_examples 'thread comments for issue, epic and merge request' do |re expect(new_comment).to have_css('.discussion-with-resolve-btn') end - if resource_name =~ /(issue|merge request)/ + if /(issue|merge request)/.match?(resource_name) it 'can be replied to' do submit_reply('some text') @@ -373,7 +373,7 @@ RSpec.shared_examples 'thread comments for issue, epic and merge request' do |re expect(page).not_to have_selector menu_selector end - if resource_name =~ /(issue|merge request)/ + if /(issue|merge request)/.match?(resource_name) it 'updates the close button text' do expect(find(close_selector)).to have_content "Comment & close #{resource_name}" end @@ -402,7 +402,7 @@ RSpec.shared_examples 'thread comments for issue, epic and merge request' do |re end end - if resource_name =~ /(issue|merge request)/ + if /(issue|merge request)/.match?(resource_name) describe "on a closed #{resource_name}" do before do find("#{form_selector} .js-note-target-close").click diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb index fb0603a207a..91ba8eebe51 100644 --- a/spec/tooling/danger/project_helper_spec.rb +++ b/spec/tooling/danger/project_helper_spec.rb @@ -65,6 +65,11 @@ RSpec.describe Tooling::Danger::ProjectHelper do 'config/foo.js' | [:frontend] 'config/deep/foo.js' | [:frontend] + 'app/components/pajamas/empty_state_component.html.haml' | [:frontend, :backend] + 'ee/app/components/pajamas/empty_state_component.html.haml' | [:frontend, :backend] + 'app/components/diffs/overflow_warning_component.html.haml' | [:frontend, :backend] + 'app/components/layouts/horizontal_section_component.rb' | [:frontend, :backend] + 'ee/app/assets/foo' | [:frontend] 'ee/app/views/foo' | [:frontend, :backend] 'ee/spec/frontend/bar' | [:frontend] @@ -112,7 +117,7 @@ RSpec.describe Tooling::Danger::ProjectHelper do 'scripts/glfm/bar.rb' | [:backend] 'scripts/glfm/bar.js' | [:frontend] - 'scripts/remote_development/run-smoke-test-suite.sh' | [:remote_development] + 'scripts/remote_development/run-smoke-test-suite.sh' | [:remote_development_be] 'scripts/lib/glfm/bar.rb' | [:backend] 'scripts/lib/glfm/bar.js' | [:frontend] 'scripts/bar.rb' | [:backend, :tooling] diff --git a/spec/tooling/quality/test_level_spec.rb b/spec/tooling/quality/test_level_spec.rb index a7e4e42206a..6ccd2e46f7b 100644 --- a/spec/tooling/quality/test_level_spec.rb +++ b/spec/tooling/quality/test_level_spec.rb @@ -238,7 +238,7 @@ RSpec.describe Quality::TestLevel, feature_category: :tooling do it 'ensures all spec/ folders are covered by a test level' do Dir['{,ee/}spec/**/*/'].each do |path| - next if path =~ %r{\A(ee/)?spec/(benchmarks|docs_screenshots|fixtures|frontend_integration|support)/} + next if %r{\A(ee/)?spec/(benchmarks|docs_screenshots|fixtures|frontend_integration|support)/}.match?(path) expect { subject.level_for(path) }.not_to raise_error end |