summaryrefslogtreecommitdiff
path: root/spec/features/profiles
diff options
context:
space:
mode:
authorVitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com>2017-09-13 09:50:18 +1100
committerVitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com>2017-09-13 10:01:44 +1100
commit297dfe6ab91da9e655fb2d8fc633048974bdb208 (patch)
tree9323626edbbf0e4f9c888a18b77a921b2d331061 /spec/features/profiles
parent373ff978dfb6898ee5e1d4d6355313c349a60a96 (diff)
downloadgitlab-ce-297dfe6ab91da9e655fb2d8fc633048974bdb208.tar.gz
Replace the 'profile/active_tab.feature' spinach test with an rspec analog
Diffstat (limited to 'spec/features/profiles')
-rw-r--r--spec/features/profiles/user_visits_profile_account_page_spec.rb16
-rw-r--r--spec/features/profiles/user_visits_profile_authentication_log_page_spec.rb16
-rw-r--r--spec/features/profiles/user_visits_profile_page_spec.rb16
-rw-r--r--spec/features/profiles/user_visits_profile_preferences_page_spec.rb (renamed from spec/features/profiles/preferences_spec.rb)14
-rw-r--r--spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb16
5 files changed, 74 insertions, 4 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
new file mode 100644
index 00000000000..8c7233c77ad
--- /dev/null
+++ b/spec/features/profiles/user_visits_profile_account_page_spec.rb
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe 'User visits the profile account page' do
+ let(:user) { create(:user) }
+
+ before do
+ sign_in(user)
+
+ visit(profile_account_path)
+ 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)
+ 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
new file mode 100644
index 00000000000..ffb504cc573
--- /dev/null
+++ b/spec/features/profiles/user_visits_profile_authentication_log_page_spec.rb
@@ -0,0 +1,16 @@
+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_page_spec.rb b/spec/features/profiles/user_visits_profile_page_spec.rb
new file mode 100644
index 00000000000..3bf6d718bc7
--- /dev/null
+++ b/spec/features/profiles/user_visits_profile_page_spec.rb
@@ -0,0 +1,16 @@
+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/preferences_spec.rb b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb
index c935cdfd5c4..d1776b3d7c2 100644
--- a/spec/features/profiles/preferences_spec.rb
+++ b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb
@@ -1,14 +1,20 @@
require 'spec_helper'
-describe 'Profile > Preferences', :js do
+describe 'User visits the profile preferences page' do
let(:user) { create(:user) }
before do
sign_in(user)
- visit profile_preferences_path
+
+ visit(profile_preferences_path)
+ 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)
end
- describe 'User changes their syntax highlighting theme' do
+ describe 'User changes their syntax highlighting theme', :js do
it 'creates a flash message' do
choose 'user_color_scheme_id_5'
@@ -27,7 +33,7 @@ describe 'Profile > Preferences', :js do
end
end
- describe 'User changes their default dashboard' do
+ describe 'User changes their default dashboard', :js do
it 'creates a flash message' do
select 'Starred Projects', from: 'user_dashboard'
click_button 'Save'
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
new file mode 100644
index 00000000000..0b7a63b54b4
--- /dev/null
+++ b/spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe 'User visits the profile SSH keys page' do
+ let(:user) { create(:user) }
+
+ before do
+ sign_in(user)
+
+ visit(profile_keys_path)
+ 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)
+ end
+end