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
Jérome Perrin
gitlab-ce
Commits
3d13096f
Commit
3d13096f
authored
Nov 15, 2016
by
Lucas Deschamps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor issuables_counter_spec.
parent
7fa36610
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
23 deletions
+17
-23
spec/features/dashboard/issuables_counter_spec.rb
spec/features/dashboard/issuables_counter_spec.rb
+17
-23
No files found.
spec/features/dashboard/issuables_counter_spec.rb
View file @
3d13096f
require
'spec_helper'
require
'spec_helper'
describe
'Navigation bar counter'
,
feature:
true
,
js:
true
do
describe
'Navigation bar counter'
,
feature:
true
,
js:
true
,
caching:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:empty_project
,
namespace:
user
.
namespace
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
before
do
before
do
issue
.
update
(
assignee:
user
)
merge_request
.
update
(
assignee:
user
)
login_as
(
user
)
login_as
(
user
)
end
end
it
'reflects dashboard issues count'
do
it
'reflects dashboard issues count'
do
issue
=
create
(
:issue
,
project:
project
,
assignee:
user
)
visit
issues_dashboard_path
visit
issues_dashboard_path
dashboard_count
=
find
(
'li.active span.badge'
)
expect_counters
(
'issues'
,
'1'
)
nav_count
=
find
(
'.dashboard-shortcuts-issues span.count'
)
expect
(
nav_count
).
to
have_content
(
'1'
)
expect
(
dashboard_count
).
to
have_content
(
'1'
)
issue
.
assignee
=
nil
issue
.
update
(
assignee:
nil
)
visit
issues_dashboard_path
visit
issues_dashboard_path
dashboard_count
=
find
(
'li.active span.badge'
)
expect_counters
(
'issues'
,
'1'
)
nav_count
=
find
(
'.dashboard-shortcuts-issues span.count'
)
expect
(
nav_count
).
to
have_content
(
'1'
)
expect
(
dashboard_count
).
to
have_content
(
'1'
)
end
end
it
'reflects dashboard merge requests count'
do
it
'reflects dashboard merge requests count'
do
merge_request
=
create
(
:merge_request
,
source_project:
project
,
assignee:
user
)
visit
merge_requests_dashboard_path
visit
merge_requests_dashboard_path
dashboard_count
=
find
(
'li.active span.badge'
)
expect_counters
(
'merge_requests'
,
'1'
)
nav_count
=
find
(
'.dashboard-shortcuts-merge_requests span.count'
)
expect
(
nav_count
).
to
have_content
(
'1'
)
expect
(
dashboard_count
).
to
have_content
(
'1'
)
merge_request
.
assignee
=
nil
merge_request
.
update
(
assignee:
nil
)
visit
merge_requests_dashboard_path
visit
merge_requests_dashboard_path
expect_counters
(
'merge_requests'
,
'1'
)
end
def
expect_counters
(
issuable_type
,
count
)
dashboard_count
=
find
(
'li.active span.badge'
)
dashboard_count
=
find
(
'li.active span.badge'
)
nav_count
=
find
(
'.dashboard-shortcuts-merge_requests span.count'
)
nav_count
=
find
(
".dashboard-shortcuts-
#{
issuable_type
}
span.count"
)
expect
(
nav_count
).
to
have_content
(
'1'
)
expect
(
nav_count
).
to
have_content
(
count
)
expect
(
dashboard_count
).
to
have_content
(
'1'
)
expect
(
dashboard_count
).
to
have_content
(
count
)
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