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

Add specs for single-letter external tracker refs

parent e63f76c9
...@@ -101,15 +101,24 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do ...@@ -101,15 +101,24 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
context "redmine project" do context "redmine project" do
let(:project) { create(:redmine_project) } let(:project) { create(:redmine_project) }
let(:issue) { ExternalIssue.new("#123", project) }
let(:reference) { issue.to_reference }
before do before do
project.issues_enabled = false project.update!(issues_enabled: false)
project.save! end
context "with a hash prefix" do
let(:issue) { ExternalIssue.new("#123", project) }
let(:reference) { issue.to_reference }
it_behaves_like "external issue tracker"
end end
it_behaves_like "external issue tracker" 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 end
context "jira project" do context "jira project" do
...@@ -122,6 +131,15 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do ...@@ -122,6 +131,15 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
it_behaves_like "external issue tracker" it_behaves_like "external issue tracker"
end 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 context "with wrong markdown" do
let(:issue) { ExternalIssue.new("#123", project) } 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