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
Tatuya Kamada
gitlab-ce
Commits
709a5667
Commit
709a5667
authored
Mar 22, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec/features/participants_autocomplete_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
f879e40d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
67 deletions
+28
-67
spec/features/participants_autocomplete_spec.rb
spec/features/participants_autocomplete_spec.rb
+28
-67
No files found.
spec/features/participants_autocomplete_spec.rb
View file @
709a5667
require
'spec_helper'
require
'spec_helper'
feature
'Member autocomplete'
,
feature:
true
do
feature
'Member autocomplete'
,
:js
do
include
WaitForAjax
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:participant
)
{
create
(
:user
)
}
let
(
:author
)
{
create
(
:user
)
}
let
(
:author
)
{
create
(
:user
)
}
let
(
:note
)
{
create
(
:note
,
noteable:
noteable
,
project:
noteable
.
project
)
}
before
do
before
do
allow_any_instance_of
(
Commit
).
to
receive
(
:author
).
and_return
(
author
)
note
# actually create the note
login_as
user
login_as
(
user
)
end
end
shared_examples
"open suggestions"
do
shared_examples
"open suggestions when typing @"
do
it
'displays suggestions'
do
before
do
expect
(
page
).
to
have_selector
(
'.atwho-view'
,
visible:
true
)
page
.
within
(
'.new-note'
)
do
end
find
(
'#note_note'
).
send_keys
(
'@'
)
it
'suggests author'
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
expect
(
page
).
to
have_content
(
author
.
username
)
end
end
end
end
it
'suggests
participant
'
do
it
'suggests
noteable author and note author
'
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
page
.
within
(
'.atwho-view'
,
visible:
true
)
do
expect
(
page
).
to
have_content
(
participant
.
username
)
expect
(
page
).
to
have_content
(
author
.
username
)
expect
(
page
).
to
have_content
(
note
.
author
.
username
)
end
end
end
end
end
end
context
'adding a new note on a Issue'
,
js:
true
do
context
'adding a new note on a Issue'
do
let
(
:noteable
)
{
create
(
:issue
,
author:
author
,
project:
project
)
}
before
do
before
do
issue
=
create
(
:issue
,
author:
author
,
project:
project
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
noteable
)
create
(
:note
,
note:
'Ultralight Beam'
,
noteable:
issue
,
project:
project
,
author:
participant
)
visit_issue
(
project
,
issue
)
end
end
context
'when typing @'
do
include_examples
"open suggestions when typing @"
include_examples
"open suggestions"
before
do
open_member_suggestions
end
end
end
end
context
'adding a new note on a Merge Request '
,
js:
true
do
context
'adding a new note on a Merge Request'
do
let
(
:noteable
)
do
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
author:
author
)
end
before
do
before
do
merge
=
create
(
:merge_request
,
source_project:
project
,
target_project:
project
,
author:
author
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
noteable
)
create
(
:note
,
note:
'Ultralight Beam'
,
noteable:
merge
,
project:
project
,
author:
participant
)
visit_merge_request
(
project
,
merge
)
end
end
context
'when typing @'
do
include_examples
"open suggestions when typing @"
include_examples
"open suggestions"
before
do
open_member_suggestions
end
end
end
end
context
'adding a new note on a Commit '
,
js:
true
do
context
'adding a new note on a Commit'
do
let
(
:commit
)
{
project
.
commit
}
let
(
:noteable
)
{
project
.
commit
}
let
(
:note
)
{
create
(
:note_on_commit
,
project:
project
,
commit_id:
project
.
commit
.
id
)
}
before
do
before
do
allow
(
commit
).
to
receive
(
:author
).
and_return
(
author
)
allow_any_instance_of
(
Commit
).
to
receive
(
:author
).
and_return
(
author
)
create
(
:note_on_commit
,
author:
participant
,
project:
project
,
commit_id:
project
.
repository
.
commit
.
id
,
note:
'No More Parties in LA'
)
visit_commit
(
project
,
commit
)
end
context
'when typing @'
do
include_examples
"open suggestions"
before
do
open_member_suggestions
end
end
end
def
open_member_suggestions
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
noteable
)
page
.
within
(
'.new-note'
)
do
find
(
'#note_note'
).
send_keys
(
'@'
)
end
end
wait_for_ajax
end
def
visit_issue
(
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
def
visit_merge_request
(
project
,
merge
)
visit
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge
)
end
def
visit_commit
(
project
,
commit
)
include_examples
"open suggestions when typing @"
visit
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
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