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
cfb995ab
Commit
cfb995ab
authored
Apr 15, 2022
by
Taurie Davis
Committed by
Mayra Cabrera
Apr 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change snippet award emoji state from active to selected
Changelog: changed
parent
a6cbb088
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+1
-1
spec/helpers/issues_helper_spec.rb
spec/helpers/issues_helper_spec.rb
+2
-2
No files found.
app/helpers/issues_helper.rb
View file @
cfb995ab
...
@@ -91,7 +91,7 @@ module IssuesHelper
...
@@ -91,7 +91,7 @@ module IssuesHelper
if
!
can?
(
current_user
,
:award_emoji
,
awardable
)
if
!
can?
(
current_user
,
:award_emoji
,
awardable
)
"disabled"
"disabled"
elsif
current_user
&&
awards
.
find
{
|
a
|
a
.
user_id
==
current_user
.
id
}
elsif
current_user
&&
awards
.
find
{
|
a
|
a
.
user_id
==
current_user
.
id
}
"
active
"
"
selected
"
else
else
""
""
end
end
...
...
spec/helpers/issues_helper_spec.rb
View file @
cfb995ab
...
@@ -74,8 +74,8 @@ RSpec.describe IssuesHelper do
...
@@ -74,8 +74,8 @@ RSpec.describe IssuesHelper do
expect
(
helper
.
award_state_class
(
awardable
,
AwardEmoji
.
all
,
build
(
:user
))).
to
eq
(
'disabled'
)
expect
(
helper
.
award_state_class
(
awardable
,
AwardEmoji
.
all
,
build
(
:user
))).
to
eq
(
'disabled'
)
end
end
it
'returns
active string
for author'
do
it
'returns
selected class
for author'
do
expect
(
helper
.
award_state_class
(
awardable
,
AwardEmoji
.
all
,
upvote
.
user
)).
to
eq
(
'
active
'
)
expect
(
helper
.
award_state_class
(
awardable
,
AwardEmoji
.
all
,
upvote
.
user
)).
to
eq
(
'
selected
'
)
end
end
it
'is blank for a user that has access to the awardable'
do
it
'is blank for a user that has access to the awardable'
do
...
...
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