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
558ad69e
Commit
558ad69e
authored
Mar 26, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange the tests and add another case where
it would still render the sidebar whenever the wiki is empty.
parent
44e4fd0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+27
-15
No files found.
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
558ad69e
...
...
@@ -249,30 +249,42 @@ describe 'User creates wiki page' do
end
end
context
'when wiki has two pages'
do
before
do
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'home'
,
content:
'home'
})
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'another'
,
content:
'another'
})
end
describe
'sidebar feature'
do
context
'when the wiki is empty'
do
it
'renders my customized sidebar'
do
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'_sidebar'
,
content:
'My customized sidebar'
})
it
'renders a default sidebar when there is no customized sidebar'
do
visit
(
project_wikis_path
(
project
))
visit
(
project_wikis_path
(
project
))
expect
(
page
).
to
have_content
(
'Anothe
r'
)
e
xpect
(
page
).
to
have_content
(
'More Pages'
)
expect
(
page
).
to
have_content
(
'My customized sideba
r'
)
e
nd
end
context
'when there
is a customized sidebar
'
do
context
'when there
are some existing pages
'
do
before
do
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'_sidebar'
,
content:
'My customized sidebar'
})
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'home'
,
content:
'home'
})
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'another'
,
content:
'another'
})
end
it
'renders
my customized sidebar instead of the default one
'
do
it
'renders
a default sidebar when there is no customized sidebar
'
do
visit
(
project_wikis_path
(
project
))
expect
(
page
).
to
have_content
(
'My customized sidebar'
)
expect
(
page
).
not_to
have_content
(
'Another'
)
expect
(
page
).
not_to
have_content
(
'More Pages'
)
expect
(
page
).
to
have_content
(
'Another'
)
expect
(
page
).
to
have_content
(
'More Pages'
)
end
context
'when there is a customized sidebar'
do
before
do
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'_sidebar'
,
content:
'My customized sidebar'
})
end
it
'renders my customized sidebar instead of the default one'
do
visit
(
project_wikis_path
(
project
))
expect
(
page
).
to
have_content
(
'My customized sidebar'
)
expect
(
page
).
not_to
have_content
(
'Another'
)
expect
(
page
).
not_to
have_content
(
'More Pages'
)
end
end
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