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
Léo-Paul Géneau
gitlab-ce
Commits
4b154615
Commit
4b154615
authored
Jan 08, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for gitlab:uploads rake tasks
parent
b1378f05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
spec/tasks/gitlab/uploads_rake_spec.rb
spec/tasks/gitlab/uploads_rake_spec.rb
+28
-0
No files found.
spec/tasks/gitlab/uploads_rake_spec.rb
0 → 100644
View file @
4b154615
require
'rake_helper'
describe
'gitlab:uploads rake tasks'
do
describe
'check'
do
before
do
Rake
.
application
.
rake_require
'tasks/gitlab/uploads'
end
it
'outputs the integrity check for each uploaded file'
do
uploaded_file
=
create
(
:upload
)
expect
{
run_rake_task
(
'gitlab:uploads:check'
)
}.
to
output
(
/Checking file \(
#{
uploaded_file
.
id
}
\):
#{
Regexp
.
quote
(
uploaded_file
.
absolute_path
)
}
/
).
to_stdout
end
it
'errors out about missing files on the file system'
do
uploaded_file
=
create
(
:upload
)
expect
{
run_rake_task
(
'gitlab:uploads:check'
)
}.
to
output
(
/File does not exist on the file system/
).
to_stdout
end
it
'errors out about invalid checksum'
do
uploaded_file
=
create
(
:upload
,
path:
Rails
.
root
.
join
(
'spec/fixtures/banana_sample.gif'
))
uploaded_file
.
update_column
(
:checksum
,
'01a3156db2cf4f67ec823680b40b7302f89ab39179124ad219f94919b8a1769e'
)
expect
{
run_rake_task
(
'gitlab:uploads:check'
)
}.
to
output
(
/File checksum \(9e697aa09fe196909813ee36103e34f721fe47a5fdc8aac0e4e4ac47b9b38282\) does not match the one in the database \(
#{
uploaded_file
.
checksum
}
\)/
).
to_stdout
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