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
Léo-Paul Géneau
gitlab-ce
Commits
75892aeb
Commit
75892aeb
authored
Jul 18, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for new/edit issue form
parent
c752ed06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
3 deletions
+88
-3
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+2
-2
app/views/shared/issuable/_label_dropdown.html.haml
app/views/shared/issuable/_label_dropdown.html.haml
+1
-1
spec/features/issues/form_spec.rb
spec/features/issues/form_spec.rb
+85
-0
No files found.
app/assets/javascripts/users_select.js.coffee
View file @
75892aeb
...
@@ -142,8 +142,8 @@ class @UsersSelect
...
@@ -142,8 +142,8 @@ class @UsersSelect
selectable
:
true
selectable
:
true
fieldName
:
$dropdown
.
data
(
'field-name'
)
fieldName
:
$dropdown
.
data
(
'field-name'
)
toggleLabel
:
(
selected
,
el
,
e
,
added
)
->
toggleLabel
:
(
selected
,
el
,
e
)
->
if
selected
and
'id'
of
selected
and
added
if
selected
and
'id'
of
selected
and
$
(
el
).
hasClass
(
'is-active'
)
if
selected
.
text
then
selected
.
text
else
selected
.
name
if
selected
.
text
then
selected
.
text
else
selected
.
name
else
else
defaultLabel
defaultLabel
...
...
app/views/shared/issuable/_label_dropdown.html.haml
View file @
75892aeb
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
),
type:
"button"
,
data:
dropdown_data
}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
class:
classes
.
join
(
' '
),
type:
"button"
,
data:
dropdown_data
}
%span
.dropdown-toggle-text
{
class:
(
"is-default"
if
selected
.
nil?
||
selected
.
to_a
.
size
==
0
)
}
%span
.dropdown-toggle-text
{
class:
(
"is-default"
if
selected
.
nil?
||
selected
.
to_a
.
size
==
0
)
}
=
h
(
multi_label_name
(
selected
.
to_a
,
h
(
selected_toggle
.
to_a
[
0
]),
"Label"
))
=
h
(
multi_label_name
(
selected
.
to_a
,
h
(
selected_toggle
.
to_a
[
0
]),
"Label
s
"
))
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
title:
"Filter by label"
,
show_footer:
show_footer
,
show_create:
show_create
}
=
render
partial:
"shared/issuable/label_page_default"
,
locals:
{
title:
"Filter by label"
,
show_footer:
show_footer
,
show_create:
show_create
}
...
...
spec/features/issues/form_spec.rb
0 → 100644
View file @
75892aeb
require
'rails_helper'
describe
'New/edit issue'
,
feature:
true
,
js:
true
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:user
)
{
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
,
assignee:
user
,
milestone:
milestone
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
end
context
'new issue'
do
before
do
visit
new_namespace_project_issue_path
(
project
.
namespace
,
project
)
end
it
'should allow user to create new issue'
do
fill_in
'issue_title'
,
with:
'title'
fill_in
'issue_description'
,
with:
'title'
click_button
'Assignee'
click_link
user
.
name
page
.
find
'.js-assignee-search'
do
expect
(
page
).
to
have_content
user
.
name
end
click_button
'Milestone'
click_link
milestone
.
title
page
.
find
'.js-milestone-select'
do
expect
(
page
).
to
have_content
milestone
.
title
end
click_button
'Labels'
click_link
label
.
title
click_link
label2
.
title
page
.
find
'.js-label-select'
do
expect
(
page
).
to
have_content
label2
.
title
end
click_button
'Submit issue'
page
.
find
'.issuable-sidebar'
do
expect
(
page
).
to
have_content
user
.
name
expect
(
page
).
to
have_content
milestone
.
title
expect
(
page
).
to
have_content
label
.
title
expect
(
page
).
to
have_content
label2
.
title
end
end
end
context
'edit issue'
do
before
do
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
it
'should allow user to update issue'
do
expect
(
page
).
to
have_content
user
.
name
expect
(
page
).
to
have_content
milestone
.
title
click_button
'Labels'
click_link
label
.
title
click_link
label2
.
title
page
.
find
'.js-label-select'
do
expect
(
page
).
to
have_content
label2
.
title
end
click_button
'Save changes'
page
.
find
'.issuable-sidebar'
do
expect
(
page
).
to
have_content
user
.
name
expect
(
page
).
to
have_content
milestone
.
title
expect
(
page
).
to
have_content
label
.
title
expect
(
page
).
to
have_content
label2
.
title
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