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
6e5a7a2a
Commit
6e5a7a2a
authored
May 01, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] Fix rspec for form_spec
parent
321dcc2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
app/views/shared/issuable/form/_metadata.html.haml
app/views/shared/issuable/form/_metadata.html.haml
+2
-2
spec/features/issues/form_spec.rb
spec/features/issues/form_spec.rb
+10
-6
No files found.
app/views/shared/issuable/form/_metadata.html.haml
View file @
6e5a7a2a
...
...
@@ -17,7 +17,7 @@
-
issuable
.
assignees
.
each
do
|
assignee
|
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[assignee_ids][]"
,
assignee
.
id
,
id:
nil
,
data:
{
meta:
assignee
.
name
}
-
options
=
{
toggle_class:
"js-user-search js-a
uthor-search"
,
title:
'Select assignee'
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable dropdown-menu-author
"
,
-
options
=
{
toggle_class:
"js-user-search js-a
ssignee-search"
,
title:
'Select assignee'
,
filter:
true
,
dropdown_class:
"dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee
"
,
placeholder:
"Search users"
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
null_user:
true
,
current_user:
true
,
project_id:
issuable
.
project
.
try
(
:id
),
field_name:
"
#{
issuable
.
class
.
model_name
.
param_key
}
[assignee_ids][]"
,
default_label:
"Assignee"
}
}
-
options
[
:toggle_class
]
+=
' js-multiselect js-save-user-data'
...
...
@@ -29,7 +29,7 @@
-
options
[
:data
][
:current_user_info
]
=
current_user
.
to_json
(
only:
[
:id
,
:name
])
=
dropdown_tag
(
users_dropdown_label
(
issuable
.
assignees
),
options:
options
)
=
link_to
'Assign to me'
,
'#'
,
class:
"assign-to-me-link
#{
'hide'
if
issuable
.
assignee
_ids
.
split
(
', '
).
include?
(
current_user
.
id
)
}
"
=
link_to
'Assign to me'
,
'#'
,
class:
"assign-to-me-link
#{
'hide'
if
issuable
.
assignee
s
.
include?
(
current_user
)
}
"
-
else
=
form
.
label
:assignee_id
,
"Assignee"
,
class:
"control-label
#{
"col-lg-4"
if
has_due_date
}
"
.col-sm-10
{
class:
(
"col-lg-8"
if
has_due_date
)
}
...
...
spec/features/issues/form_spec.rb
View file @
6e5a7a2a
...
...
@@ -27,20 +27,24 @@ describe 'New/edit issue', feature: true, js: true do
fill_in
'issue_description'
,
with:
'title'
expect
(
find
(
'a'
,
text:
'Assign to me'
)).
to
be_visible
click_button
'
Assignee
'
click_button
'
Unassigned
'
page
.
within
'.dropdown-menu-user'
do
click_link
user2
.
name
end
expect
(
find
(
'input[name="issue[assignee_id]"]'
,
visible:
false
).
value
).
to
match
(
user2
.
id
.
to_s
)
expect
(
find
(
'input[name="issue[assignee_id
s][
]"]'
,
visible:
false
).
value
).
to
match
(
user2
.
id
.
to_s
)
page
.
within
'.js-assignee-search'
do
expect
(
page
).
to
have_content
user2
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
)).
to
be_visible
click_link
'Assign to me'
expect
(
find
(
'input[name="issue[assignee_id]"]'
,
visible:
false
).
value
).
to
match
(
user
.
id
.
to_s
)
assignee_ids
=
page
.
all
(
'input[name="issue[assignee_ids][]"]'
,
visible:
false
)
expect
(
assignee_ids
[
0
].
value
).
to
match
(
user2
.
id
.
to_s
)
expect
(
assignee_ids
[
1
].
value
).
to
match
(
user
.
id
.
to_s
)
page
.
within
'.js-assignee-search'
do
expect
(
page
).
to
have_content
user
.
name
expect
(
page
).
to
have_content
"
#{
user2
.
name
}
+ 1 more"
end
expect
(
find
(
'a'
,
text:
'Assign to me'
,
visible:
false
)).
not_to
be_visible
...
...
@@ -76,7 +80,7 @@ describe 'New/edit issue', feature: true, js: true do
page
.
within
'.issuable-sidebar'
do
page
.
within
'.assignee'
do
expect
(
page
).
to
have_content
user
.
name
expect
(
page
).
to
have_content
"2 Assignees"
end
page
.
within
'.milestone'
do
...
...
@@ -125,7 +129,7 @@ describe 'New/edit issue', feature: true, js: true do
end
it
'allows user to update issue'
do
expect
(
find
(
'input[name="issue[assignee_id]"]'
,
visible:
false
).
value
).
to
match
(
user
.
id
.
to_s
)
expect
(
find
(
'input[name="issue[assignee_id
s][
]"]'
,
visible:
false
).
value
).
to
match
(
user
.
id
.
to_s
)
expect
(
find
(
'input[name="issue[milestone_id]"]'
,
visible:
false
).
value
).
to
match
(
milestone
.
id
.
to_s
)
expect
(
find
(
'a'
,
text:
'Assign to me'
,
visible:
false
)).
not_to
be_visible
...
...
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