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
dd80b629
Commit
dd80b629
authored
Jun 07, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'improve-form-spec' into 'master'
Improve form spec See merge request !11879
parents
b845cfe8
8f64a5a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
30 deletions
+11
-30
spec/features/issues/form_spec.rb
spec/features/issues/form_spec.rb
+11
-30
No files found.
spec/features/issues/form_spec.rb
View file @
dd80b629
...
...
@@ -24,37 +24,17 @@ describe 'New/edit issue', :feature, :js do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
end
describe
'shorten users API pagination limit'
do
describe
'shorten users API pagination limit
(CE)
'
do
before
do
# Using `allow_any_instance_of`/`and_wrap_original`, `original` would
# somehow refer to the very block we defined to _wrap_ that method, instead of
# the original method, resulting in infinite recurison when called.
# This is likely a bug with helper modules included into dynamically generated view classes.
# To work around this, we have to hold on to and call to the original implementation manually.
original_issue_dropdown_options
=
FormHelper
.
instance_method
(
:issue_dropdown_options
)
allow_any_instance_of
(
FormHelper
).
to
receive
(
:issue_dropdown_options
).
and_wrap_original
do
|
original
,
*
args
|
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
=
original_issue_dropdown_options
.
bind
(
original
.
receiver
).
call
(
*
args
)
options
[
:data
][
:per_page
]
=
2
options
end
...
...
@@ -74,6 +54,7 @@ describe 'New/edit issue', :feature, :js do
click_link
user2
.
name
end
find
(
'.js-assignee-search'
).
click
find
(
'.js-dropdown-input-clear'
).
click
page
.
within
'.dropdown-menu-user'
do
...
...
@@ -83,7 +64,7 @@ describe 'New/edit issue', :feature, :js do
end
end
describe
'single assignee'
do
describe
'single assignee
(CE)
'
do
before
do
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