Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
9de175bf
Commit
9de175bf
authored
Nov 06, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for single-letter external tracker refs
parent
e63f76c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
spec/lib/banzai/filter/external_issue_reference_filter_spec.rb
...lib/banzai/filter/external_issue_reference_filter_spec.rb
+23
-5
No files found.
spec/lib/banzai/filter/external_issue_reference_filter_spec.rb
View file @
9de175bf
...
@@ -101,16 +101,25 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
...
@@ -101,16 +101,25 @@ describe Banzai::Filter::ExternalIssueReferenceFilter do
context
"redmine project"
do
context
"redmine project"
do
let
(
:project
)
{
create
(
:redmine_project
)
}
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
(
:issue
)
{
ExternalIssue
.
new
(
"#123"
,
project
)
}
let
(
:reference
)
{
issue
.
to_reference
}
let
(
:reference
)
{
issue
.
to_reference
}
before
do
it_behaves_like
"external issue tracker"
project
.
issues_enabled
=
false
project
.
save!
end
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"
it_behaves_like
"external issue tracker"
end
end
end
context
"jira project"
do
context
"jira project"
do
let
(
:project
)
{
create
(
:jira_project
)
}
let
(
:project
)
{
create
(
:jira_project
)
}
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment