Commit 25473051 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'pl-spec-banzai-external-ref-filter-perf' into 'master'

Speed up banzai external issue reference filter specs

See merge request gitlab-org/gitlab!43052
parents 1c1a6dde e256ab91
...@@ -5,6 +5,8 @@ require 'spec_helper' ...@@ -5,6 +5,8 @@ require 'spec_helper'
RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do
include FilterSpecHelper include FilterSpecHelper
let_it_be_with_refind(:project) { create(:project) }
shared_examples_for "external issue tracker" do shared_examples_for "external issue tracker" do
it_behaves_like 'a reference containing an element node' it_behaves_like 'a reference containing an element node'
...@@ -116,7 +118,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do ...@@ -116,7 +118,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do
end end
context "redmine project" do context "redmine project" do
let(:project) { create(:redmine_project) } let_it_be(:service) { create(:redmine_service, project: project) }
before do before do
project.update!(issues_enabled: false) project.update!(issues_enabled: false)
...@@ -138,7 +140,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do ...@@ -138,7 +140,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do
end end
context "youtrack project" do context "youtrack project" do
let(:project) { create(:youtrack_project) } let_it_be(:service) { create(:youtrack_service, project: project) }
before do before do
project.update!(issues_enabled: false) project.update!(issues_enabled: false)
...@@ -181,7 +183,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do ...@@ -181,7 +183,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do
end end
context "jira project" do context "jira project" do
let(:project) { create(:jira_project) } let_it_be(:service) { create(:jira_service, project: project) }
let(:reference) { issue.to_reference } let(:reference) { issue.to_reference }
context "with right markdown" do context "with right markdown" do
...@@ -210,7 +212,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do ...@@ -210,7 +212,7 @@ RSpec.describe Banzai::Filter::ExternalIssueReferenceFilter do
end end
context "ewm project" do context "ewm project" do
let_it_be(:project) { create(:ewm_project) } let_it_be(:service) { create(:ewm_service, project: project) }
before do before do
project.update!(issues_enabled: false) project.update!(issues_enabled: false)
......
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