Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
4bb3c464
Commit
4bb3c464
authored
Dec 12, 2016
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move admin active tab spinach tests to rspec
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
parent
221a461c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
95 deletions
+94
-95
changelogs/unreleased/move-admin-active-tab-spinach-tests-to-rspec.yml
...released/move-admin-active-tab-spinach-tests-to-rspec.yml
+4
-0
features/admin/active_tab.feature
features/admin/active_tab.feature
+0
-54
features/steps/admin/active_tab.rb
features/steps/admin/active_tab.rb
+0
-41
spec/features/admin/admin_active_tab_spec.rb
spec/features/admin/admin_active_tab_spec.rb
+90
-0
No files found.
changelogs/unreleased/move-admin-active-tab-spinach-tests-to-rspec.yml
0 → 100644
View file @
4bb3c464
---
title
:
Move admin active tab spinach tests to rspec
merge_request
:
8037
author
:
Semyon Pupkov
features/admin/active_tab.feature
deleted
100644 → 0
View file @
221a461c
@admin
Feature
:
Admin Active Tab
Background
:
Given
I sign in as an admin
Scenario
:
On Admin Home
Given
I visit admin page
Then
the active main tab should be Overview
And
no other main tabs should be active
Scenario
:
On Admin Projects
Given
I visit admin projects page
Then
the active main tab should be Overview
And
the active sub tab should be Projects
And
no other main tabs should be active
And
no other sub tabs should be active
Scenario
:
On Admin Groups
Given
I visit admin groups page
Then
the active main tab should be Overview
And
the active sub tab should be Groups
And
no other main tabs should be active
And
no other sub tabs should be active
Scenario
:
On Admin Users
Given
I visit admin users page
Then
the active main tab should be Overview
And
the active sub tab should be Users
And
no other main tabs should be active
And
no other sub tabs should be active
Scenario
:
On Admin Logs
Given
I visit admin logs page
Then
the active main tab should be Monitoring
And
the active sub tab should be Logs
And
no other main tabs should be active
And
no other sub tabs should be active
Scenario
:
On Admin Messages
Given
I visit admin messages page
Then
the active main tab should be Messages
And
no other main tabs should be active
Scenario
:
On Admin Hooks
Given
I visit admin hooks page
Then
the active main tab should be Hooks
And
no other main tabs should be active
Scenario
:
On Admin Resque
Given
I visit admin Resque page
Then
the active main tab should be Monitoring
And
the active sub tab should be Resque
And
no other main tabs should be active
And
no other sub tabs should be active
features/steps/admin/active_tab.rb
deleted
100644 → 0
View file @
221a461c
class
Spinach::Features::AdminActiveTab
<
Spinach
::
FeatureSteps
include
SharedAuthentication
include
SharedPaths
include
SharedActiveTab
step
'the active main tab should be Overview'
do
ensure_active_main_tab
(
'Overview'
)
end
step
'the active sub tab should be Projects'
do
ensure_active_sub_tab
(
'Projects'
)
end
step
'the active sub tab should be Groups'
do
ensure_active_sub_tab
(
'Groups'
)
end
step
'the active sub tab should be Users'
do
ensure_active_sub_tab
(
'Users'
)
end
step
'the active main tab should be Hooks'
do
ensure_active_main_tab
(
'Hooks'
)
end
step
'the active main tab should be Monitoring'
do
ensure_active_main_tab
(
'Monitoring'
)
end
step
'the active sub tab should be Resque'
do
ensure_active_sub_tab
(
'Background Jobs'
)
end
step
'the active sub tab should be Logs'
do
ensure_active_sub_tab
(
'Logs'
)
end
step
'the active main tab should be Messages'
do
ensure_active_main_tab
(
'Messages'
)
end
end
spec/features/admin/admin_active_tab_spec.rb
0 → 100644
View file @
4bb3c464
require
'spec_helper'
RSpec
.
describe
'admin active tab'
do
before
do
login_as
:admin
end
shared_examples
'page has active tab'
do
|
title
|
it
"activates
#{
title
}
tab"
do
expect
(
page
).
to
have_selector
(
'.layout-nav .nav-links > li.active'
,
count:
1
)
expect
(
page
.
find
(
'.layout-nav li.active'
)).
to
have_content
(
title
)
end
end
shared_examples
'page has active sub tab'
do
|
title
|
it
"activates
#{
title
}
sub tab"
do
expect
(
page
).
to
have_selector
(
'.sub-nav li.active'
,
count:
1
)
expect
(
page
.
find
(
'.sub-nav li.active'
)).
to
have_content
(
title
)
end
end
context
'on home page'
do
before
do
visit
admin_root_path
end
it_behaves_like
'page has active tab'
,
'Overview'
end
context
'on projects'
do
before
do
visit
admin_namespaces_projects_path
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active sub tab'
,
'Projects'
end
context
'on groups'
do
before
do
visit
admin_groups_path
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active sub tab'
,
'Groups'
end
context
'on users'
do
before
do
visit
admin_users_path
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active sub tab'
,
'Users'
end
context
'on logs'
do
before
do
visit
admin_logs_path
end
it_behaves_like
'page has active tab'
,
'Monitoring'
it_behaves_like
'page has active sub tab'
,
'Logs'
end
context
'on messages'
do
before
do
visit
admin_broadcast_messages_path
end
it_behaves_like
'page has active tab'
,
'Messages'
end
context
'on hooks'
do
before
do
visit
admin_hooks_path
end
it_behaves_like
'page has active tab'
,
'Hooks'
end
context
'on background jobs'
do
before
do
visit
admin_background_jobs_path
end
it_behaves_like
'page has active tab'
,
'Monitoring'
it_behaves_like
'page has active sub tab'
,
'Background Jobs'
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment