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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
ea9c7bee
Commit
ea9c7bee
authored
Aug 10, 2018
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix preview of commit tagging
parent
82337dd6
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 @
ea9c7bee
...
@@ -24,8 +24,6 @@ module QuickActions
...
@@ -24,8 +24,6 @@ module QuickActions
end
end
def
commit
(
type_id
)
def
commit
(
type_id
)
return
nil
unless
type_id
project
.
commit
(
type_id
)
project
.
commit
(
type_id
)
end
end
end
end
...
...
spec/features/commits/user_uses_slash_commands_spec.rb
View file @
ea9c7bee
...
@@ -32,5 +32,15 @@ describe 'Commit > User uses quick actions', :js do
...
@@ -32,5 +32,15 @@ describe 'Commit > User uses quick actions', :js do
expect
(
page
).
to
have_content
tag_message
expect
(
page
).
to
have_content
tag_message
expect
(
page
).
to
have_content
truncated_commit_sha
expect
(
page
).
to
have_content
truncated_commit_sha
end
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
end
end
spec/services/quick_actions/target_service_spec.rb
View file @
ea9c7bee
...
@@ -57,13 +57,19 @@ describe QuickActions::TargetService do
...
@@ -57,13 +57,19 @@ describe QuickActions::TargetService do
context
'for commit'
do
context
'for commit'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:target
)
{
project
.
commit
}
let
(
:target
)
{
project
.
commit
.
parent
}
let
(
:target_id
)
{
target
.
sha
}
let
(
:target_id
)
{
target
.
sha
}
let
(
:type
)
{
'Commit'
}
let
(
:type
)
{
'Commit'
}
it_behaves_like
'find target'
it_behaves_like
'find target'
it_behaves_like
'no target'
,
type_id:
'invalid_sha'
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
end
context
'for unknown type'
do
context
'for unknown type'
do
...
...
spec/support/helpers/features/notes_helpers.rb
View file @
ea9c7bee
...
@@ -20,6 +20,13 @@ module Spec
...
@@ -20,6 +20,13 @@ module Spec
end
end
end
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
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