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
Boxiang Sun
gitlab-ce
Commits
9d602609
Commit
9d602609
authored
Nov 19, 2018
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for entities autocomplete
parent
d179ffc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
7 deletions
+47
-7
spec/features/issues/gfm_autocomplete_spec.rb
spec/features/issues/gfm_autocomplete_spec.rb
+47
-7
No files found.
spec/features/issues/gfm_autocomplete_spec.rb
View file @
9d602609
...
...
@@ -9,7 +9,6 @@ describe 'GFM autocomplete', :js do
let
(
:project
)
{
create
(
:project
)
}
let
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'special+'
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:project_snippet
)
{
create
(
:project_snippet
,
project:
project
,
title:
'code snippet'
)
}
before
do
project
.
add_maintainer
(
user
)
...
...
@@ -334,16 +333,57 @@ describe 'GFM autocomplete', :js do
end
end
it
'shows project snippets'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note-body'
).
native
.
send_keys
(
'$'
)
end
shared_examples
'autocomplete suggestions'
do
it
'suggests objects correctly'
do
page
.
within
'.timeline-content-form'
do
find
(
'#note-body'
).
native
.
send_keys
(
object
.
class
.
reference_prefix
)
end
page
.
within
'.atwho-container'
do
expect
(
page
).
to
have_content
(
object
.
title
)
page
.
within
'.atwho-container'
do
expect
(
page
).
to
have_content
(
project_snippet
.
title
)
find
(
'ul li'
).
click
end
expect
(
find
(
'.new-note #note-body'
).
value
).
to
include
(
expected_body
)
end
end
context
'issues'
do
let
(
:object
)
{
issue
}
let
(
:expected_body
)
{
object
.
to_reference
}
it_behaves_like
'autocomplete suggestions'
end
context
'merge requests'
do
let
(
:object
)
{
create
(
:merge_request
,
source_project:
project
)
}
let
(
:expected_body
)
{
object
.
to_reference
}
it_behaves_like
'autocomplete suggestions'
end
context
'project snippets'
do
let!
(
:object
)
{
create
(
:project_snippet
,
project:
project
,
title:
'code snippet'
)
}
let
(
:expected_body
)
{
object
.
to_reference
}
it_behaves_like
'autocomplete suggestions'
end
context
'label'
do
let!
(
:object
)
{
label
}
let
(
:expected_body
)
{
object
.
title
}
it_behaves_like
'autocomplete suggestions'
end
context
'milestone'
do
let!
(
:object
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:expected_body
)
{
object
.
to_reference
}
it_behaves_like
'autocomplete suggestions'
end
private
def
expect_to_wrap
(
should_wrap
,
item
,
note
,
value
)
...
...
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