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
92f8c7d8
Commit
92f8c7d8
authored
Dec 05, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed clone buttons adding description when append_link is false
parent
4475212a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
button_helper.rb
app/helpers/button_helper.rb
+1
-1
_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+1
-1
button_helper_spec.rb
spec/helpers/button_helper_spec.rb
+28
-0
No files found.
app/helpers/button_helper.rb
View file @
92f8c7d8
...
...
@@ -84,7 +84,7 @@ module ButtonHelper
button_content
<<
content_tag
(
:span
,
description
,
class:
'dropdown-menu-inner-content'
)
if
description
content_tag
(
href
?
:
a
:
:span
),
button_content
,
(
href
?
button_content
:
title
)
,
class:
"
#{
title
.
downcase
}
-selector"
,
href:
(
href
if
href
)
end
...
...
app/views/shared/_clone_panel.html.haml
View file @
92f8c7d8
...
...
@@ -3,7 +3,7 @@
.git-clone-holder.input-group
.input-group-btn
-
if
allowed_protocols_present?
.clone-dropdown-btn.btn
.btn-static
.clone-dropdown-btn.btn
%span
=
enabled_project_button
(
project
,
enabled_protocol
)
-
else
...
...
spec/helpers/button_helper_spec.rb
View file @
92f8c7d8
...
...
@@ -92,6 +92,34 @@ describe ButtonHelper do
end
end
describe
'ssh and http clone buttons'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
build_stubbed
(
:project
)
}
def
http_button_element
element
=
helper
.
http_clone_button
(
project
,
append_link:
false
)
Nokogiri
::
HTML
::
DocumentFragment
.
parse
(
element
).
first_element_child
end
def
ssh_button_element
element
=
helper
.
ssh_clone_button
(
project
,
append_link:
false
)
Nokogiri
::
HTML
::
DocumentFragment
.
parse
(
element
).
first_element_child
end
before
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
end
it
'only shows the title of any of the clone buttons when append_link is false'
do
expect
(
http_button_element
.
text
).
to
eq
(
'HTTP'
)
expect
(
http_button_element
.
search
(
'.dropdown-menu-inner-content'
).
first
).
to
eq
(
nil
)
expect
(
ssh_button_element
.
text
).
to
eq
(
'SSH'
)
expect
(
ssh_button_element
.
search
(
'.dropdown-menu-inner-content'
).
first
).
to
eq
(
nil
)
end
end
describe
'clipboard_button'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
build_stubbed
(
: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