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
92de278a
Commit
92de278a
authored
Mar 23, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for sidebar and cleanup wiki tests
parent
4333fbf2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+38
-3
No files found.
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
92de278a
...
@@ -2,15 +2,20 @@ require 'spec_helper'
...
@@ -2,15 +2,20 @@ require 'spec_helper'
describe
'User creates wiki page'
do
describe
'User creates wiki page'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:wiki
)
{
ProjectWiki
.
new
(
project
,
user
)
}
let
(
:project
)
{
create
(
:project
)
}
before
do
before
do
project
.
add_master
(
user
)
project
.
add_master
(
user
)
sign_in
(
user
)
sign_in
(
user
)
end
context
'when wiki is empty'
do
before
do
visit
(
project_wikis_path
(
project
))
visit
(
project_wikis_path
(
project
))
end
end
context
'when wiki is empty'
do
context
'in a user namespace'
do
context
'in a user namespace'
do
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
...
@@ -126,7 +131,9 @@ describe 'User creates wiki page' do
...
@@ -126,7 +131,9 @@ describe 'User creates wiki page' do
context
'when wiki is not empty'
,
:js
do
context
'when wiki is not empty'
,
:js
do
before
do
before
do
create
(
:wiki_page
,
wiki:
create
(
:project
,
namespace:
user
.
namespace
).
wiki
,
attrs:
{
title:
'home'
,
content:
'Home page'
})
create
(
:wiki_page
,
wiki:
wiki
,
attrs:
{
title:
'home'
,
content:
'Home page'
})
visit
(
project_wikis_path
(
project
))
end
end
context
'in a user namespace'
do
context
'in a user namespace'
do
...
@@ -241,4 +248,32 @@ describe 'User creates wiki page' do
...
@@ -241,4 +248,32 @@ describe 'User creates wiki page' do
end
end
end
end
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
it
'renders a default sidebar when there is no customized sidebar'
do
visit
(
project_wikis_path
(
project
))
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
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