Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ec3c3d2b
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,发现更多精彩内容 >>
提交
ec3c3d2b
编写于
2月 01, 2019
作者:
M
Mesut Güneş
提交者:
Rémy Coutable
2月 01, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
adding a spec for issues/310
上级
8028a59d
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
134 addition
and
4 deletion
+134
-4
app/views/admin/application_settings/_account_and_limit.html.haml
...s/admin/application_settings/_account_and_limit.html.haml
+2
-2
app/views/admin/application_settings/show.html.haml
app/views/admin/application_settings/show.html.haml
+1
-1
app/views/layouts/nav/sidebar/_admin.html.haml
app/views/layouts/nav/sidebar/_admin.html.haml
+1
-1
qa/qa.rb
qa/qa.rb
+2
-0
qa/qa/page/admin/menu.rb
qa/qa/page/admin/menu.rb
+9
-0
qa/qa/page/admin/settings/component/account_and_limit.rb
qa/qa/page/admin/settings/component/account_and_limit.rb
+26
-0
qa/qa/page/admin/settings/general.rb
qa/qa/page/admin/settings/general.rb
+23
-0
qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb
...r_ui/3_create/repository/push_over_http_file_size_spec.rb
+70
-0
未找到文件。
app/views/admin/application_settings/_account_and_limit.html.haml
浏览文件 @
ec3c3d2b
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
=
f
.
number_field
:max_attachment_size
,
class:
'form-control'
=
f
.
number_field
:max_attachment_size
,
class:
'form-control'
.form-group
.form-group
=
f
.
label
:receive_max_input_size
,
'Maximum push size (MB)'
,
class:
'label-light'
=
f
.
label
:receive_max_input_size
,
'Maximum push size (MB)'
,
class:
'label-light'
=
f
.
number_field
:receive_max_input_size
,
class:
'form-control'
=
f
.
number_field
:receive_max_input_size
,
class:
'form-control
qa-receive-max-input-size-field
'
.form-group
.form-group
=
f
.
label
:session_expire_delay
,
'Session duration (minutes)'
,
class:
'label-light'
=
f
.
label
:session_expire_delay
,
'Session duration (minutes)'
,
class:
'label-light'
=
f
.
number_field
:session_expire_delay
,
class:
'form-control'
=
f
.
number_field
:session_expire_delay
,
class:
'form-control'
...
@@ -46,4 +46,4 @@
...
@@ -46,4 +46,4 @@
=
f
.
label
:user_show_add_ssh_key_message
,
class:
'form-check-label'
do
=
f
.
label
:user_show_add_ssh_key_message
,
class:
'form-check-label'
do
Inform users without uploaded SSH keys that they can't push over SSH until one is added
Inform users without uploaded SSH keys that they can't push over SSH until one is added
=
f
.
submit
'Save changes'
,
class:
'btn btn-success'
=
f
.
submit
'Save changes'
,
class:
'btn btn-success
qa-save-changes-button
'
app/views/admin/application_settings/show.html.haml
浏览文件 @
ec3c3d2b
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
.settings-content
.settings-content
=
render
'visibility_and_access'
=
render
'visibility_and_access'
%section
.settings.as-account-limit.no-animate
#js-account-settings
{
class:
(
'expanded'
if
expanded_by_default?
)
}
%section
.settings.
qa-account-and-limit-settings.
as-account-limit.no-animate
#js-account-settings
{
class:
(
'expanded'
if
expanded_by_default?
)
}
.settings-header
.settings-header
%h4
%h4
=
_
(
'Account and limit'
)
=
_
(
'Account and limit'
)
...
...
app/views/layouts/nav/sidebar/_admin.html.haml
浏览文件 @
ec3c3d2b
...
@@ -207,7 +207,7 @@
...
@@ -207,7 +207,7 @@
=
_
(
'Settings'
)
=
_
(
'Settings'
)
%li
.divider.fly-out-top-item
%li
.divider.fly-out-top-item
=
nav_link
(
path:
'application_settings#show'
)
do
=
nav_link
(
path:
'application_settings#show'
)
do
=
link_to
admin_application_settings_path
,
title:
_
(
'General'
)
do
=
link_to
admin_application_settings_path
,
title:
_
(
'General'
)
,
class:
'qa-admin-settings-general-item'
do
%span
%span
=
_
(
'General'
)
=
_
(
'General'
)
=
nav_link
(
path:
'application_settings#integrations'
)
do
=
nav_link
(
path:
'application_settings#integrations'
)
do
...
...
qa/qa.rb
浏览文件 @
ec3c3d2b
...
@@ -274,9 +274,11 @@ module QA
...
@@ -274,9 +274,11 @@ module QA
module
Settings
module
Settings
autoload
:Repository
,
'qa/page/admin/settings/repository'
autoload
:Repository
,
'qa/page/admin/settings/repository'
autoload
:General
,
'qa/page/admin/settings/general'
module
Component
module
Component
autoload
:RepositoryStorage
,
'qa/page/admin/settings/component/repository_storage'
autoload
:RepositoryStorage
,
'qa/page/admin/settings/component/repository_storage'
autoload
:AccountAndLimit
,
'qa/page/admin/settings/component/account_and_limit'
end
end
end
end
end
end
...
...
qa/qa/page/admin/menu.rb
浏览文件 @
ec3c3d2b
...
@@ -9,6 +9,7 @@ module QA
...
@@ -9,6 +9,7 @@ module QA
element
:admin_sidebar_submenu
element
:admin_sidebar_submenu
element
:admin_settings_item
element
:admin_settings_item
element
:admin_settings_repository_item
element
:admin_settings_repository_item
element
:admin_settings_general_item
end
end
def
go_to_repository_settings
def
go_to_repository_settings
...
@@ -19,6 +20,14 @@ module QA
...
@@ -19,6 +20,14 @@ module QA
end
end
end
end
def
go_to_general_settings
hover_settings
do
within_submenu
do
click_element
:admin_settings_general_item
end
end
end
private
private
def
hover_settings
def
hover_settings
...
...
qa/qa/page/admin/settings/component/account_and_limit.rb
0 → 100644
浏览文件 @
ec3c3d2b
# frozen_string_literal: true
module
QA
module
Page
module
Admin
module
Settings
module
Component
class
AccountAndLimit
<
Page
::
Base
view
'app/views/admin/application_settings/_account_and_limit.html.haml'
do
element
:receive_max_input_size_field
element
:save_changes_button
end
def
set_max_file_size
(
size
)
fill_element
:receive_max_input_size_field
,
size
end
def
save_settings
click_element
:save_changes_button
end
end
end
end
end
end
end
qa/qa/page/admin/settings/general.rb
0 → 100644
浏览文件 @
ec3c3d2b
# frozen_string_literal: true
module
QA
module
Page
module
Admin
module
Settings
class
General
<
Page
::
Base
include
QA
::
Page
::
Settings
::
Common
view
'app/views/admin/application_settings/show.html.haml'
do
element
:account_and_limit_settings
end
def
expand_account_and_limit
(
&
block
)
expand_section
(
:account_and_limit_settings
)
do
Component
::
AccountAndLimit
.
perform
(
&
block
)
end
end
end
end
end
end
end
qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb
0 → 100644
浏览文件 @
ec3c3d2b
# frozen_string_literal: true
module
QA
context
'Create'
do
describe
'push after setting the file size limit via admin/application_settings'
do
before
(
:all
)
do
push
=
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
p
|
p
.
file_name
=
'README.md'
p
.
file_content
=
'# This is a test project'
p
.
commit_message
=
'Add README.md'
end
@project
=
push
.
project
end
before
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
end
after
(
:all
)
do
# need to set the default value after test
# default value for file size limit is empty
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
set_file_size_limit
(
''
)
end
it
'push successful when the file size is under the limit'
do
set_file_size_limit
(
5
)
expect
(
page
).
to
have_content
(
"Application settings saved successfully"
)
push
=
push_new_file
(
'oversize_file_1.bin'
)
expect
(
push
.
output
).
not_to
have_content
'remote: fatal: pack exceeds maximum allowed size'
end
it
'push fails when the file size is above the limit'
do
set_file_size_limit
(
1
)
expect
(
page
).
to
have_content
(
"Application settings saved successfully"
)
push
=
push_new_file
(
'oversize_file_2.bin'
)
expect
(
push
.
output
).
to
have_content
'remote: fatal: pack exceeds maximum allowed size'
end
def
set_file_size_limit
(
limit
)
Page
::
Main
::
Menu
.
perform
(
&
:go_to_admin_area
)
Page
::
Admin
::
Menu
.
perform
(
&
:go_to_general_settings
)
Page
::
Admin
::
Settings
::
General
.
perform
do
|
setting
|
setting
.
expand_account_and_limit
do
|
page
|
page
.
set_max_file_size
(
limit
)
page
.
save_settings
end
end
end
def
push_new_file
(
file_name
)
@project
.
visit!
Resource
::
Repository
::
ProjectPush
.
fabricate!
do
|
p
|
p
.
project
=
@project
p
.
file_name
=
file_name
p
.
file_content
=
SecureRandom
.
random_bytes
(
2000000
)
p
.
commit_message
=
'Adding a new file'
end
end
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录