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
4a50dde7
Commit
4a50dde7
authored
Apr 03, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Multiple issue asignees] spec/models/issue_spec.rb
parent
799459c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
34 deletions
+1
-34
app/models/merge_request.rb
app/models/merge_request.rb
+0
-4
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+1
-20
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-10
No files found.
app/models/merge_request.rb
View file @
4a50dde7
...
...
@@ -189,10 +189,6 @@ class MergeRequest < ActiveRecord::Base
work_in_progress?
(
title
)
?
title
:
"WIP:
#{
title
}
"
end
def
is_being_reassigned?
assignee_id_changed?
end
def
update_assignee_cache_counts
# make sure we flush the cache for both the old *and* new assignees(if they exist)
previous_assignee
=
User
.
find_by_id
(
assignee_id_was
)
if
assignee_id_was
...
...
spec/models/issue_spec.rb
View file @
4a50dde7
...
...
@@ -172,25 +172,6 @@ describe Issue, models: true do
end
end
describe
'#is_being_reassigned?'
do
it
'returns true if the issue assignee has changed'
do
subject
.
assignee
=
create
(
:user
)
expect
(
subject
.
is_being_reassigned?
).
to
be_truthy
end
it
'returns false if the issue assignee has not changed'
do
expect
(
subject
.
is_being_reassigned?
).
to
be_falsey
end
end
describe
'#is_being_reassigned?'
do
it
'returns issues assigned to user'
do
user
=
create
(
:user
)
create_list
(
:issue
,
2
,
assignees:
[
user
])
expect
(
Issue
.
open_for
(
user
).
count
).
to
eq
2
end
end
describe
'#closed_by_merge_requests'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)}
...
...
@@ -423,7 +404,7 @@ describe Issue, models: true do
expect
(
user1
.
assigned_open_issues_count
).
to
eq
(
1
)
expect
(
user2
.
assigned_open_issues_count
).
to
eq
(
0
)
issue
.
assignee
=
user2
issue
.
assignee
s
=
[
user2
]
issue
.
save
expect
(
user1
.
assigned_open_issues_count
).
to
eq
(
0
)
...
...
spec/models/merge_request_spec.rb
View file @
4a50dde7
...
...
@@ -317,16 +317,6 @@ describe MergeRequest, models: true do
end
end
describe
'#is_being_reassigned?'
do
it
'returns true if the merge_request assignee has changed'
do
subject
.
assignee
=
create
(
:user
)
expect
(
subject
.
is_being_reassigned?
).
to
be_truthy
end
it
'returns false if the merge request assignee has not changed'
do
expect
(
subject
.
is_being_reassigned?
).
to
be_falsey
end
end
describe
'#for_fork?'
do
it
'returns true if the merge request is for a fork'
do
subject
.
source_project
=
build_stubbed
(
:empty_project
,
namespace:
create
(
:group
))
...
...
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