debian-mirror-gitlab/spec/features/dashboard/active_tab_spec.rb

39 lines
819 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
2018-03-17 18:26:18 +05:30
RSpec.describe 'Dashboard Active Tab', :js do
2017-08-17 22:00:37 +05:30
before do
2017-09-10 17:25:29 +05:30
sign_in(create(:user))
2017-08-17 22:00:37 +05:30
end
shared_examples 'page has active tab' do |title|
it "#{title} tab" do
2018-03-17 18:26:18 +05:30
expect(page).to have_selector('.navbar-sub-nav li.active', count: 1)
expect(find('.navbar-sub-nav li.active')).to have_content(title)
2017-08-17 22:00:37 +05:30
end
end
context 'on dashboard projects' do
before do
visit dashboard_projects_path
end
it_behaves_like 'page has active tab', 'Projects'
end
2018-03-17 18:26:18 +05:30
context 'on dashboard groups' do
2017-08-17 22:00:37 +05:30
before do
2018-03-17 18:26:18 +05:30
visit dashboard_groups_path
2017-08-17 22:00:37 +05:30
end
2018-03-17 18:26:18 +05:30
it_behaves_like 'page has active tab', 'Groups'
2017-08-17 22:00:37 +05:30
end
2018-03-17 18:26:18 +05:30
context 'on activity projects' do
2017-08-17 22:00:37 +05:30
before do
2018-03-17 18:26:18 +05:30
visit activity_dashboard_path
2017-08-17 22:00:37 +05:30
end
2018-03-17 18:26:18 +05:30
it_behaves_like 'page has active tab', 'Activity'
2017-08-17 22:00:37 +05:30
end
end