2016-11-09 01:59:51 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'Navigation bar counter', feature: true, js: true, caching: true do
|
|
|
|
let(:user) { create(:user) }
|
2016-11-09 17:15:29 -05:00
|
|
|
let(:project) { create(:empty_project, namespace: user.namespace) }
|
2016-11-09 01:59:51 -05:00
|
|
|
|
|
|
|
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
|