Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
2bf818c4
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,发现更多精彩内容 >>
未验证
提交
2bf818c4
编写于
5月 22, 2016
作者:
C
Connor Shea
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix some specs which would have broken in 2017 to not break anymore by using a dynamic year value.
上级
b0e12290
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
12 deletion
+12
-12
spec/features/projects/files/project_owner_creates_license_file_spec.rb
...projects/files/project_owner_creates_license_file_spec.rb
+4
-4
spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb
...sees_link_to_create_license_file_in_empty_project_spec.rb
+2
-2
spec/requests/api/licenses_spec.rb
spec/requests/api/licenses_spec.rb
+6
-6
未找到文件。
spec/features/projects/files/project_owner_creates_license_file_spec.rb
浏览文件 @
2bf818c4
...
...
@@ -25,7 +25,7 @@ feature 'project owner creates a license file', feature: true, js: true do
file_content
=
find
(
'.file-content'
)
expect
(
file_content
).
to
have_content
(
'The MIT License (MIT)'
)
expect
(
file_content
).
to
have_content
(
"Copyright (c)
2016
#{
project
.
namespace
.
human_name
}
"
)
expect
(
file_content
).
to
have_content
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
project
.
namespace
.
human_name
}
"
)
fill_in
:commit_message
,
with:
'Add a LICENSE file'
,
visible:
true
click_button
'Commit Changes'
...
...
@@ -33,7 +33,7 @@ feature 'project owner creates a license file', feature: true, js: true do
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
expect
(
page
).
to
have_content
(
'The MIT License (MIT)'
)
expect
(
page
).
to
have_content
(
"Copyright (c)
2016
#{
project
.
namespace
.
human_name
}
"
)
expect
(
page
).
to
have_content
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
project
.
namespace
.
human_name
}
"
)
end
scenario
'project master creates a license file from the "Add license" link'
do
...
...
@@ -48,7 +48,7 @@ feature 'project owner creates a license file', feature: true, js: true do
file_content
=
find
(
'.file-content'
)
expect
(
file_content
).
to
have_content
(
'The MIT License (MIT)'
)
expect
(
file_content
).
to
have_content
(
"Copyright (c)
2016
#{
project
.
namespace
.
human_name
}
"
)
expect
(
file_content
).
to
have_content
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
project
.
namespace
.
human_name
}
"
)
fill_in
:commit_message
,
with:
'Add a LICENSE file'
,
visible:
true
click_button
'Commit Changes'
...
...
@@ -56,6 +56,6 @@ feature 'project owner creates a license file', feature: true, js: true do
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
expect
(
page
).
to
have_content
(
'The MIT License (MIT)'
)
expect
(
page
).
to
have_content
(
"Copyright (c)
2016
#{
project
.
namespace
.
human_name
}
"
)
expect
(
page
).
to
have_content
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
project
.
namespace
.
human_name
}
"
)
end
end
spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb
浏览文件 @
2bf818c4
...
...
@@ -24,7 +24,7 @@ feature 'project owner sees a link to create a license file in empty project', f
file_content
=
find
(
'.file-content'
)
expect
(
file_content
).
to
have_content
(
'The MIT License (MIT)'
)
expect
(
file_content
).
to
have_content
(
"Copyright (c)
2016
#{
project
.
namespace
.
human_name
}
"
)
expect
(
file_content
).
to
have_content
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
project
.
namespace
.
human_name
}
"
)
fill_in
:commit_message
,
with:
'Add a LICENSE file'
,
visible:
true
# Remove pre-receive hook so we can push without auth
...
...
@@ -34,6 +34,6 @@ feature 'project owner sees a link to create a license file in empty project', f
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
expect
(
page
).
to
have_content
(
'The MIT License (MIT)'
)
expect
(
page
).
to
have_content
(
"Copyright (c)
2016
#{
project
.
namespace
.
human_name
}
"
)
expect
(
page
).
to
have_content
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
project
.
namespace
.
human_name
}
"
)
end
end
spec/requests/api/licenses_spec.rb
浏览文件 @
2bf818c4
...
...
@@ -57,7 +57,7 @@ describe API::Licenses, api: true do
end
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'Copyright (c) 2016 Anton'
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright (c)
#{
Time
.
now
.
year
}
Anton"
)
end
end
...
...
@@ -70,7 +70,7 @@ describe API::Licenses, api: true do
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'My Awesome Project'
)
expect
(
json_response
[
'content'
]).
to
include
(
'Copyright (C) 2016 Anton'
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright (C)
#{
Time
.
now
.
year
}
Anton"
)
end
end
...
...
@@ -83,7 +83,7 @@ describe API::Licenses, api: true do
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'My Awesome Project'
)
expect
(
json_response
[
'content'
]).
to
include
(
'Copyright (C) 2016 Anton'
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright (C)
#{
Time
.
now
.
year
}
Anton"
)
end
end
...
...
@@ -96,7 +96,7 @@ describe API::Licenses, api: true do
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'My Awesome Project'
)
expect
(
json_response
[
'content'
]).
to
include
(
'Copyright (C) 2016 Anton'
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright (C)
#{
Time
.
now
.
year
}
Anton"
)
end
end
...
...
@@ -108,7 +108,7 @@ describe API::Licenses, api: true do
end
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'Copyright 2016 Anton'
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright
#{
Time
.
now
.
year
}
Anton"
)
end
end
...
...
@@ -128,7 +128,7 @@ describe API::Licenses, api: true do
it
'replaces the copyright owner placeholder with the name of the current user'
do
get
api
(
'/licenses/mit'
,
user
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright (c)
2016
#{
user
.
name
}
"
)
expect
(
json_response
[
'content'
]).
to
include
(
"Copyright (c)
#{
Time
.
now
.
year
}
#{
user
.
name
}
"
)
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录