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
fa626ace
Commit
fa626ace
authored
May 26, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for selected assignees not showing up in dropdown
parent
a2c3d70b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
1 deletion
+64
-1
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+2
-1
spec/features/issues/form_spec.rb
spec/features/issues/form_spec.rb
+62
-0
No files found.
app/assets/javascripts/users_select.js
View file @
fa626ace
...
@@ -35,6 +35,7 @@ function UsersSelect(currentUser, els) {
...
@@ -35,6 +35,7 @@ function UsersSelect(currentUser, els) {
options
.
showCurrentUser
=
$dropdown
.
data
(
'
current-user
'
);
options
.
showCurrentUser
=
$dropdown
.
data
(
'
current-user
'
);
options
.
todoFilter
=
$dropdown
.
data
(
'
todo-filter
'
);
options
.
todoFilter
=
$dropdown
.
data
(
'
todo-filter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo-state-filter
'
);
options
.
todoStateFilter
=
$dropdown
.
data
(
'
todo-state-filter
'
);
options
.
perPage
=
$dropdown
.
data
(
'
per-page
'
);
showNullUser
=
$dropdown
.
data
(
'
null-user
'
);
showNullUser
=
$dropdown
.
data
(
'
null-user
'
);
defaultNullUser
=
$dropdown
.
data
(
'
null-user-default
'
);
defaultNullUser
=
$dropdown
.
data
(
'
null-user-default
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
...
@@ -665,7 +666,7 @@ UsersSelect.prototype.users = function(query, options, callback) {
...
@@ -665,7 +666,7 @@ UsersSelect.prototype.users = function(query, options, callback) {
url
:
url
,
url
:
url
,
data
:
{
data
:
{
search
:
query
,
search
:
query
,
per_page
:
20
,
per_page
:
options
.
perPage
||
20
,
active
:
true
,
active
:
true
,
project_id
:
options
.
projectId
||
null
,
project_id
:
options
.
projectId
||
null
,
group_id
:
options
.
groupId
||
null
,
group_id
:
options
.
groupId
||
null
,
...
...
spec/features/issues/form_spec.rb
View file @
fa626ace
...
@@ -4,6 +4,7 @@ describe 'New/edit issue', :feature, :js do
...
@@ -4,6 +4,7 @@ describe 'New/edit issue', :feature, :js do
include
GitlabRoutingHelper
include
GitlabRoutingHelper
include
ActionView
::
Helpers
::
JavaScriptHelper
include
ActionView
::
Helpers
::
JavaScriptHelper
include
WaitForAjax
include
WaitForAjax
include
FormHelper
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
...
@@ -24,6 +25,67 @@ describe 'New/edit issue', :feature, :js do
...
@@ -24,6 +25,67 @@ describe 'New/edit issue', :feature, :js do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
end
end
describe
'shorten users API pagination limit'
do
before
do
allow_any_instance_of
(
FormHelper
).
to
receive
(
:issue_dropdown_options
).
and_wrap_original
do
|
original
,
*
args
|
issuable
=
*
args
[
0
]
has_multiple_assignees
=
*
args
[
1
]
options
=
{
toggle_class:
'js-user-search js-assignee-search js-multiselect js-save-user-data'
,
title:
'Select assignee'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee'
,
placeholder:
'Search users'
,
data:
{
per_page:
1
,
null_user:
true
,
current_user:
true
,
project_id:
project
.
try
(
:id
),
field_name:
"issue[assignee_ids][]"
,
default_label:
'Assignee'
,
'max-select'
:
1
,
'dropdown-header'
:
'Assignee'
,
multi_select:
true
,
'input-meta'
:
'name'
,
'always-show-selectbox'
:
true
,
}
}
if
has_multiple_assignees
options
[
:title
]
=
'Select assignee(s)'
options
[
:data
][
:'dropdown-header'
]
=
'Assignee(s)'
options
[
:data
].
delete
(
:'max-select'
)
end
options
end
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
click_button
'Unassigned'
wait_for_ajax
end
it
'should display selected users even if they are not part of the original API call'
do
find
(
'.dropdown-input-field'
).
native
.
send_keys
user2
.
name
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_content
user2
.
name
click_link
user2
.
name
end
find
(
'.js-dropdown-input-clear'
).
click
page
.
within
'.dropdown-menu-user'
do
expect
(
page
).
to
have_content
user
.
name
expect
(
find
(
'.dropdown-menu-user a.is-active'
).
first
(
:xpath
,
'..'
)[
'data-user-id'
]).
to
eq
(
user2
.
id
.
to_s
)
end
end
end
describe
'multiple assignees'
do
describe
'multiple assignees'
do
before
do
before
do
click_button
'Unassigned'
click_button
'Unassigned'
...
...
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