Commit 7b852ec8 authored by Ethan Urie's avatar Ethan Urie

Merge branch 'epic-6767-f-refactor-IncludeUrlHelpers' into 'master'

Stop using UrlHelper includes in specs

See merge request gitlab-org/gitlab!82184
parents ebad020e 491801ef
---
Rails/IncludeUrlHelper:
Exclude:
- ee/spec/helpers/ee/projects/security/configuration_helper_spec.rb
- ee/spec/lib/banzai/filter/cross_project_issuable_information_filter_spec.rb
- spec/helpers/merge_requests_helper_spec.rb
- spec/helpers/nav/top_nav_helper_spec.rb
- spec/helpers/notify_helper_spec.rb
- spec/lib/banzai/filter/reference_redactor_filter_spec.rb
- spec/lib/banzai/reference_redactor_spec.rb
......@@ -3,8 +3,6 @@
require 'spec_helper'
RSpec.describe EE::Projects::Security::ConfigurationHelper do
include ActionView::Helpers::UrlHelper
let_it_be(:project) { create(:project) }
let(:current_user) { create(:user) }
......
......@@ -3,7 +3,6 @@
require 'spec_helper'
RSpec.describe Banzai::Filter::CrossProjectIssuableInformationFilter do
include ActionView::Helpers::UrlHelper
include FilterSpecHelper
let(:user) { create(:user) }
......@@ -13,7 +12,7 @@ RSpec.describe Banzai::Filter::CrossProjectIssuableInformationFilter do
def create_link(issuable)
type = issuable.class.name.underscore.downcase
link_to(issuable.to_reference, '',
ActionController::Base.helpers.link_to(issuable.to_reference, '',
class: 'gfm has-tooltip',
title: issuable.title,
data: {
......
......@@ -3,7 +3,6 @@
require 'spec_helper'
RSpec.describe MergeRequestsHelper do
include ActionView::Helpers::UrlHelper
include ProjectForksHelper
describe '#state_name_with_icon' do
......
......@@ -3,8 +3,6 @@
require 'spec_helper'
RSpec.describe Nav::TopNavHelper do
include ActionView::Helpers::UrlHelper
let_it_be(:user) { build_stubbed(:user) }
let_it_be(:admin) { build_stubbed(:user, :admin) }
let_it_be(:external_user) { build_stubbed(:user, :external, can_create_group: false) }
......
......@@ -3,7 +3,6 @@
require 'spec_helper'
RSpec.describe NotifyHelper do
include ActionView::Helpers::UrlHelper
using RSpec::Parameterized::TableSyntax
describe 'merge_request_reference_link' do
......
......@@ -3,7 +3,6 @@
require 'spec_helper'
RSpec.describe Banzai::Filter::ReferenceRedactorFilter do
include ActionView::Helpers::UrlHelper
include FilterSpecHelper
it 'ignores non-GFM links' do
......@@ -14,7 +13,7 @@ RSpec.describe Banzai::Filter::ReferenceRedactorFilter do
end
def reference_link(data)
link_to('text', '', class: 'gfm', data: data)
ActionController::Base.helpers.link_to('text', '', class: 'gfm', data: data)
end
it 'skips when the skip_redaction flag is set' do
......
......@@ -106,13 +106,12 @@ RSpec.describe Banzai::ReferenceRedactor do
end
context 'when the user cannot read cross project' do
include ActionView::Helpers::UrlHelper
let(:project) { create(:project) }
let(:other_project) { create(:project, :public) }
def create_link(issuable)
type = issuable.class.name.underscore.downcase
link_to(issuable.to_reference, '',
ActionController::Base.helpers.link_to(issuable.to_reference, '',
class: 'gfm has-tooltip',
title: issuable.title,
data: {
......
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