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
62c8fa78
Commit
62c8fa78
authored
Mar 12, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix snippet update error message
parent
b9ec8706
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
app/controllers/concerns/snippets_actions.rb
app/controllers/concerns/snippets_actions.rb
+3
-3
changelogs/unreleased/fj-fix-snippet-update-error-message.yml
...gelogs/unreleased/fj-fix-snippet-update-error-message.yml
+5
-0
spec/features/projects/snippets/user_updates_snippet_spec.rb
spec/features/projects/snippets/user_updates_snippet_spec.rb
+1
-1
spec/features/snippets/user_edits_snippet_spec.rb
spec/features/snippets/user_edits_snippet_spec.rb
+1
-1
No files found.
app/controllers/concerns/snippets_actions.rb
View file @
62c8fa78
...
...
@@ -30,9 +30,9 @@ module SnippetsActions
end
def
check_repository_error
repository_error
=
snippet
.
errors
.
delete
(
:repository
)
repository_error
s
=
Array
(
snippet
.
errors
.
delete
(
:repository
)
)
flash
.
now
[
:alert
]
=
repository_error
if
repository_error
recaptcha_check_with_fallback
(
repository_error
.
nil
?
)
{
render
:edit
}
flash
.
now
[
:alert
]
=
repository_error
s
.
first
if
repository_errors
.
present?
recaptcha_check_with_fallback
(
repository_error
s
.
empty
?
)
{
render
:edit
}
end
end
changelogs/unreleased/fj-fix-snippet-update-error-message.yml
0 → 100644
View file @
62c8fa78
---
title
:
Fix bug displaying snippet update error
merge_request
:
27082
author
:
type
:
fixed
spec/features/projects/snippets/user_updates_snippet_spec.rb
View file @
62c8fa78
...
...
@@ -38,7 +38,7 @@ describe 'Projects > Snippets > User updates a snippet' do
end
it
'renders edit page and displays the error'
do
expect
(
page
).
to
have_content
(
'Error updating the snippet'
)
expect
(
page
.
find
(
'.flash-container span'
).
text
).
to
eq
(
'Error updating the snippet'
)
expect
(
page
).
to
have_content
(
'Edit Snippet'
)
end
end
...
...
spec/features/snippets/user_edits_snippet_spec.rb
View file @
62c8fa78
...
...
@@ -71,7 +71,7 @@ describe 'User edits snippet', :js do
end
it
'renders edit page and displays the error'
do
expect
(
page
).
to
have_content
(
'Error updating the snippet'
)
expect
(
page
.
find
(
'.flash-container span'
).
text
).
to
eq
(
'Error updating the snippet'
)
expect
(
page
).
to
have_content
(
'Edit Snippet'
)
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