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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b1fd7238
Commit
b1fd7238
authored
Jan 06, 2022
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update snippet search badge to use pajamas
- use ruby badge helper Changelog: changed
parent
96d653f8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
app/helpers/snippets_helper.rb
app/helpers/snippets_helper.rb
+2
-5
spec/helpers/snippets_helper_spec.rb
spec/helpers/snippets_helper_spec.rb
+2
-1
No files found.
app/helpers/snippets_helper.rb
View file @
b1fd7238
...
...
@@ -26,11 +26,8 @@ module SnippetsHelper
return
unless
attrs
=
snippet_badge_attributes
(
snippet
)
icon_name
,
text
=
attrs
tag
.
span
(
class:
%w[badge badge-gray]
)
do
concat
(
sprite_icon
(
icon_name
,
size:
14
,
css_class:
'gl-vertical-align-middle'
))
concat
(
' '
)
concat
(
text
)
end
gl_badge_tag
(
text
,
icon:
icon_name
)
end
def
snippet_badge_attributes
(
snippet
)
...
...
spec/helpers/snippets_helper_spec.rb
View file @
b1fd7238
...
...
@@ -5,6 +5,7 @@ require 'spec_helper'
RSpec
.
describe
SnippetsHelper
do
include
Gitlab
::
Routing
include
IconsHelper
include
BadgesHelper
let_it_be
(
:public_personal_snippet
)
{
create
(
:personal_snippet
,
:public
,
:repository
)
}
let_it_be
(
:public_project_snippet
)
{
create
(
:project_snippet
,
:public
,
:repository
)
}
...
...
@@ -72,7 +73,7 @@ RSpec.describe SnippetsHelper do
let
(
:visibility
)
{
:private
}
it
'returns the snippet badge'
do
expect
(
subject
).
to
eq
"<span class=
\"
badge badge-gray
\"
>
#{
sprite_icon
(
'lock'
,
size:
14
,
css_class:
'gl-vertical-align-middle'
)
}
private</span>"
expect
(
subject
).
to
eq
gl_badge_tag
(
'private'
,
icon:
'lock'
)
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