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
5b3ed2af
Commit
5b3ed2af
authored
Sep 06, 2019
by
Alessio Caiazza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test blob_controller POST create
parent
e32069ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
spec/requests/projects/uploads_spec.rb
spec/requests/projects/uploads_spec.rb
+38
-0
No files found.
spec/requests/projects/uploads_spec.rb
0 → 100644
View file @
5b3ed2af
# frozen_string_literal: true
require
'spec_helper'
describe
'File uploads'
do
include
WorkhorseHelpers
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
'POST /:namespace/:project/create/:branch'
do
let
(
:branch
)
{
'master'
}
let
(
:create_url
)
{
project_blob_path
(
project
,
branch
)
}
let
(
:blob_url
)
{
project_blob_path
(
project
,
"
#{
branch
}
/dk.png"
)
}
let
(
:params
)
do
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
branch
,
branch_name:
branch
,
file:
fixture_file_upload
(
'spec/fixtures/dk.png'
),
commit_message:
'Add an image'
}
end
before
do
project
.
add_maintainer
(
user
)
login_as
(
user
)
end
it
'redirects to blob'
do
workhorse_post_with_file
(
create_url
,
file_key: :file
,
params:
params
)
expect
(
response
).
to
redirect_to
(
blob_url
)
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