BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
48cfad90
Commit
48cfad90
authored
Sep 23, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a view spec (gasp!) for help/index
parent
73288a8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
index.html.haml_spec.rb
spec/views/help/index.html.haml_spec.rb
+55
-0
No files found.
spec/views/help/index.html.haml_spec.rb
0 → 100644
View file @
48cfad90
require
'rails_helper'
describe
'help/index'
do
describe
'version information'
do
it
'is hidden from guests'
do
stub_user
stub_version
(
'8.0.2'
,
'abcdefg'
)
stub_helpers
render
expect
(
rendered
).
not_to
match
'8.0.2'
expect
(
rendered
).
not_to
match
'abcdefg'
end
it
'is hidden from users'
do
stub_user
(
admin?:
false
)
stub_version
(
'8.0.2'
,
'abcdefg'
)
stub_helpers
render
expect
(
rendered
).
not_to
match
'8.0.2'
expect
(
rendered
).
not_to
match
'abcdefg'
end
it
'is shown to admins'
do
stub_user
(
admin?:
true
)
stub_version
(
'8.0.2'
,
'abcdefg'
)
stub_helpers
render
expect
(
rendered
).
to
match
'8.0.2'
expect
(
rendered
).
to
match
'abcdefg'
end
end
def
stub_user
(
messages
=
{})
user
=
messages
.
empty?
?
nil
:
double
(
messages
)
allow
(
view
).
to
receive
(
:current_user
).
and_return
(
user
)
end
def
stub_version
(
version
,
revision
)
stub_const
(
'Gitlab::VERSION'
,
version
)
stub_const
(
'Gitlab::REVISION'
,
revision
)
end
def
stub_helpers
allow
(
view
).
to
receive
(
:markdown
).
and_return
(
''
)
allow
(
view
).
to
receive
(
:current_application_settings
).
and_return
(
double
.
as_null_object
)
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