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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
0f3df62e
Commit
0f3df62e
authored
Jun 02, 2016
by
Josh Frye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update specs. Add CHANGELOG entry
parent
8835b788
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
16 deletions
+36
-16
CHANGELOG
CHANGELOG
+1
-0
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+0
-15
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+17
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+17
-0
No files found.
CHANGELOG
View file @
0f3df62e
...
...
@@ -27,6 +27,7 @@ v 8.9.0 (unreleased)
- Measure queue duration between gitlab-workhorse and Rails
- Make authentication service for Container Registry to be compatible with < Docker 1.11
- Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav
v 8.8.3
- Fix incorrect links on pipeline page when merge request created from fork
...
...
app/models/concerns/issuable.rb
View file @
0f3df62e
...
...
@@ -74,7 +74,7 @@ module Issuable
def
update_assignee_cache_counts
# make sure we flush the cache for both the old *and* new assignee
User
.
find
(
assignee_id_was
).
update_cache_counts
if
assignee_id_was
assignee
.
update_cache_counts
if
assignee
_id
assignee
.
update_cache_counts
if
assignee
end
end
...
...
spec/features/issues_spec.rb
View file @
0f3df62e
...
...
@@ -62,21 +62,6 @@ describe 'Issues', feature: true do
expect
(
issue
.
reload
.
assignee
).
to
be_nil
end
it
'updates assigned cache count on change'
,
js:
true
do
visit
edit_namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
to
have_content
"Assignee
#{
@user
.
name
}
"
expect
(
@user
.
assigned_open_issues_count
).
to
eq
@user
.
assigned_issues
.
opened
.
count
first
(
'#s2id_issue_assignee_id'
).
click
sleep
2
# wait for ajax stuff to complete
first
(
'.user-result'
).
click
click_button
'Save changes'
expect
(
@user
.
assigned_open_issues_count
).
to
eq
@user
.
assigned_issues
.
opened
.
count
end
end
describe
'due date'
,
js:
true
do
...
...
spec/models/issue_spec.rb
View file @
0f3df62e
...
...
@@ -269,4 +269,21 @@ describe Issue, models: true do
end
end
end
describe
'cached counts'
do
it
'updates when assignees change'
do
user1
=
create
(
:user
)
user2
=
create
(
:user
)
issue
=
create
(
:issue
,
assignee:
user1
)
expect
(
user1
.
assigned_open_issues_count
).
to
eq
(
1
)
expect
(
user2
.
assigned_open_issues_count
).
to
eq
(
0
)
issue
.
assignee
=
user2
issue
.
save
expect
(
user1
.
assigned_open_issues_count
).
to
eq
(
0
)
expect
(
user2
.
assigned_open_issues_count
).
to
eq
(
1
)
end
end
end
spec/models/merge_request_spec.rb
View file @
0f3df62e
...
...
@@ -438,4 +438,21 @@ describe MergeRequest, models: true do
expect
(
mr
.
participants
).
to
include
(
note1
.
author
,
note2
.
author
)
end
end
describe
'cached counts'
do
it
'updates when assignees change'
do
user1
=
create
(
:user
)
user2
=
create
(
:user
)
mr
=
create
(
:merge_request
,
assignee:
user1
)
expect
(
user1
.
assigned_open_merge_request_count
).
to
eq
(
1
)
expect
(
user2
.
assigned_open_merge_request_count
).
to
eq
(
0
)
mr
.
assignee
=
user2
mr
.
save
expect
(
user1
.
assigned_open_merge_request_count
).
to
eq
(
0
)
expect
(
user2
.
assigned_open_merge_request_count
).
to
eq
(
1
)
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