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
089f8174
Commit
089f8174
authored
Aug 10, 2018
by
Peter Leitzen
Committed by
Sean McGivern
Aug 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix preview of commit tagging
parent
7aff453c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
4 deletions
+25
-4
app/services/quick_actions/target_service.rb
app/services/quick_actions/target_service.rb
+0
-2
spec/features/commits/user_uses_slash_commands_spec.rb
spec/features/commits/user_uses_slash_commands_spec.rb
+10
-0
spec/services/quick_actions/target_service_spec.rb
spec/services/quick_actions/target_service_spec.rb
+8
-2
spec/support/helpers/features/notes_helpers.rb
spec/support/helpers/features/notes_helpers.rb
+7
-0
No files found.
app/services/quick_actions/target_service.rb
View file @
089f8174
...
...
@@ -24,8 +24,6 @@ module QuickActions
end
def
commit
(
type_id
)
return
nil
unless
type_id
project
.
commit
(
type_id
)
end
end
...
...
spec/features/commits/user_uses_slash_commands_spec.rb
View file @
089f8174
...
...
@@ -32,5 +32,15 @@ describe 'Commit > User uses quick actions', :js do
expect
(
page
).
to
have_content
tag_message
expect
(
page
).
to
have_content
truncated_commit_sha
end
describe
'preview'
,
:js
do
it
'removes quick action from note and explains it'
do
preview_note
(
"/tag
#{
tag_name
}
#{
tag_message
}
"
)
expect
(
page
).
not_to
have_content
'/tag'
expect
(
page
).
to
have_content
%{Tags this commit to #{tag_name} with "#{tag_message}"}
expect
(
page
).
to
have_content
tag_name
end
end
end
end
spec/services/quick_actions/target_service_spec.rb
View file @
089f8174
...
...
@@ -57,13 +57,19 @@ describe QuickActions::TargetService do
context
'for commit'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:target
)
{
project
.
commit
}
let
(
:target
)
{
project
.
commit
.
parent
}
let
(
:target_id
)
{
target
.
sha
}
let
(
:type
)
{
'Commit'
}
it_behaves_like
'find target'
it_behaves_like
'no target'
,
type_id:
'invalid_sha'
it_behaves_like
'no target'
,
type_id:
nil
context
'with nil target_id'
do
let
(
:target
)
{
project
.
commit
}
let
(
:target_id
)
{
nil
}
it_behaves_like
'find target'
end
end
context
'for unknown type'
do
...
...
spec/support/helpers/features/notes_helpers.rb
View file @
089f8174
...
...
@@ -20,6 +20,13 @@ module Spec
end
end
end
def
preview_note
(
text
)
page
.
within
(
'.js-main-target-form'
)
do
fill_in
(
'note[note]'
,
with:
text
)
click_on
(
'Preview'
)
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