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
fc580935
Commit
fc580935
authored
Jul 17, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep #absolute_image_urls as a private instance method
parent
1e2c28ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
lib/gitlab/hook_data/base_builder.rb
lib/gitlab/hook_data/base_builder.rb
+3
-7
spec/lib/gitlab/hook_data/base_builder_spec.rb
spec/lib/gitlab/hook_data/base_builder_spec.rb
+10
-2
No files found.
lib/gitlab/hook_data/base_builder.rb
View file @
fc580935
...
@@ -17,7 +17,9 @@ module Gitlab
...
@@ -17,7 +17,9 @@ module Gitlab
@object
=
object
@object
=
object
end
end
def
self
.
absolute_image_urls
(
markdown_text
)
private
def
absolute_image_urls
(
markdown_text
)
return
markdown_text
unless
markdown_text
.
present?
return
markdown_text
unless
markdown_text
.
present?
markdown_text
.
gsub
(
MARKDOWN_SIMPLE_IMAGE
)
do
markdown_text
.
gsub
(
MARKDOWN_SIMPLE_IMAGE
)
do
...
@@ -31,12 +33,6 @@ module Gitlab
...
@@ -31,12 +33,6 @@ module Gitlab
end
end
end
end
end
end
private
def
absolute_image_urls
(
markdown_text
)
self
.
class
.
absolute_image_urls
(
markdown_text
)
end
end
end
end
end
end
end
spec/lib/gitlab/hook_data/base_builder_spec.rb
View file @
fc580935
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
HookData
::
BaseBuilder
do
describe
Gitlab
::
HookData
::
BaseBuilder
do
describe
'.absolute_image_urls'
do
describe
'#absolute_image_urls'
do
let
(
:subclass
)
do
Class
.
new
(
described_class
)
do
public
:absolute_image_urls
end
end
subject
{
subclass
.
new
(
nil
)
}
using
RSpec
::
Parameterized
::
TableSyntax
using
RSpec
::
Parameterized
::
TableSyntax
where
do
where
do
...
@@ -50,7 +58,7 @@ describe Gitlab::HookData::BaseBuilder do
...
@@ -50,7 +58,7 @@ describe Gitlab::HookData::BaseBuilder do
end
end
with_them
do
with_them
do
it
{
expect
(
described_class
.
absolute_image_urls
(
input
)).
to
eq
(
output
)
}
it
{
expect
(
subject
.
absolute_image_urls
(
input
)).
to
eq
(
output
)
}
end
end
end
end
end
end
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