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
Léo-Paul Géneau
gitlab-ce
Commits
1209332a
Commit
1209332a
authored
Dec 04, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace admin sidebar feature spec with view spec
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ce00a9c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
+17
-17
No files found.
spec/
features/admin/admin_active_tab
_spec.rb
→
spec/
views/layouts/nav/sidebar/_admin.html.haml
_spec.rb
View file @
1209332a
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'admin active tab'
do
describe
'layouts/nav/sidebar/_admin'
do
before
do
sign_in
(
create
(
:admin
))
end
shared_examples
'page has active tab'
do
|
title
|
shared_examples
'page has active tab'
do
|
title
|
it
"activates
#{
title
}
tab"
do
it
"activates
#{
title
}
tab"
do
expect
(
page
).
to
have_selector
(
'.nav-sidebar .sidebar-top-level-items > li.active'
,
count:
1
)
render
expect
(
page
.
find
(
'.nav-sidebar .sidebar-top-level-items > li.active'
)).
to
have_content
(
title
)
expect
(
rendered
).
to
have_selector
(
'.nav-sidebar .sidebar-top-level-items > li.active'
,
count:
1
)
expect
(
rendered
).
to
have_css
(
'.nav-sidebar .sidebar-top-level-items > li.active'
,
text:
title
)
end
end
end
end
shared_examples
'page has active sub tab'
do
|
title
|
shared_examples
'page has active sub tab'
do
|
title
|
it
"activates
#{
title
}
sub tab"
do
it
"activates
#{
title
}
sub tab"
do
expect
(
page
).
to
have_selector
(
'.sidebar-sub-level-items > li.active'
,
count:
2
)
render
expect
(
page
.
all
(
'.sidebar-sub-level-items > li.active'
)[
1
]).
to
have_content
(
title
)
expect
(
rendered
).
to
have_css
(
'.sidebar-sub-level-items > li.active'
,
text:
title
)
end
end
end
end
context
'on home page'
do
context
'on home page'
do
before
do
before
do
visit
admin_root_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'dashboard'
)
end
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active tab'
,
'Overview'
...
@@ -29,7 +28,8 @@ RSpec.describe 'admin active tab' do
...
@@ -29,7 +28,8 @@ RSpec.describe 'admin active tab' do
context
'on projects'
do
context
'on projects'
do
before
do
before
do
visit
admin_projects_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'projects'
)
allow
(
controller
).
to
receive
(
:controller_path
).
and_return
(
'admin/projects'
)
end
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active tab'
,
'Overview'
...
@@ -38,7 +38,7 @@ RSpec.describe 'admin active tab' do
...
@@ -38,7 +38,7 @@ RSpec.describe 'admin active tab' do
context
'on groups'
do
context
'on groups'
do
before
do
before
do
visit
admin_groups_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'groups'
)
end
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active tab'
,
'Overview'
...
@@ -47,7 +47,7 @@ RSpec.describe 'admin active tab' do
...
@@ -47,7 +47,7 @@ RSpec.describe 'admin active tab' do
context
'on users'
do
context
'on users'
do
before
do
before
do
visit
admin_users_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'users'
)
end
end
it_behaves_like
'page has active tab'
,
'Overview'
it_behaves_like
'page has active tab'
,
'Overview'
...
@@ -56,7 +56,7 @@ RSpec.describe 'admin active tab' do
...
@@ -56,7 +56,7 @@ RSpec.describe 'admin active tab' do
context
'on logs'
do
context
'on logs'
do
before
do
before
do
visit
admin_logs_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'logs'
)
end
end
it_behaves_like
'page has active tab'
,
'Monitoring'
it_behaves_like
'page has active tab'
,
'Monitoring'
...
@@ -65,7 +65,7 @@ RSpec.describe 'admin active tab' do
...
@@ -65,7 +65,7 @@ RSpec.describe 'admin active tab' do
context
'on messages'
do
context
'on messages'
do
before
do
before
do
visit
admin_broadcast_messages_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'broadcast_messages'
)
end
end
it_behaves_like
'page has active tab'
,
'Messages'
it_behaves_like
'page has active tab'
,
'Messages'
...
@@ -73,7 +73,7 @@ RSpec.describe 'admin active tab' do
...
@@ -73,7 +73,7 @@ RSpec.describe 'admin active tab' do
context
'on hooks'
do
context
'on hooks'
do
before
do
before
do
visit
admin_hooks_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'hooks'
)
end
end
it_behaves_like
'page has active tab'
,
'Hooks'
it_behaves_like
'page has active tab'
,
'Hooks'
...
@@ -81,7 +81,7 @@ RSpec.describe 'admin active tab' do
...
@@ -81,7 +81,7 @@ RSpec.describe 'admin active tab' do
context
'on background jobs'
do
context
'on background jobs'
do
before
do
before
do
visit
admin_background_jobs_path
allow
(
controller
).
to
receive
(
:controller_name
).
and_return
(
'background_jobs'
)
end
end
it_behaves_like
'page has active tab'
,
'Monitoring'
it_behaves_like
'page has active tab'
,
'Monitoring'
...
...
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