summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Deschamps <lucasdchamps@gmail.com>2016-11-10 23:41:25 +0100
committerLucas Deschamps <lucasdchamps@gmail.com>2016-11-16 09:44:49 +0100
commit7fa366107b30fa0ccac758ff9e6854f86e54b116 (patch)
tree5fa9be48eb1b90779416f9f1db0380aaec04453b
parent677af1dd30f9b44a7be9eaa68bddda38331b8bbb (diff)
downloadgitlab-ce-7fa366107b30fa0ccac758ff9e6854f86e54b116.tar.gz
Improve issuables_counter_spec relevance.
-rw-r--r--spec/features/dashboard/issuables_counter_spec.rb33
1 files changed, 25 insertions, 8 deletions
diff --git a/spec/features/dashboard/issuables_counter_spec.rb b/spec/features/dashboard/issuables_counter_spec.rb
index f134eee19eb..1960552b411 100644
--- a/spec/features/dashboard/issuables_counter_spec.rb
+++ b/spec/features/dashboard/issuables_counter_spec.rb
@@ -1,33 +1,50 @@
require 'spec_helper'
-describe 'Navigation bar counter', feature: true, js: true, caching: true do
+describe 'Navigation bar counter', feature: true, js: true do
let(:user) { create(:user) }
let(:project) { create(:empty_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)
+ issue = 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(nav_count).to have_content('1')
+ expect(dashboard_count).to have_content('1')
+
+ issue.assignee = nil
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')
+ expect(nav_count).to have_content('1')
+ expect(dashboard_count).to have_content('1')
end
it 'reflects dashboard merge requests count' do
- create(:merge_request, assignee: user)
+ merge_request = create(:merge_request, source_project: project, assignee: user)
+ visit merge_requests_dashboard_path
+
+ dashboard_count = find('li.active span.badge')
+ 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
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')
+ expect(nav_count).to have_content('1')
+ expect(dashboard_count).to have_content('1')
end
end