diff options
author | Vitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com> | 2017-09-16 13:09:58 +0300 |
---|---|---|
committer | Vitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com> | 2017-09-16 13:09:58 +0300 |
commit | 2a966f1b4e2fc640249f3c99afcdb3f06d70aaeb (patch) | |
tree | b206ffb44a67b906289267f5cbf38afc4109ba44 /spec/features/profiles | |
parent | 20295b3db379f4be02521cac591feca3452a2b1c (diff) |
Improve 'spec/features/profiles/*' specs
Diffstat (limited to 'spec/features/profiles')
7 files changed, 33 insertions, 38 deletions
diff --git a/spec/features/profiles/user_visits_profile_account_page_spec.rb b/spec/features/profiles/user_visits_profile_account_page_spec.rb index 8c7233c77ad..a8c08a680d7 100644 --- a/spec/features/profiles/user_visits_profile_account_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_account_page_spec.rb @@ -10,7 +10,6 @@ describe 'User visits the profile account page' do end it 'shows correct menu item' do - expect(find('.sidebar-top-level-items > li.active')).to have_content('Account') - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) + expect(page).to have_active_navigation('Account') end end diff --git a/spec/features/profiles/user_visits_profile_authentication_log_page_spec.rb b/spec/features/profiles/user_visits_profile_authentication_log_page_spec.rb deleted file mode 100644 index ffb504cc573..00000000000 --- a/spec/features/profiles/user_visits_profile_authentication_log_page_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'spec_helper' - -describe 'User visits the authentication log page' do - let(:user) { create(:user) } - - before do - sign_in(user) - - visit(audit_log_profile_path) - end - - it 'shows correct menu item' do - expect(find('.sidebar-top-level-items > li.active')).to have_content('Authentication log') - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) - end -end diff --git a/spec/features/profiles/user_visits_profile_authentication_log_spec.rb b/spec/features/profiles/user_visits_profile_authentication_log_spec.rb new file mode 100644 index 00000000000..a50ebb29e01 --- /dev/null +++ b/spec/features/profiles/user_visits_profile_authentication_log_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe 'User visits the authentication log' do + let(:user) { create(:user) } + + before do + sign_in(user) + + visit(audit_log_profile_path) + end + + it 'shows correct menu item' do + expect(page).to have_active_navigation('Authentication log') + end +end diff --git a/spec/features/profiles/user_visits_profile_page_spec.rb b/spec/features/profiles/user_visits_profile_page_spec.rb deleted file mode 100644 index 3bf6d718bc7..00000000000 --- a/spec/features/profiles/user_visits_profile_page_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'spec_helper' - -describe 'User visits the profile page' do - let(:user) { create(:user) } - - before do - sign_in(user) - - visit(profile_path) - end - - it 'shows correct menu item' do - expect(find('.sidebar-top-level-items > li.active')).to have_content('Profile') - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) - end -end diff --git a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb index d1776b3d7c2..924ee0e4174 100644 --- a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb @@ -10,8 +10,7 @@ describe 'User visits the profile preferences page' do end it 'shows correct menu item' do - expect(find('.sidebar-top-level-items > li.active')).to have_content('Preferences') - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) + expect(page).to have_active_navigation('Preferences') end describe 'User changes their syntax highlighting theme', :js do diff --git a/spec/features/profiles/user_visits_profile_spec.rb b/spec/features/profiles/user_visits_profile_spec.rb new file mode 100644 index 00000000000..6601d3039ed --- /dev/null +++ b/spec/features/profiles/user_visits_profile_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe 'User visits their profile' do + let(:user) { create(:user) } + + before do + sign_in(user) + + visit(profile_path) + end + + it 'shows correct menu item' do + expect(page).to have_active_navigation('Profile') + end +end diff --git a/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb index 0b7a63b54b4..685bf44619d 100644 --- a/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb +++ b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb @@ -10,7 +10,6 @@ describe 'User visits the profile SSH keys page' do end it 'shows correct menu item' do - expect(find('.sidebar-top-level-items > li.active')).to have_content('SSH Keys') - expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1) + expect(page).to have_active_navigation('SSH Keys') end end |