Commit a82be040 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch...

Merge branch '327490-fix-cop-remaining-cop-offenses-for-style-regexpliteralmixedpreserve-p2' into 'master'

Fix offenses for Style/RegexpLiteralMixedPreserve part2

See merge request gitlab-org/gitlab!65362
parents 79ed8f31 0b3169ad
...@@ -2459,12 +2459,6 @@ Style/RegexpLiteralMixedPreserve: ...@@ -2459,12 +2459,6 @@ Style/RegexpLiteralMixedPreserve:
- 'ee/app/presenters/vulnerability_presenter.rb' - 'ee/app/presenters/vulnerability_presenter.rb'
- 'ee/lib/api/geo_nodes.rb' - 'ee/lib/api/geo_nodes.rb'
- 'ee/lib/gitlab/vulnerabilities/standard_vulnerability.rb' - 'ee/lib/gitlab/vulnerabilities/standard_vulnerability.rb'
- 'ee/spec/controllers/concerns/ee/routable_actions/sso_enforcement_redirect_spec.rb'
- 'ee/spec/controllers/concerns/routable_actions_spec.rb'
- 'ee/spec/controllers/groups/groups_controller_spec.rb'
- 'ee/spec/features/groups/saml_enforcement_spec.rb'
- 'ee/spec/features/markdown/metrics_spec.rb'
- 'ee/spec/services/jira/requests/issues/list_service_spec.rb'
- 'lib/api/invitations.rb' - 'lib/api/invitations.rb'
- 'lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb' - 'lib/gitlab/ci/pipeline/expression/lexeme/pattern.rb'
- 'lib/gitlab/metrics/requests_rack_middleware.rb' - 'lib/gitlab/metrics/requests_rack_middleware.rb'
...@@ -2472,24 +2466,3 @@ Style/RegexpLiteralMixedPreserve: ...@@ -2472,24 +2466,3 @@ Style/RegexpLiteralMixedPreserve:
- 'lib/gitlab/regex.rb' - 'lib/gitlab/regex.rb'
- 'lib/gitlab/utils.rb' - 'lib/gitlab/utils.rb'
- 'lib/product_analytics/tracker.rb' - 'lib/product_analytics/tracker.rb'
- 'qa/qa/page/project/settings/advanced.rb'
- 'qa/spec/service/docker_run/gitlab_runner_spec.rb'
- 'rubocop/cop/gitlab/duplicate_spec_location.rb'
- 'spec/features/clusters/cluster_health_dashboard_spec.rb'
- 'spec/features/markdown/metrics_spec.rb'
- 'spec/features/search/user_searches_for_code_spec.rb'
- 'spec/features/snippets/embedded_snippet_spec.rb'
- 'spec/helpers/diff_helper_spec.rb'
- 'spec/helpers/releases_helper_spec.rb'
- 'spec/lib/gitlab/ci/reports/test_case_spec.rb'
- 'spec/lib/gitlab/consul/internal_spec.rb'
- 'spec/lib/gitlab/import_export/shared_spec.rb'
- 'spec/lib/gitlab/utils/usage_data_spec.rb'
- 'spec/presenters/ci/build_runner_presenter_spec.rb'
- 'spec/requests/api/projects_spec.rb'
- 'spec/services/jira/requests/projects/list_service_spec.rb'
- 'spec/support/capybara.rb'
- 'spec/support/helpers/grafana_api_helpers.rb'
- 'spec/support/helpers/query_recorder.rb'
- 'spec/support/helpers/require_migration.rb'
- 'spec/views/layouts/_head.html.haml_spec.rb'
...@@ -83,7 +83,7 @@ RSpec.describe EE::RoutableActions::SsoEnforcementRedirect do ...@@ -83,7 +83,7 @@ RSpec.describe EE::RoutableActions::SsoEnforcementRedirect do
it 'returns the SSO url for the root group' do it 'returns the SSO url for the root group' do
redirect_url = CGI.escape("/#{subject.routable.full_path}") redirect_url = CGI.escape("/#{subject.routable.full_path}")
expect(subject.sso_redirect_url).to match(/groups\/#{root_group.to_param}\/-\/saml\/sso\?redirect=#{redirect_url}&token=/) expect(subject.sso_redirect_url).to match(%r{groups/#{root_group.to_param}/-/saml/sso\?redirect=#{redirect_url}&token=})
end end
end end
......
...@@ -43,7 +43,7 @@ RSpec.describe RoutableActions do ...@@ -43,7 +43,7 @@ RSpec.describe RoutableActions do
get :show, params: request_params(routable) get :show, params: request_params(routable)
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:found)
expect(response.location).to match(/groups\/.*\/-\/saml\/sso\?redirect=.+&token=/) expect(response.location).to match(%r{groups/.*/-/saml/sso\?redirect=.+&token=})
end end
it 'does not redirect on POST requests' do it 'does not redirect on POST requests' do
......
...@@ -90,7 +90,7 @@ RSpec.describe GroupsController do ...@@ -90,7 +90,7 @@ RSpec.describe GroupsController do
get :show, params: { id: group } get :show, params: { id: group }
expect(response).to have_gitlab_http_status(:found) expect(response).to have_gitlab_http_status(:found)
expect(response.location).to match(/groups\/#{group.to_param}\/-\/saml\/sso\?redirect=.+&token=/) expect(response.location).to match(%r{groups/#{group.to_param}/-/saml/sso\?redirect=.+&token=})
end end
end end
......
...@@ -26,7 +26,7 @@ RSpec.describe 'SAML access enforcement' do ...@@ -26,7 +26,7 @@ RSpec.describe 'SAML access enforcement' do
it 'prevents access to resource via SSO redirect' do it 'prevents access to resource via SSO redirect' do
expect(page).to have_content("SAML SSO Sign in to \"#{group.name}\"") expect(page).to have_content("SAML SSO Sign in to \"#{group.name}\"")
expect(current_url).to match(/groups\/#{group.to_param}\/-\/saml\/sso\?redirect=.+&token=/) expect(current_url).to match(%r{groups/#{group.to_param}/-/saml/sso\?redirect=.+&token=})
end end
end end
......
...@@ -81,7 +81,7 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st ...@@ -81,7 +81,7 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
create(:clusters_integrations_prometheus, cluster: cluster) create(:clusters_integrations_prometheus, cluster: cluster)
stub_kubeclient_discover(cluster.platform.api_url) stub_kubeclient_discover(cluster.platform.api_url)
stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body) stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body)
stub_prometheus_request(/prometheus\/api\/v1/, body: prometheus_values_body) stub_prometheus_request(%r{prometheus/api/v1}, body: prometheus_values_body)
end end
let_it_be(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [project], user: user) } let_it_be(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [project], user: user) }
......
...@@ -38,7 +38,7 @@ RSpec.describe Jira::Requests::Issues::ListService do ...@@ -38,7 +38,7 @@ RSpec.describe Jira::Requests::Issues::ListService do
let(:jira_integration) { create(:jira_integration, url: 'https://jira.example.com') } let(:jira_integration) { create(:jira_integration, url: 'https://jira.example.com') }
let(:response_body) { '' } let(:response_body) { '' }
let(:response_headers) { { 'content-type' => 'application/json' } } let(:response_headers) { { 'content-type' => 'application/json' } }
let(:expected_url_pattern) { /.*jira.example.com\/rest\/api\/2\/search.*/ } let(:expected_url_pattern) { %r{.*jira.example.com/rest/api/2/search.*} }
before do before do
stub_request(:get, expected_url_pattern).to_return(status: 200, body: response_body, headers: response_headers) stub_request(:get, expected_url_pattern).to_return(status: 200, body: response_body, headers: response_headers)
...@@ -57,7 +57,7 @@ RSpec.describe Jira::Requests::Issues::ListService do ...@@ -57,7 +57,7 @@ RSpec.describe Jira::Requests::Issues::ListService do
context 'when jira runs on a subpath' do context 'when jira runs on a subpath' do
let(:jira_integration) { create(:jira_integration, url: 'http://jira.example.com/jira') } let(:jira_integration) { create(:jira_integration, url: 'http://jira.example.com/jira') }
let(:expected_url_pattern) { /.*jira.example.com\/jira\/rest\/api\/2\/search.*/ } let(:expected_url_pattern) { %r{.*jira.example.com/jira/rest/api/2/search.*} }
it 'takes the subpath into account' do it 'takes the subpath into account' do
expect(subject.success?).to be_truthy expect(subject.success?).to be_truthy
......
...@@ -51,7 +51,7 @@ module QA ...@@ -51,7 +51,7 @@ module QA
# Workaround for a failure to search when there are no spaces around the / # Workaround for a failure to search when there are no spaces around the /
# https://gitlab.com/gitlab-org/gitlab/-/issues/218965 # https://gitlab.com/gitlab-org/gitlab/-/issues/218965
search_and_select(namespace.gsub(/([^\s])\/([^\s])/, '\1 / \2')) search_and_select(namespace.gsub(%r{([^\s])/([^\s])}, '\1 / \2'))
click_element(:transfer_button) click_element(:transfer_button)
fill_confirmation_text(project_name) fill_confirmation_text(project_name)
......
...@@ -130,7 +130,7 @@ module QA ...@@ -130,7 +130,7 @@ module QA
end end
it 'mounts the docker socket to the host runner' do it 'mounts the docker socket to the host runner' do
expect(subject).to have_received(:shell).with(/-v \/var\/run\/docker.sock:\/var\/run\/docker.sock /) expect(subject).to have_received(:shell).with(%r{-v /var/run/docker.sock:/var/run/docker.sock })
end end
it 'runs in privileged mode' do it 'runs in privileged mode' do
......
...@@ -25,7 +25,7 @@ module RuboCop ...@@ -25,7 +25,7 @@ module RuboCop
MSG = 'Duplicate spec location in `%<path>s`.' MSG = 'Duplicate spec location in `%<path>s`.'
def on_top_level_describe(node, _args) def on_top_level_describe(node, _args)
path = file_path_for_node(node).sub(/\A#{rails_root}\//, '') path = file_path_for_node(node).sub(%r{\A#{rails_root}/}, '')
duplicate_path = find_duplicate_path(path) duplicate_path = find_duplicate_path(path)
if duplicate_path && File.exist?(File.join(rails_root, duplicate_path)) if duplicate_path && File.exist?(File.join(rails_root, duplicate_path))
......
...@@ -176,7 +176,7 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st ...@@ -176,7 +176,7 @@ RSpec.describe 'Metrics rendering', :js, :kubeclient, :use_clean_rails_memory_st
create(:clusters_integrations_prometheus, cluster: cluster) create(:clusters_integrations_prometheus, cluster: cluster)
stub_kubeclient_discover(cluster.platform.api_url) stub_kubeclient_discover(cluster.platform.api_url)
stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body) stub_prometheus_request(/prometheus-prometheus-server/, body: prometheus_values_body)
stub_prometheus_request(/prometheus\/api\/v1/, body: prometheus_values_body) stub_prometheus_request(%r{prometheus/api/v1}, body: prometheus_values_body)
end end
let_it_be(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [project], user: user) } let_it_be(:cluster) { create(:cluster, :provided_by_gcp, :project, projects: [project], user: user) }
......
...@@ -21,7 +21,7 @@ RSpec.describe 'User searches for code' do ...@@ -21,7 +21,7 @@ RSpec.describe 'User searches for code' do
expect(page).to have_selector('.results', text: 'application.js') expect(page).to have_selector('.results', text: 'application.js')
expect(page).to have_selector('.file-content .code') expect(page).to have_selector('.file-content .code')
expect(page).to have_selector("span.line[lang='javascript']") expect(page).to have_selector("span.line[lang='javascript']")
expect(page).to have_link('application.js', href: /master\/files\/js\/application.js/) expect(page).to have_link('application.js', href: %r{master/files/js/application.js})
end end
context 'when on a project page', :js do context 'when on a project page', :js do
...@@ -45,7 +45,7 @@ RSpec.describe 'User searches for code' do ...@@ -45,7 +45,7 @@ RSpec.describe 'User searches for code' do
expect(page).to have_selector('.results', text: 'Update capybara, rspec-rails, poltergeist to recent versions') expect(page).to have_selector('.results', text: 'Update capybara, rspec-rails, poltergeist to recent versions')
find("#L3").click find("#L3").click
expect(current_url).to match(/master\/.gitignore#L3/) expect(current_url).to match(%r{master/.gitignore#L3})
end end
it 'search mutiple words with refs switching' do it 'search mutiple words with refs switching' do
...@@ -63,7 +63,7 @@ RSpec.describe 'User searches for code' do ...@@ -63,7 +63,7 @@ RSpec.describe 'User searches for code' do
expect(page).to have_selector('.results', text: expected_result) expect(page).to have_selector('.results', text: expected_result)
expect(find_field('dashboard_search').value).to eq(search) expect(find_field('dashboard_search').value).to eq(search)
expect(find("#L1502")[:href]).to match(/v1.0.0\/files\/markdown\/ruby-style-guide.md#L1502/) expect(find("#L1502")[:href]).to match(%r{v1.0.0/files/markdown/ruby-style-guide.md#L1502})
end end
end end
......
...@@ -28,8 +28,8 @@ RSpec.describe 'Embedded Snippets' do ...@@ -28,8 +28,8 @@ RSpec.describe 'Embedded Snippets' do
blobs.each do |blob| blobs.each do |blob|
expect(page).to have_content(blob.path) expect(page).to have_content(blob.path)
expect(page.find(".snippet-file-content .blob-content[data-blob-id='#{blob.id}'] code")).to have_content(blob.data.squish) expect(page.find(".snippet-file-content .blob-content[data-blob-id='#{blob.id}'] code")).to have_content(blob.data.squish)
expect(page).to have_link('Open raw', href: /-\/snippets\/#{snippet.id}\/raw\/master\/#{blob.path}/) expect(page).to have_link('Open raw', href: %r{-/snippets/#{snippet.id}/raw/master/#{blob.path}})
expect(page).to have_link('Download', href: /-\/snippets\/#{snippet.id}\/raw\/master\/#{blob.path}\?inline=false/) expect(page).to have_link('Download', href: %r{-/snippets/#{snippet.id}/raw/master/#{blob.path}\?inline=false})
end end
end end
end end
......
...@@ -404,7 +404,7 @@ RSpec.describe DiffHelper do ...@@ -404,7 +404,7 @@ RSpec.describe DiffHelper do
it "returns a valid URL" do it "returns a valid URL" do
allow(helper).to receive(:safe_params).and_return(params) allow(helper).to receive(:safe_params).and_return(params)
expect(subject).to match(/foo\/bar\/-\/commit\/#{commit.sha}\/diff_for_path/) expect(subject).to match(%r{foo/bar/-/commit/#{commit.sha}/diff_for_path})
end end
end end
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe ReleasesHelper do RSpec.describe ReleasesHelper do
describe '#illustration' do describe '#illustration' do
it 'returns the correct image path' do it 'returns the correct image path' do
expect(helper.illustration).to match(/illustrations\/releases-(\w+)\.svg/) expect(helper.illustration).to match(%r{illustrations/releases-(\w+)\.svg})
end end
end end
......
...@@ -66,7 +66,7 @@ RSpec.describe Gitlab::Ci::Reports::TestCase, :aggregate_failures do ...@@ -66,7 +66,7 @@ RSpec.describe Gitlab::Ci::Reports::TestCase, :aggregate_failures do
end end
it '#attachment_url' do it '#attachment_url' do
expect(attachment_test_case.attachment_url).to match(/file\/some\/path.png/) expect(attachment_test_case.attachment_url).to match(%r{file/some/path.png})
end end
end end
......
...@@ -134,6 +134,6 @@ RSpec.describe Gitlab::Consul::Internal do ...@@ -134,6 +134,6 @@ RSpec.describe Gitlab::Consul::Internal do
end end
def stub_consul_discover_prometheus def stub_consul_discover_prometheus
stub_request(:get, /v1\/catalog\/service\/prometheus/) stub_request(:get, %r{v1/catalog/service/prometheus})
end end
end end
...@@ -26,7 +26,7 @@ RSpec.describe Gitlab::ImportExport::Shared do ...@@ -26,7 +26,7 @@ RSpec.describe Gitlab::ImportExport::Shared do
describe '#export_path' do describe '#export_path' do
it 'uses a random hash relative to project path' do it 'uses a random hash relative to project path' do
expect(subject.export_path).to match(/#{base_path}\h{32}\/\h{32}/) expect(subject.export_path).to match(%r{#{base_path}\h{32}/\h{32}})
end end
it 'memoizes the path' do it 'memoizes the path' do
...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::ImportExport::Shared do ...@@ -44,7 +44,7 @@ RSpec.describe Gitlab::ImportExport::Shared do
subject = described_class.new(group) subject = described_class.new(group)
base_path = %(/tmp/gitlab_exports/@groups/) base_path = %(/tmp/gitlab_exports/@groups/)
expect(subject.base_path).to match(/#{base_path}\h{2}\/\h{2}\/\h{64}/) expect(subject.base_path).to match(%r{#{base_path}\h{2}/\h{2}/\h{64}})
end end
end end
end end
......
...@@ -377,7 +377,7 @@ RSpec.describe Gitlab::Utils::UsageData do ...@@ -377,7 +377,7 @@ RSpec.describe Gitlab::Utils::UsageData do
shared_examples 'try to query Prometheus with given address' do shared_examples 'try to query Prometheus with given address' do
context 'Prometheus is ready' do context 'Prometheus is ready' do
before do before do
stub_request(:get, /\/-\/ready/) stub_request(:get, %r{/-/ready})
.to_return(status: 200, body: 'Prometheus is Ready.\n') .to_return(status: 200, body: 'Prometheus is Ready.\n')
end end
...@@ -387,7 +387,7 @@ RSpec.describe Gitlab::Utils::UsageData do ...@@ -387,7 +387,7 @@ RSpec.describe Gitlab::Utils::UsageData do
context 'Prometheus is not reachable through HTTPS' do context 'Prometheus is not reachable through HTTPS' do
before do before do
stub_request(:get, /https:\/\/.*/).to_raise(Errno::ECONNREFUSED) stub_request(:get, %r{https://.*}).to_raise(Errno::ECONNREFUSED)
end end
context 'Prometheus is reachable through HTTP' do context 'Prometheus is reachable through HTTP' do
...@@ -396,7 +396,7 @@ RSpec.describe Gitlab::Utils::UsageData do ...@@ -396,7 +396,7 @@ RSpec.describe Gitlab::Utils::UsageData do
context 'Prometheus is not reachable through HTTP' do context 'Prometheus is not reachable through HTTP' do
before do before do
stub_request(:get, /http:\/\/.*/).to_raise(Errno::ECONNREFUSED) stub_request(:get, %r{http://.*}).to_raise(Errno::ECONNREFUSED)
end end
it_behaves_like 'does not query data from Prometheus' it_behaves_like 'does not query data from Prometheus'
...@@ -406,7 +406,7 @@ RSpec.describe Gitlab::Utils::UsageData do ...@@ -406,7 +406,7 @@ RSpec.describe Gitlab::Utils::UsageData do
context 'Prometheus is not ready' do context 'Prometheus is not ready' do
before do before do
stub_request(:get, /\/-\/ready/) stub_request(:get, %r{/-/ready})
.to_return(status: 503, body: 'Service Unavailable') .to_return(status: 503, body: 'Service Unavailable')
end end
......
...@@ -177,7 +177,7 @@ RSpec.describe Ci::BuildRunnerPresenter do ...@@ -177,7 +177,7 @@ RSpec.describe Ci::BuildRunnerPresenter do
end end
it 'uses a SHA in the persistent refspec' do it 'uses a SHA in the persistent refspec' do
expect(subject[0]).to match(/^\+[0-9a-f]{40}:refs\/pipelines\/[0-9]+$/) expect(subject[0]).to match(%r{^\+[0-9a-f]{40}:refs/pipelines/[0-9]+$})
end end
context 'when ref is tag' do context 'when ref is tag' do
......
...@@ -877,7 +877,7 @@ RSpec.describe API::Projects do ...@@ -877,7 +877,7 @@ RSpec.describe API::Projects do
get api(url, current_user), params: params get api(url, current_user), params: params
link = response.header['Link'] link = response.header['Link']
url = link&.match(/<[^>]+(\/projects\?[^>]+)>; rel="next"/) do |match| url = link&.match(%r{<[^>]+(/projects\?[^>]+)>; rel="next"}) do |match|
match[1] match[1]
end end
......
...@@ -37,7 +37,7 @@ RSpec.describe Jira::Requests::Projects::ListService do ...@@ -37,7 +37,7 @@ RSpec.describe Jira::Requests::Projects::ListService do
context 'when validations and params are ok' do context 'when validations and params are ok' do
let(:response_headers) { { 'content-type' => 'application/json' } } let(:response_headers) { { 'content-type' => 'application/json' } }
let(:response_body) { [].to_json } let(:response_body) { [].to_json }
let(:expected_url_pattern) { /.*jira.example.com\/rest\/api\/2\/project/ } let(:expected_url_pattern) { %r{.*jira.example.com/rest/api/2/project} }
before do before do
stub_request(:get, expected_url_pattern).to_return(status: 200, body: response_body, headers: response_headers) stub_request(:get, expected_url_pattern).to_return(status: 200, body: response_body, headers: response_headers)
...@@ -60,7 +60,7 @@ RSpec.describe Jira::Requests::Projects::ListService do ...@@ -60,7 +60,7 @@ RSpec.describe Jira::Requests::Projects::ListService do
context 'when jira runs on a subpath' do context 'when jira runs on a subpath' do
let(:jira_integration) { create(:jira_integration, url: 'http://jira.example.com/jira') } let(:jira_integration) { create(:jira_integration, url: 'http://jira.example.com/jira') }
let(:expected_url_pattern) { /.*jira.example.com\/jira\/rest\/api\/2\/project/ } let(:expected_url_pattern) { %r{.*jira.example.com/jira/rest/api/2/project} }
it 'takes the subpath into account' do it 'takes the subpath into account' do
expect(subject.success?).to be_truthy expect(subject.success?).to be_truthy
......
...@@ -197,7 +197,7 @@ RSpec.configure do |config| ...@@ -197,7 +197,7 @@ RSpec.configure do |config|
raise JSConsoleError, message raise JSConsoleError, message
end end
rescue Selenium::WebDriver::Error::WebDriverError => error rescue Selenium::WebDriver::Error::WebDriverError => error
if error.message =~ /unknown command: session\/[0-9a-zA-Z]+(?:\/se)?\/log/ if error.message =~ %r{unknown command: session/[0-9a-zA-Z]+(?:/se)?/log}
message = "Unable to access Chrome javascript console logs. You may be using an outdated version of ChromeDriver." message = "Unable to access Chrome javascript console logs. You may be using an outdated version of ChromeDriver."
raise JSConsoleError, message raise JSConsoleError, message
else else
......
...@@ -31,7 +31,7 @@ module GrafanaApiHelpers ...@@ -31,7 +31,7 @@ module GrafanaApiHelpers
end end
def stub_all_grafana_proxy_requests(base_url) def stub_all_grafana_proxy_requests(base_url)
stub_request(:any, /#{base_url}\/api\/datasources\/proxy/) stub_request(:any, %r{#{base_url}/api/datasources/proxy})
.to_return( .to_return(
status: 200, status: 200,
body: fixture_file('grafana/proxy_response.json'), body: fixture_file('grafana/proxy_response.json'),
......
...@@ -15,7 +15,7 @@ class RequireMigration ...@@ -15,7 +15,7 @@ class RequireMigration
end end
MIGRATION_FOLDERS = %w[db/migrate db/post_migrate].freeze MIGRATION_FOLDERS = %w[db/migrate db/post_migrate].freeze
SPEC_FILE_PATTERN = /.+\/(?<file_name>.+)_spec\.rb/.freeze SPEC_FILE_PATTERN = %r{.+/(?<file_name>.+)_spec\.rb}.freeze
class << self class << self
def require_migration!(file_name) def require_migration!(file_name)
......
...@@ -100,7 +100,7 @@ RSpec.describe 'layouts/_head' do ...@@ -100,7 +100,7 @@ RSpec.describe 'layouts/_head' do
it 'add a Matomo Javascript' do it 'add a Matomo Javascript' do
render render
expect(rendered).to match(/<script.*>.*var u="\/\/#{matomo_host}\/".*<\/script>/m) expect(rendered).to match(%r{<script.*>.*var u="//#{matomo_host}/".*</script>}m)
expect(rendered).to match(%r(<noscript>.*<img src="//#{matomo_host}/matomo.php.*</noscript>)) expect(rendered).to match(%r(<noscript>.*<img src="//#{matomo_host}/matomo.php.*</noscript>))
expect(rendered).not_to include('_paq.push(["disableCookies"])') expect(rendered).not_to include('_paq.push(["disableCookies"])')
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment