Fix active_tab and issuables_counter specs

This commit is contained in:
Annabel Dunstone Gray 2017-02-13 18:37:26 -06:00
parent 23035d90b7
commit 2fc559142e
2 changed files with 6 additions and 4 deletions

View File

@ -1,14 +1,15 @@
require 'spec_helper'
RSpec.describe 'Dashboard Active Tab', feature: true do
RSpec.describe 'Dashboard Active Tab', js: true, feature: true do
before do
login_as :user
end
shared_examples 'page has active tab' do |title|
it "#{title} tab" do
expect(page).to have_selector('.nav-sidebar li.active', count: 1)
expect(find('.nav-sidebar li.active')).to have_content(title)
find('.global-dropdown-toggle').trigger('click')
expect(page).to have_selector('.global-dropdown-menu li.active', count: 1)
expect(find('.global-dropdown-menu li.active')).to have_content(title)
end
end

View File

@ -36,7 +36,8 @@ describe 'Navigation bar counter', feature: true, js: true, caching: true do
def expect_counters(issuable_type, count)
dashboard_count = find('li.active span.badge')
nav_count = find(".dashboard-shortcuts-#{issuable_type} span.count")
find('.global-dropdown-toggle').click
nav_count = find(".dashboard-shortcuts-#{issuable_type} span.badge")
expect(nav_count).to have_content(count)
expect(dashboard_count).to have_content(count)