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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5678a119
Commit
5678a119
authored
Mar 19, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the failing specs
parent
7c753186
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
92 deletions
+7
-92
ee/spec/controllers/concerns/send_file_upload_spec.rb
ee/spec/controllers/concerns/send_file_upload_spec.rb
+0
-89
spec/controllers/concerns/send_file_upload_spec.rb
spec/controllers/concerns/send_file_upload_spec.rb
+5
-3
spec/requests/api/jobs_spec.rb
spec/requests/api/jobs_spec.rb
+2
-0
vendor/project_templates/express.tar.gz
vendor/project_templates/express.tar.gz
+0
-0
vendor/project_templates/rails.tar.gz
vendor/project_templates/rails.tar.gz
+0
-0
vendor/project_templates/spring.tar.gz
vendor/project_templates/spring.tar.gz
+0
-0
No files found.
ee/spec/controllers/concerns/send_file_upload_spec.rb
deleted
100644 → 0
View file @
7c753186
require
'spec_helper'
describe
SendFileUpload
do
let
(
:uploader_class
)
do
Class
.
new
(
GitlabUploader
)
do
include
ObjectStorage
::
Concern
storage_options
Gitlab
.
config
.
uploads
private
# user/:id
def
dynamic_segment
File
.
join
(
model
.
class
.
to_s
.
underscore
,
model
.
id
.
to_s
)
end
end
end
let
(
:controller_class
)
do
Class
.
new
do
include
SendFileUpload
end
end
let
(
:object
)
{
build_stubbed
(
:user
)
}
let
(
:uploader
)
{
uploader_class
.
new
(
object
,
:file
)
}
describe
'#send_upload'
do
let
(
:controller
)
{
controller_class
.
new
}
let
(
:temp_file
)
{
Tempfile
.
new
(
'test'
)
}
subject
{
controller
.
send_upload
(
uploader
)
}
before
do
FileUtils
.
touch
(
temp_file
)
end
after
do
FileUtils
.
rm_f
(
temp_file
)
end
context
'when local file is used'
do
before
do
uploader
.
store!
(
temp_file
)
end
it
'sends a file'
do
expect
(
controller
).
to
receive
(
:send_file
).
with
(
uploader
.
path
,
anything
)
subject
end
end
context
'when remote file is used'
do
before
do
stub_uploads_object_storage
(
uploader:
uploader_class
)
uploader
.
object_store
=
ObjectStorage
::
Store
::
REMOTE
uploader
.
store!
(
temp_file
)
end
context
'and proxying is enabled'
do
before
do
allow
(
Gitlab
.
config
.
uploads
.
object_store
).
to
receive
(
:proxy_download
)
{
true
}
end
it
'sends a file'
do
headers
=
double
expect
(
headers
).
to
receive
(
:store
).
with
(
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
,
/^send-url:/
)
expect
(
controller
).
to
receive
(
:headers
)
{
headers
}
expect
(
controller
).
to
receive
(
:head
).
with
(
:ok
)
subject
end
end
context
'and proxying is disabled'
do
before
do
allow
(
Gitlab
.
config
.
uploads
.
object_store
).
to
receive
(
:proxy_download
)
{
false
}
end
it
'sends a file'
do
expect
(
controller
).
to
receive
(
:redirect_to
).
with
(
/
#{
uploader
.
path
}
/
)
subject
end
end
end
end
end
spec/controllers/concerns/send_file_upload_spec.rb
View file @
5678a119
...
...
@@ -64,10 +64,12 @@ describe SendFileUpload do
end
it
'sends a file'
do
subject
headers
=
double
expect
(
headers
).
to
receive
(
:store
).
with
(
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
,
/^send-url:/
)
expect
(
controller
).
to
receive
(
:headers
)
{
headers
}
expect
(
controller
).
to
receive
(
:head
).
with
(
:ok
)
is_expected
.
to
start_with
(
Gitlab
::
Workhorse
::
SEND_DATA_HEADER
)
is_expected
.
to
end_with
(
/^send-url:/
)
subject
end
end
...
...
spec/requests/api/jobs_spec.rb
View file @
5678a119
require
'spec_helper'
describe
API
::
Jobs
do
include
HttpIOHelpers
set
(
:project
)
do
create
(
:project
,
:repository
,
public_builds:
false
)
end
...
...
vendor/project_templates/express.tar.gz
View file @
5678a119
No preview for this file type
vendor/project_templates/rails.tar.gz
View file @
5678a119
No preview for this file type
vendor/project_templates/spring.tar.gz
View file @
5678a119
No preview for this file type
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