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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
65ea732c
Commit
65ea732c
authored
Apr 05, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_wiki_commit_message' into 'master'
Fix wiki commit message Closes #20389 See merge request !10464
parents
20e6670a
7d43484d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
1 deletion
+33
-1
app/views/projects/wikis/_form.html.haml
app/views/projects/wikis/_form.html.haml
+3
-1
changelogs/unreleased/fix_wiki_commit_message.yml
changelogs/unreleased/fix_wiki_commit_message.yml
+4
-0
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+20
-0
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+6
-0
No files found.
app/views/projects/wikis/_form.html.haml
View file @
65ea732c
-
commit_message
=
@page
.
persisted?
?
"Update
#{
@page
.
title
}
"
:
"Create
#{
@page
.
title
}
"
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@page
],
method:
@page
.
persisted?
?
:put
:
:post
,
html:
{
class:
'form-horizontal wiki-form common-note-form prepend-top-default js-quick-submit'
}
do
|
f
|
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@page
],
method:
@page
.
persisted?
?
:put
:
:post
,
html:
{
class:
'form-horizontal wiki-form common-note-form prepend-top-default js-quick-submit'
}
do
|
f
|
=
form_errors
(
@page
)
=
form_errors
(
@page
)
...
@@ -28,7 +30,7 @@
...
@@ -28,7 +30,7 @@
.form-group
.form-group
=
f
.
label
:commit_message
,
class:
'control-label'
=
f
.
label
:commit_message
,
class:
'control-label'
.col-sm-10
=
f
.
text_field
:message
,
class:
'form-control'
,
rows:
18
.col-sm-10
=
f
.
text_field
:message
,
class:
'form-control'
,
rows:
18
,
value:
commit_message
.form-actions
.form-actions
-
if
@page
&&
@page
.
persisted?
-
if
@page
&&
@page
.
persisted?
...
...
changelogs/unreleased/fix_wiki_commit_message.yml
0 → 100644
View file @
65ea732c
---
title
:
Fix wiki commit message
merge_request
:
10464
author
:
blackst0ne
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
65ea732c
...
@@ -15,6 +15,10 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
...
@@ -15,6 +15,10 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
context
'when wiki is empty'
do
context
'when wiki is empty'
do
scenario
'commit message field has value "Create home"'
do
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Create home'
)
end
scenario
'directly from the wiki home page'
do
scenario
'directly from the wiki home page'
do
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
click_button
'Create page'
...
@@ -37,6 +41,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
...
@@ -37,6 +41,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
fill_in
:new_wiki_path
,
with:
'foo'
fill_in
:new_wiki_path
,
with:
'foo'
click_button
'Create Page'
click_button
'Create Page'
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Create foo'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
click_button
'Create page'
...
@@ -51,6 +58,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
...
@@ -51,6 +58,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
fill_in
:new_wiki_path
,
with:
'Spaces in the name'
fill_in
:new_wiki_path
,
with:
'Spaces in the name'
click_button
'Create Page'
click_button
'Create Page'
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Create spaces in the name'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
click_button
'Create page'
...
@@ -65,6 +75,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
...
@@ -65,6 +75,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
fill_in
:new_wiki_path
,
with:
'hyphens-in-the-name'
fill_in
:new_wiki_path
,
with:
'hyphens-in-the-name'
click_button
'Create Page'
click_button
'Create Page'
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Create hyphens in the name'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
click_button
'Create page'
...
@@ -80,6 +93,10 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
...
@@ -80,6 +93,10 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
let
(
:project
)
{
create
(
:project
,
namespace:
create
(
:group
,
:public
))
}
let
(
:project
)
{
create
(
:project
,
namespace:
create
(
:group
,
:public
))
}
context
'when wiki is empty'
do
context
'when wiki is empty'
do
scenario
'commit message field has value "Create home"'
do
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Create home'
)
end
scenario
'directly from the wiki home page'
do
scenario
'directly from the wiki home page'
do
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
click_button
'Create page'
...
@@ -101,6 +118,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
...
@@ -101,6 +118,9 @@ feature 'Projects > Wiki > User creates wiki page', feature: true do
fill_in
:new_wiki_path
,
with:
'foo'
fill_in
:new_wiki_path
,
with:
'foo'
click_button
'Create Page'
click_button
'Create Page'
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Create foo'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Create page'
click_button
'Create page'
...
...
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
View file @
65ea732c
...
@@ -19,6 +19,9 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
...
@@ -19,6 +19,9 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
scenario
'success when the wiki content is not empty'
do
scenario
'success when the wiki content is not empty'
do
click_link
'Edit'
click_link
'Edit'
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Update home'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Save changes'
click_button
'Save changes'
...
@@ -48,6 +51,9 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
...
@@ -48,6 +51,9 @@ feature 'Projects > Wiki > User updates wiki page', feature: true do
scenario
'the home page'
do
scenario
'the home page'
do
click_link
'Edit'
click_link
'Edit'
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
'wiki[message]'
,
with:
'Update home'
)
fill_in
:wiki_content
,
with:
'My awesome wiki!'
fill_in
:wiki_content
,
with:
'My awesome wiki!'
click_button
'Save changes'
click_button
'Save changes'
...
...
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