Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
7d43484d
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7d43484d
编写于
4月 05, 2017
作者:
B
blackst0ne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix wiki commit message
上级
d9aca741
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
33 addition
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
未找到文件。
app/views/projects/wikis/_form.html.haml
浏览文件 @
7d43484d
-
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
浏览文件 @
7d43484d
---
title
:
Fix wiki commit message
merge_request
:
10464
author
:
blackst0ne
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
浏览文件 @
7d43484d
...
@@ -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
浏览文件 @
7d43484d
...
@@ -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'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录