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
9cd04e14
Commit
9cd04e14
authored
Oct 11, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all scoped_issues_board_spec integration tests GREEN
parent
7b93b8ae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
16 deletions
+30
-16
app/assets/javascripts/boards/components/sidebar/remove_issue.js
...ets/javascripts/boards/components/sidebar/remove_issue.js
+1
-1
app/services/boards/base_service.rb
app/services/boards/base_service.rb
+5
-0
app/services/boards/create_service.rb
app/services/boards/create_service.rb
+1
-0
app/services/boards/update_service.rb
app/services/boards/update_service.rb
+0
-5
spec/ee/spec/features/boards/scoped_issue_board_spec.rb
spec/ee/spec/features/boards/scoped_issue_board_spec.rb
+23
-10
No files found.
app/assets/javascripts/boards/components/sidebar/remove_issue.js
View file @
9cd04e14
...
...
@@ -46,7 +46,7 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
let
assigneeIds
=
issue
.
assignees
.
map
(
assignee
=>
assignee
.
id
)
.
filter
(
id
=>
id
!==
board
.
assignee
_
id
);
.
filter
(
id
=>
id
!==
board
.
assignee
.
id
);
if
(
assigneeIds
.
length
===
0
)
{
// for backend to explicitly set No Assignee
assigneeIds
=
[
'
0
'
];
...
...
app/services/boards/base_service.rb
View file @
9cd04e14
...
...
@@ -6,5 +6,10 @@ module Boards
def
initialize
(
parent
,
user
,
params
=
{})
@parent
,
@current_user
,
@params
=
parent
,
user
,
params
.
dup
end
def
set_assignee
assignee
=
User
.
find_by
(
id:
params
.
delete
(
:assignee_id
))
params
.
merge!
(
assignee:
assignee
)
end
end
end
app/services/boards/create_service.rb
View file @
9cd04e14
...
...
@@ -13,6 +13,7 @@ module Boards
end
def
create_board!
set_assignee
board
=
parent
.
boards
.
create
(
params
)
if
board
.
persisted?
...
...
app/services/boards/update_service.rb
View file @
9cd04e14
...
...
@@ -12,10 +12,5 @@ module Boards
board
.
update
(
params
)
end
def
set_assignee
assignee
=
User
.
find_by
(
id:
params
.
delete
(
:assignee_id
))
params
.
merge!
(
assignee:
assignee
)
end
end
end
spec/ee/spec/features/boards/scoped_issue_board_spec.rb
View file @
9cd04e14
...
...
@@ -24,7 +24,6 @@ describe 'Scoped issue boards', :js do
before
do
allow_any_instance_of
(
ApplicationHelper
).
to
receive
(
:collapsed_sidebar?
).
and_return
(
true
)
stub_licensed_features
(
multiple_issue_boards:
true
)
stub_licensed_features
(
group_issue_boards:
true
)
stub_licensed_features
(
scoped_issue_boards:
true
)
end
...
...
@@ -52,7 +51,6 @@ describe 'Scoped issue boards', :js do
it
'creates board to filtering by Any Milestone'
do
create_board_milestone
(
'Any Milestone'
)
expect
(
page
).
to
have_css
(
'.js-visual-token'
)
expect
(
find
(
'.tokens-container'
)).
to
have_content
(
""
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
3
)
end
...
...
@@ -82,7 +80,9 @@ describe 'Scoped issue boards', :js do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
xit
'only shows group labels in list on group boards'
do
it
'only shows group labels in list on group boards'
do
stub_licensed_features
(
group_issue_boards:
true
)
visit
group_boards_path
(
group
)
wait_for_requests
...
...
@@ -92,8 +92,10 @@ describe 'Scoped issue boards', :js do
click_link
'Create new board'
end
click_button
'Expand'
page
.
within
(
'.labels'
)
do
click_
link
'Edit'
click_
button
'Edit'
page
.
within
(
'.dropdown'
)
do
expect
(
page
).
to
have_content
(
group_label
.
title
)
expect
(
page
).
not_to
have_content
(
project_label
.
title
)
...
...
@@ -183,7 +185,6 @@ describe 'Scoped issue boards', :js do
it
'sets board milestone'
do
update_board_milestone
(
milestone
.
title
)
expect
(
page
).
to
have_css
(
'.js-visual-token'
)
expect
(
find
(
'.tokens-container'
)).
to
have_content
(
milestone
.
title
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
...
...
@@ -191,7 +192,6 @@ describe 'Scoped issue boards', :js do
it
'sets board to any milestone'
do
update_board_milestone
(
'Any Milestone'
)
expect
(
page
).
not_to
have_css
(
'.js-visual-token'
)
expect
(
find
(
'.tokens-container'
)).
not_to
have_content
(
milestone
.
title
)
find
(
'.card'
,
match: :first
)
...
...
@@ -272,11 +272,13 @@ describe 'Scoped issue boards', :js do
context
'group board'
do
it
'only shows group labels in list'
do
stub_licensed_features
(
group_issue_boards:
true
)
visit
group_boards_path
(
group
)
edit_board
.
click
page
.
within
(
".labels"
)
do
click_
link
'Edit'
page
.
within
(
'.labels'
)
do
click_
button
'Edit'
page
.
within
(
'.dropdown'
)
do
expect
(
page
).
to
have_content
(
group_label
.
title
)
expect
(
page
).
not_to
have_content
(
project_label
.
title
)
...
...
@@ -325,7 +327,7 @@ describe 'Scoped issue boards', :js do
end
it
'sets board to Any weight'
do
update_board_weight
(
'Any
w
eight'
)
update_board_weight
(
'Any
W
eight'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
4
)
end
...
...
@@ -347,6 +349,7 @@ describe 'Scoped issue boards', :js do
let!
(
:list
)
{
create
(
:list
,
board:
board
,
label:
project_label
,
position:
0
)
}
it
'removes issues milestone when removing from the board'
do
board
.
update
(
milestone:
milestone
,
assignee:
user
)
visit
project_boards_path
(
project
)
wait_for_requests
...
...
@@ -466,6 +469,8 @@ describe 'Scoped issue boards', :js do
end
end
click_on_board_modal
click_button
'Create'
expect
(
page
).
to
have_selector
(
'.board-list-loading'
)
expect
(
page
).
not_to
have_selector
(
'.board-list-loading'
)
...
...
@@ -475,12 +480,20 @@ describe 'Scoped issue boards', :js do
edit_board
.
click
page
.
within
(
".
#{
filter
}
"
)
do
click_
link
'Edit'
click_
button
'Edit'
click_link
value
end
click_on_board_modal
click_button
'Save'
expect
(
page
).
to
have_selector
(
'.board-list-loading'
)
expect
(
page
).
not_to
have_selector
(
'.board-list-loading'
)
end
# Click on modal to make sure the dropdown is closed (e.g. label scenario)
#
def
click_on_board_modal
find
(
'.board-config-modal'
).
click
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