2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-03 18:45:42 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-10-03 08:35:01 +00:00
|
|
|
RSpec.describe 'Dashboard Active Tab', :js do
|
2017-01-03 18:45:42 +00:00
|
|
|
before do
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(create(:user))
|
2017-01-03 18:45:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
shared_examples 'page has active tab' do |title|
|
|
|
|
it "#{title} tab" do
|
2018-07-25 15:36:08 +00:00
|
|
|
subject
|
|
|
|
|
2017-08-17 08:51:19 +00:00
|
|
|
expect(page).to have_selector('.navbar-sub-nav li.active', count: 1)
|
|
|
|
expect(find('.navbar-sub-nav li.active')).to have_content(title)
|
2017-01-03 18:45:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on dashboard projects' do
|
2018-07-25 15:36:08 +00:00
|
|
|
it_behaves_like 'page has active tab', 'Projects' do
|
|
|
|
subject { visit dashboard_projects_path }
|
2017-01-03 18:45:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-08-18 11:07:10 +00:00
|
|
|
context 'on dashboard groups' do
|
2018-07-25 15:36:08 +00:00
|
|
|
it_behaves_like 'page has active tab', 'Groups' do
|
|
|
|
subject { visit dashboard_groups_path }
|
2017-01-03 18:45:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|