summaryrefslogtreecommitdiff
path: root/spec/features/dashboard
diff options
context:
space:
mode:
authorLucas Deschamps <lucasdchamps@gmail.com>2016-11-09 07:59:51 +0100
committerLucas Deschamps <lucasdchamps@gmail.com>2016-11-16 09:44:49 +0100
commit8c3e6987d931847b72752dfcac4215dbdc47fd88 (patch)
tree0ef45e3d9ffc330d9d25bc45f4720189b14ef879 /spec/features/dashboard
parentf27f9803833f72d7f62534c195539dcdef2e3ccd (diff)
downloadgitlab-ce-8c3e6987d931847b72752dfcac4215dbdc47fd88.tar.gz
Navigation bar issuables counters reflects dashboard issuables counters
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r--spec/features/dashboard/issuables_counter_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb
new file mode 100644
index 00000000000..699bc102790
--- /dev/null
+++ b/spec/features/dashboard/issuables_counter_spec.rb
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe 'Navigation bar counter', feature: true, js: true, caching: true do
+ let(:user) { create(:user) }
+ let(:project) { create(:project, namespace: user.namespace) }
+
+ before do
+ login_as(user)
+ visit issues_dashboard_path
+ end
+
+ it 'reflects dashboard issues count' do
+ create(:issue, project: project, assignee: user)
+ visit issues_dashboard_path
+
+ dashboard_count = find('li.active span.badge')
+ nav_count = find('.dashboard-shortcuts-issues span.count')
+
+ expect(dashboard_count).to have_content('0')
+ expect(nav_count).to have_content('0')
+ end
+
+ it 'reflects dashboard merge requests count' do
+ create(:merge_request, assignee: user)
+ visit merge_requests_dashboard_path
+
+ dashboard_count = find('li.active span.badge')
+ nav_count = find('.dashboard-shortcuts-merge_requests span.count')
+
+ expect(dashboard_count).to have_content('0')
+ expect(nav_count).to have_content('0')
+ end
+end