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
65df166b
Commit
65df166b
authored
Jun 30, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge form_ee_spec.rb into ee/form_spec.rb
parent
4c1af6cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
102 deletions
+75
-102
spec/features/issues/ee/form_spec.rb
spec/features/issues/ee/form_spec.rb
+75
-2
spec/features/issues/form_ee_spec.rb
spec/features/issues/form_ee_spec.rb
+0
-100
No files found.
spec/features/issues/ee/form_spec.rb
View file @
65df166b
...
...
@@ -23,7 +23,80 @@ describe 'New/edit issue', :feature, :js do
context
'new issue'
do
before
do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
visit
new_project_issue_path
(
project
)
end
describe
'shorten users API pagination limit'
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
=
EE
::
FormHelper
.
instance_method
(
:issue_assignees_dropdown_options
)
allow_any_instance_of
(
EE
::
FormHelper
).
to
receive
(
:issue_assignees_dropdown_options
).
and_wrap_original
do
|
original
,
*
args
|
options
=
original_issue_dropdown_options
.
bind
(
original
.
receiver
).
call
(
*
args
)
options
[
:data
][
:per_page
]
=
2
options
end
visit
new_project_issue_path
(
project
)
click_button
'Unassigned'
wait_for_requests
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
before
do
click_button
'Unassigned'
wait_for_requests
end
it
'unselects other assignees when unassigned is selected'
do
page
.
within
'.dropdown-menu-user'
do
click_link
user2
.
name
end
page
.
within
'.dropdown-menu-user'
do
click_link
'Unassigned'
end
expect
(
find
(
'input[name="issue[assignee_ids][]"]'
,
visible:
false
).
value
).
to
match
(
'0'
)
end
it
'toggles assign to me when current user is selected and unselected'
do
page
.
within
'.dropdown-menu-user'
do
click_link
user
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
,
visible:
false
)).
not_to
be_visible
page
.
within
(
'.dropdown-menu-user'
)
do
click_link
user
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
)).
to
be_visible
end
end
it
'allows user to create new issue'
do
...
...
@@ -140,7 +213,7 @@ describe 'New/edit issue', :feature, :js do
context
'edit issue'
do
before
do
visit
edit_
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
visit
edit_
project_issue_path
(
project
,
issue
)
end
it
'allows user to update issue'
do
...
...
spec/features/issues/form_ee_spec.rb
deleted
100644 → 0
View file @
4c1af6cc
require
'rails_helper'
describe
'New/edit issue (EE)'
,
:feature
,
:js
do
include
GitlabRoutingHelper
include
ActionView
::
Helpers
::
JavaScriptHelper
include
FormHelper
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user2
)
{
create
(
:user
)}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:label
)
{
create
(
:label
,
project:
project
)
}
let!
(
:label2
)
{
create
(
:label
,
project:
project
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
,
assignees:
[
user
],
milestone:
milestone
)
}
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user2
,
:master
]
gitlab_sign_in
(
user
)
end
context
'new issue'
do
before
do
visit
new_project_issue_path
(
project
)
end
describe
'shorten users API pagination limit'
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
=
EE
::
FormHelper
.
instance_method
(
:issue_assignees_dropdown_options
)
allow_any_instance_of
(
EE
::
FormHelper
).
to
receive
(
:issue_assignees_dropdown_options
).
and_wrap_original
do
|
original
,
*
args
|
options
=
original_issue_dropdown_options
.
bind
(
original
.
receiver
).
call
(
*
args
)
options
[
:data
][
:per_page
]
=
2
options
end
visit
new_project_issue_path
(
project
)
click_button
'Unassigned'
wait_for_requests
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
before
do
click_button
'Unassigned'
wait_for_requests
end
it
'unselects other assignees when unassigned is selected'
do
page
.
within
'.dropdown-menu-user'
do
click_link
user2
.
name
end
page
.
within
'.dropdown-menu-user'
do
click_link
'Unassigned'
end
expect
(
find
(
'input[name="issue[assignee_ids][]"]'
,
visible:
false
).
value
).
to
match
(
'0'
)
end
it
'toggles assign to me when current user is selected and unselected'
do
page
.
within
'.dropdown-menu-user'
do
click_link
user
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
,
visible:
false
)).
not_to
be_visible
page
.
within
(
'.dropdown-menu-user'
)
do
click_link
user
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
)).
to
be_visible
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