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
f1e74de4
Commit
f1e74de4
authored
May 02, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify specs by not over-expecting
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
3811eb0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
29 deletions
+23
-29
CHANGELOG
CHANGELOG
+1
-1
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+14
-18
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+8
-10
No files found.
CHANGELOG
View file @
f1e74de4
...
...
@@ -15,7 +15,7 @@ v 8.8.0 (unreleased)
- Files over 5MB can only be viewed in their raw form, files over 1MB without highlighting !3718
- Add support for supressing text diffs using .gitattributes on the default branch (Matt Oakes)
v 8.7.2
(unreleased)
v 8.7.2
- The "New Branch" button is now loaded asynchronously
- Fix error 500 when trying to create a wiki page
...
...
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
f1e74de4
...
...
@@ -11,17 +11,16 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
click_link
'Wiki'
end
context
'
wiki project is
in the user namespace'
do
context
'in the user namespace'
do
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
context
'when wiki is empty'
do
scenario
'user can create a new wiki page from the wiki home page'
do
expect
(
page
).
to
have_content
(
'Home · Edit Page'
)
scenario
'directly from the wiki home page'
do
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
expect
(
page
).
to
have_content
(
"Home · last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'Home'
)
expect
(
page
).
to
have_content
(
"last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
end
end
...
...
@@ -31,34 +30,32 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'Home page'
).
execute
end
scenario
'
user can create a new wiki
page'
,
js:
true
do
scenario
'
via the "new wiki page"
page'
,
js:
true
do
click_link
'New Page'
fill_in
:new_wiki_path
,
with:
'foo'
click_button
'Create Page'
expect
(
page
).
to
have_content
(
'Foo · Edit Page'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
expect
(
page
).
to
have_content
(
"Foo · last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'Foo'
)
expect
(
page
).
to
have_content
(
"last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
end
end
end
context
'
wiki project is in the user
namespace'
do
context
'
in a group
namespace'
do
let
(
:project
)
{
create
(
:project
,
namespace:
create
(
:group
,
:public
))
}
context
'when wiki is empty'
do
scenario
'user can create a new wiki page from the wiki home page'
do
expect
(
page
).
to
have_content
(
'Home · Edit Page'
)
scenario
'directly from the wiki home page'
do
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
expect
(
page
).
to
have_content
(
"Home · last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'Home'
)
expect
(
page
).
to
have_content
(
"last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
end
end
...
...
@@ -68,18 +65,17 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
WikiPages
::
CreateService
.
new
(
project
,
user
,
title:
'home'
,
content:
'Home page'
).
execute
end
scenario
'
user can create a new wiki
page'
,
js:
true
do
scenario
'
via the "new wiki page"
page'
,
js:
true
do
click_link
'New Page'
fill_in
:new_wiki_path
,
with:
'foo'
click_button
'Create Page'
expect
(
page
).
to
have_content
(
'Foo · Edit Page'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
expect
(
page
).
to
have_content
(
"Foo · last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'Foo'
)
expect
(
page
).
to
have_content
(
"last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
end
end
...
...
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
View file @
f1e74de4
...
...
@@ -12,34 +12,32 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
click_link
'Wiki'
end
context
'
wiki project is
in the user namespace'
do
context
'in the user namespace'
do
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
scenario
'
user can update the wiki
home page'
do
scenario
'
the
home page'
do
click_link
'Edit'
expect
(
page
).
to
have_content
(
'Home · Edit Page'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Save changes'
expect
(
page
).
to
have_content
(
"Home · last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'Home'
)
expect
(
page
).
to
have_content
(
"last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
end
end
context
'
wiki project is in the user
namespace'
do
context
'
in a group
namespace'
do
let
(
:project
)
{
create
(
:project
,
namespace:
create
(
:group
,
:public
))
}
scenario
'
user can update the wiki
home page'
do
scenario
'
the
home page'
do
click_link
'Edit'
expect
(
page
).
to
have_content
(
'Home · Edit Page'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Save changes'
expect
(
page
).
to
have_content
(
"Home · last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'Home'
)
expect
(
page
).
to
have_content
(
"last edited by
#{
user
.
name
}
"
)
expect
(
page
).
to
have_content
(
'My awesome wiki!'
)
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