Commit 9de175bf authored by Sean McGivern's avatar Sean McGivern

Add specs for single-letter external tracker refs

parent e63f76c9
......@@ -101,16 +101,25 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
context "redmine project" do
let(:project) { create(:redmine_project) }
before do
project.update!(issues_enabled: false)
end
context "with a hash prefix" do
let(:issue) { ExternalIssue.new("#123", project) }
let(:reference) { issue.to_reference }
before do
project.issues_enabled = false
project.save!
it_behaves_like "external issue tracker"
end
context "with a single-letter prefix" do
let(:issue) { ExternalIssue.new("T-123", project) }
let(:reference) { issue.to_reference }
it_behaves_like "external issue tracker"
end
end
context "jira project" do
let(:project) { create(:jira_project) }
......@@ -122,6 +131,15 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
it_behaves_like "external issue tracker"
end
context "with a single-letter prefix" do
let(:issue) { ExternalIssue.new("J-123", project) }
it "ignores reference" do
exp = act = "Issue #{reference}"
expect(filter(act).to_html).to eq exp
end
end
context "with wrong markdown" do
let(:issue) { ExternalIssue.new("#123", project) }
......
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