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
051c8d63
Commit
051c8d63
authored
Mar 29, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Multiple issue assignees] fix spec/features/issues/csv_spec.rb
parent
489b42f0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
app/finders/issues_finder.rb
app/finders/issues_finder.rb
+2
-2
app/models/issue.rb
app/models/issue.rb
+1
-1
app/services/issues/export_csv_service.rb
app/services/issues/export_csv_service.rb
+1
-1
db/fixtures/development/09_issues.rb
db/fixtures/development/09_issues.rb
+1
-1
spec/features/issues/csv_spec.rb
spec/features/issues/csv_spec.rb
+2
-2
No files found.
app/finders/issues_finder.rb
View file @
051c8d63
...
@@ -31,12 +31,12 @@ class IssuesFinder < IssuableFinder
...
@@ -31,12 +31,12 @@ class IssuesFinder < IssuableFinder
return
Issue
.
all
if
user
.
admin_or_auditor?
return
Issue
.
all
if
user
.
admin_or_auditor?
Issue
.
where
(
'
Issue
.
w
ith_assignees
.
w
here
(
'
issues.confidential IS NULL
issues.confidential IS NULL
OR issues.confidential IS FALSE
OR issues.confidential IS FALSE
OR (issues.confidential = TRUE
OR (issues.confidential = TRUE
AND (issues.author_id = :user_id
AND (issues.author_id = :user_id
OR issue
s.assignee
_id = :user_id
OR issue
_assignees.user
_id = :user_id
OR issues.project_id IN(:project_ids)))'
,
OR issues.project_id IN(:project_ids)))'
,
user_id:
user
.
id
,
user_id:
user
.
id
,
project_ids:
user
.
authorized_projects
(
Gitlab
::
Access
::
REPORTER
).
select
(
:id
))
project_ids:
user
.
authorized_projects
(
Gitlab
::
Access
::
REPORTER
).
select
(
:id
))
...
...
app/models/issue.rb
View file @
051c8d63
...
@@ -36,7 +36,7 @@ class Issue < ActiveRecord::Base
...
@@ -36,7 +36,7 @@ class Issue < ActiveRecord::Base
scope
:cared
,
->
(
user
)
{
with_assignees
.
where
(
"issue_assignees.user_id IN(?)"
,
user
.
id
)
}
scope
:cared
,
->
(
user
)
{
with_assignees
.
where
(
"issue_assignees.user_id IN(?)"
,
user
.
id
)
}
scope
:open_for
,
->
(
user
)
{
opened
.
assigned_to
(
user
)
}
scope
:open_for
,
->
(
user
)
{
opened
.
assigned_to
(
user
)
}
scope
:in_projects
,
->
(
project_ids
)
{
where
(
project_id:
project_ids
)
}
scope
:in_projects
,
->
(
project_ids
)
{
where
(
project_id:
project_ids
)
}
scope
:with_assignees
,
->
{
joins
(
:assignee
s
)
}
scope
:with_assignees
,
->
{
includes
(
:assignees
).
references
(
:user
s
)
}
scope
:without_due_date
,
->
{
where
(
due_date:
nil
)
}
scope
:without_due_date
,
->
{
where
(
due_date:
nil
)
}
scope
:due_before
,
->
(
date
)
{
where
(
'issues.due_date < ?'
,
date
)
}
scope
:due_before
,
->
(
date
)
{
where
(
'issues.due_date < ?'
,
date
)
}
...
...
app/services/issues/export_csv_service.rb
View file @
051c8d63
...
@@ -21,7 +21,7 @@ module Issues
...
@@ -21,7 +21,7 @@ module Issues
def
csv_builder
def
csv_builder
@csv_builder
||=
@csv_builder
||=
CsvBuilder
.
new
(
@issues
.
includes
(
:author
,
:assignees
),
header_to_value_hash
)
CsvBuilder
.
new
(
@issues
.
includes
(
:author
),
header_to_value_hash
)
end
end
private
private
...
...
db/fixtures/development/09_issues.rb
View file @
051c8d63
...
@@ -8,7 +8,7 @@ Gitlab::Seeder.quiet do
...
@@ -8,7 +8,7 @@ Gitlab::Seeder.quiet do
description:
FFaker
::
Lorem
.
sentence
,
description:
FFaker
::
Lorem
.
sentence
,
state:
[
'opened'
,
'closed'
].
sample
,
state:
[
'opened'
,
'closed'
].
sample
,
milestone:
project
.
milestones
.
sample
,
milestone:
project
.
milestones
.
sample
,
assignee
:
project
.
team
.
users
.
sample
assignee
s:
[
project
.
team
.
users
.
sample
]
}
}
Issues
::
CreateService
.
new
(
project
,
project
.
team
.
users
.
sample
,
issue_params
).
execute
Issues
::
CreateService
.
new
(
project
,
project
.
team
.
users
.
sample
,
issue_params
).
execute
...
...
spec/features/issues/csv_spec.rb
View file @
051c8d63
...
@@ -76,10 +76,10 @@ describe 'Issues csv', feature: true do
...
@@ -76,10 +76,10 @@ describe 'Issues csv', feature: true do
create_list
(
:labeled_issue
,
create_list
(
:labeled_issue
,
10
,
10
,
project:
project
,
project:
project
,
assignee
:
user
,
assignee
s:
[
user
]
,
author:
user
,
author:
user
,
milestone:
milestone
,
milestone:
milestone
,
labels:
[
feature_label
,
idea_label
])
labels:
[
feature_label
,
idea_label
])
expect
{
request_csv
}.
not_to
exceed_query_limit
(
control_count
+
5
)
expect
{
request_csv
}.
not_to
exceed_query_limit
(
control_count
+
23
)
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