BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
31ea72b6
Commit
31ea72b6
authored
Apr 21, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also test against external-issue for deleted projects
This is based on:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10841
parent
b43cabaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
redactor_spec.rb
spec/lib/banzai/redactor_spec.rb
+17
-5
No files found.
spec/lib/banzai/redactor_spec.rb
View file @
31ea72b6
...
...
@@ -43,12 +43,24 @@ describe Banzai::Redactor do
end
context
'when project is in pending delete'
do
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:redactor
)
{
described_class
.
new
(
project
,
user
)
}
before
do
project
.
update
(
pending_delete:
true
)
end
it
'redacts an issue attached'
do
project
.
pending_delete
=
true
project
.
save
issue
=
create
(
:issue
,
project:
project
)
redactor
=
described_class
.
new
(
project
,
user
)
doc
=
Nokogiri
::
HTML
.
fragment
(
"<a class='gfm' data-reference-type='issue' data-project=
\"
#{
project
.
id
}
\"
data-issue=
\"
#{
issue
.
id
}
\"
>foo</a>"
)
doc
=
Nokogiri
::
HTML
.
fragment
(
"<a class='gfm' data-reference-type='issue' data-issue='
#{
issue
.
id
}
'>foo</a>"
)
redactor
.
redact
([
doc
])
expect
(
doc
.
to_html
).
to
eq
(
'foo'
)
end
it
'redacts an external issue'
do
doc
=
Nokogiri
::
HTML
.
fragment
(
"<a class='gfm' data-reference-type='issue' data-external-issue='
#{
issue
.
id
}
' data-project='
#{
project
.
id
}
'>foo</a>"
)
redactor
.
redact
([
doc
])
expect
(
doc
.
to_html
).
to
eq
(
'foo'
)
...
...
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