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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
76c7708b
Commit
76c7708b
authored
Apr 23, 2021
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub helper methods for views
parent
1a993332
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
24 deletions
+4
-24
ee/spec/views/admin/dev_ops_report/show.html.haml_spec.rb
ee/spec/views/admin/dev_ops_report/show.html.haml_spec.rb
+3
-23
spec/views/shared/nav/_sidebar.html.haml_spec.rb
spec/views/shared/nav/_sidebar.html.haml_spec.rb
+1
-1
No files found.
ee/spec/views/admin/dev_ops_report/show.html.haml_spec.rb
View file @
76c7708b
...
@@ -3,23 +3,13 @@
...
@@ -3,23 +3,13 @@
require
'spec_helper'
require
'spec_helper'
RSpec
.
describe
'admin/dev_ops_report/show.html.haml'
do
RSpec
.
describe
'admin/dev_ops_report/show.html.haml'
do
include
Devise
::
Test
::
ControllerHelpers
before
do
before
do
stub_licensed_features
(
devops_adoption:
true
)
stub_licensed_features
(
devops_adoption:
true
)
end
end
context
'when show_adoption? returns false'
do
context
'when show_adoption? returns false'
do
before
do
before
do
controller
.
singleton_class
.
class_eval
do
allow
(
view
).
to
receive
(
:show_adoption?
).
and_return
(
false
)
protected
def
show_adoption?
false
end
helper_method
:show_adoption?
end
end
end
it
'disables the feature'
do
it
'disables the feature'
do
...
@@ -40,19 +30,9 @@ RSpec.describe 'admin/dev_ops_report/show.html.haml' do
...
@@ -40,19 +30,9 @@ RSpec.describe 'admin/dev_ops_report/show.html.haml' do
end
end
context
'when show_adoption? returns true'
do
context
'when show_adoption? returns true'
do
before
do
controller
.
singleton_class
.
class_eval
do
protected
def
show_adoption?
true
end
helper_method
:show_adoption?
end
end
it
'enables the feature'
do
it
'enables the feature'
do
allow
(
view
).
to
receive
(
:show_adoption?
).
and_return
(
true
)
render
render
expect
(
rendered
).
to
have_selector
(
'#devops-adoption'
)
expect
(
rendered
).
to
have_selector
(
'#devops-adoption'
)
...
...
spec/views/shared/nav/_sidebar.html.haml_spec.rb
View file @
76c7708b
...
@@ -32,7 +32,7 @@ RSpec.describe 'shared/nav/_sidebar.html.haml' do
...
@@ -32,7 +32,7 @@ RSpec.describe 'shared/nav/_sidebar.html.haml' do
context
'when sidebar has a custom scope menu partial defined'
do
context
'when sidebar has a custom scope menu partial defined'
do
it
'renders the custom partial'
do
it
'renders the custom partial'
do
allow
(
sidebar
).
to
receive
(
:render_raw_scope_menu_partial
).
and_return
(
scope_menu_view
)
allow
(
sidebar
).
to
receive
(
:render_raw_scope_menu_partial
).
and_return
(
scope_menu_view
)
allow
(
sidebar
).
to
receive
(
:scope_menu
).
and_return
(
nil
)
allow
(
view
).
to
receive
(
:scope_menu
).
and_return
(
nil
)
stub_template
(
scope_menu_partial
=>
content
)
stub_template
(
scope_menu_partial
=>
content
)
render
render
...
...
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