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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
ea5b462a
Commit
ea5b462a
authored
Dec 08, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub the calls to disk and check what send_file returns.
parent
9bf51ae4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
spec/controllers/projects/raw_controller_spec.rb
spec/controllers/projects/raw_controller_spec.rb
+3
-1
No files found.
spec/controllers/projects/raw_controller_spec.rb
View file @
ea5b462a
...
...
@@ -41,16 +41,18 @@ describe Projects::RawController do
context
'when project has access'
do
before
do
public_project
.
lfs_objects
<<
lfs_object
allow_any_instance_of
(
LfsObjectUploader
).
to
receive
(
:exists?
).
and_return
(
true
)
allow
(
controller
).
to
receive
(
:send_file
)
{
controller
.
render
:nothing
=>
true
}
end
it
'serves the file'
do
expect
(
controller
).
to
receive
(
:send_file
).
with
(
"
#{
Gitlab
.
config
.
shared
.
path
}
/lfs-objects/91/ef/f75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897"
,
:filename
=>
"lfs_object.iso"
,
:disposition
=>
'attachment'
)
get
(
:show
,
namespace_id:
public_project
.
namespace
.
to_param
,
project_id:
public_project
.
to_param
,
id:
id
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
header
[
'Content-Type'
]).
to
eq
(
'application/octet-stream'
)
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