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
Jérome Perrin
gitlab-ce
Commits
2bf818c4
Commit
2bf818c4
authored
May 22, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some specs which would have broken in 2017 to not break anymore by using a dynamic year value.
parent
b0e12290
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+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
No files found.
spec/features/projects/files/project_owner_creates_license_file_spec.rb
View file @
2bf818c4
...
@@ -25,7 +25,7 @@ feature 'project owner creates a license file', feature: true, js: true do
...
@@ -25,7 +25,7 @@ feature 'project owner creates a license file', feature: true, js: true do
file_content
=
find
(
'.file-content'
)
file_content
=
find
(
'.file-content'
)
expect
(
file_content
).
to
have_content
(
'The MIT License (MIT)'
)
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
fill_in
:commit_message
,
with:
'Add a LICENSE file'
,
visible:
true
click_button
'Commit Changes'
click_button
'Commit Changes'
...
@@ -33,7 +33,7 @@ feature 'project owner creates a license file', feature: true, js: true do
...
@@ -33,7 +33,7 @@ feature 'project owner creates a license file', feature: true, js: true do
expect
(
current_path
).
to
eq
(
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
expect
(
page
).
to
have_content
(
'The MIT License (MIT)'
)
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
scenario
'project master creates a license file from the "Add license" link'
do
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
...
@@ -48,7 +48,7 @@ feature 'project owner creates a license file', feature: true, js: true do
file_content
=
find
(
'.file-content'
)
file_content
=
find
(
'.file-content'
)
expect
(
file_content
).
to
have_content
(
'The MIT License (MIT)'
)
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
fill_in
:commit_message
,
with:
'Add a LICENSE file'
,
visible:
true
click_button
'Commit Changes'
click_button
'Commit Changes'
...
@@ -56,6 +56,6 @@ feature 'project owner creates a license file', feature: true, js: true do
...
@@ -56,6 +56,6 @@ feature 'project owner creates a license file', feature: true, js: true do
expect
(
current_path
).
to
eq
(
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
expect
(
page
).
to
have_content
(
'The MIT License (MIT)'
)
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
end
end
spec/features/projects/files/project_owner_sees_link_to_create_license_file_in_empty_project_spec.rb
View file @
2bf818c4
...
@@ -24,7 +24,7 @@ feature 'project owner sees a link to create a license file in empty project', f
...
@@ -24,7 +24,7 @@ feature 'project owner sees a link to create a license file in empty project', f
file_content
=
find
(
'.file-content'
)
file_content
=
find
(
'.file-content'
)
expect
(
file_content
).
to
have_content
(
'The MIT License (MIT)'
)
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
fill_in
:commit_message
,
with:
'Add a LICENSE file'
,
visible:
true
# Remove pre-receive hook so we can push without auth
# 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
...
@@ -34,6 +34,6 @@ feature 'project owner sees a link to create a license file in empty project', f
expect
(
current_path
).
to
eq
(
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
namespace_project_blob_path
(
project
.
namespace
,
project
,
'master/LICENSE'
))
expect
(
page
).
to
have_content
(
'The MIT License (MIT)'
)
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
end
end
spec/requests/api/licenses_spec.rb
View file @
2bf818c4
...
@@ -57,7 +57,7 @@ describe API::Licenses, api: true do
...
@@ -57,7 +57,7 @@ describe API::Licenses, api: true do
end
end
it
'replaces placeholder values'
do
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
end
end
...
@@ -70,7 +70,7 @@ describe API::Licenses, api: true do
...
@@ -70,7 +70,7 @@ describe API::Licenses, api: true do
it
'replaces placeholder values'
do
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'My Awesome Project'
)
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
end
end
...
@@ -83,7 +83,7 @@ describe API::Licenses, api: true do
...
@@ -83,7 +83,7 @@ describe API::Licenses, api: true do
it
'replaces placeholder values'
do
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'My Awesome Project'
)
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
end
end
...
@@ -96,7 +96,7 @@ describe API::Licenses, api: true do
...
@@ -96,7 +96,7 @@ describe API::Licenses, api: true do
it
'replaces placeholder values'
do
it
'replaces placeholder values'
do
expect
(
json_response
[
'content'
]).
to
include
(
'My Awesome Project'
)
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
end
end
...
@@ -108,7 +108,7 @@ describe API::Licenses, api: true do
...
@@ -108,7 +108,7 @@ describe API::Licenses, api: true do
end
end
it
'replaces placeholder values'
do
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
end
end
...
@@ -128,7 +128,7 @@ describe API::Licenses, api: true do
...
@@ -128,7 +128,7 @@ describe API::Licenses, api: true do
it
'replaces the copyright owner placeholder with the name of the current user'
do
it
'replaces the copyright owner placeholder with the name of the current user'
do
get
api
(
'/licenses/mit'
,
user
)
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
end
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