Skip to content

Commit

Permalink
Replace the 'profile/active_tab.feature' spinach test with an rspec a…
Browse files Browse the repository at this point in the history
…nalog
  • Loading branch information
blackst0ne committed Sep 12, 2017
1 parent 373ff97 commit 297dfe6
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 58 deletions.
5 changes: 5 additions & 0 deletions changelogs/unreleased/replace_profile_active_tab-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Replace the 'profile/active_tab.feature' spinach test with an rspec analog
merge_request: 14239
author: Vitaliy @blackst0ne Klachkov
type: other
29 changes: 0 additions & 29 deletions features/profile/active_tab.feature

This file was deleted.

25 changes: 0 additions & 25 deletions features/steps/profile/active_tab.rb

This file was deleted.

16 changes: 16 additions & 0 deletions spec/features/profiles/user_visits_profile_account_page_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions spec/features/profiles/user_visits_profile_page_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -27,7 +33,7 @@
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'
Expand Down
16 changes: 16 additions & 0 deletions spec/features/profiles/user_visits_profile_ssh_keys_page_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 297dfe6

Please sign in to comment.