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
2570e4df
Commit
2570e4df
authored
Feb 20, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs.
parent
7f1adc3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
config/routes.rb
config/routes.rb
+6
-4
spec/controllers/projects/uploads_controller_spec.rb
spec/controllers/projects/uploads_controller_spec.rb
+2
-2
No files found.
config/routes.rb
View file @
2570e4df
...
@@ -75,11 +75,13 @@ Gitlab::Application.routes.draw do
...
@@ -75,11 +75,13 @@ Gitlab::Application.routes.draw do
scope
path: :uploads
do
scope
path: :uploads
do
# Note attachments and User/Group/Project avatars
# Note attachments and User/Group/Project avatars
get
":model/:mounted_as/:id/:filename"
,
to:
"uploads#show"
,
get
":model/:mounted_as/:id/:filename"
,
to:
"uploads#show"
,
constraints:
{
model:
/note|user|group|project/
,
mounted_as:
/avatar|attachment/
,
filename:
/.+/
}
constraints:
{
model:
/note|user|group|project/
,
mounted_as:
/avatar|attachment/
,
filename:
/.+/
}
# Project markdown uploads
# Project markdown uploads
get
":project_id/:secret/:filename"
,
to:
"projects/uploads#show"
,
get
":project_id/:secret/:filename"
,
to:
"projects/uploads#show"
,
constraints:
{
project_id:
/[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/
,
filename:
/.+/
}
constraints:
{
project_id:
/[a-zA-Z.0-9_\-]+\/[a-zA-Z.0-9_\-]+/
,
filename:
/.+/
}
end
end
...
...
spec/controllers/projects/uploads_controller_spec.rb
View file @
2570e4df
...
@@ -29,7 +29,7 @@ describe Projects::UploadsController do
...
@@ -29,7 +29,7 @@ describe Projects::UploadsController do
it
'returns a content with original filename, new link, and correct type.'
do
it
'returns a content with original filename, new link, and correct type.'
do
expect
(
response
.
body
).
to
match
'\"alt\":\"rails_sample\"'
expect
(
response
.
body
).
to
match
'\"alt\":\"rails_sample\"'
expect
(
response
.
body
).
to
match
"
\"
url
\"
:
\"
/
#{
project
.
path_with_namespace
}
/uploads"
expect
(
response
.
body
).
to
match
"
\"
url
\"
:
\"
http://localhost
/
#{
project
.
path_with_namespace
}
/uploads"
expect
(
response
.
body
).
to
match
'\"is_image\":true'
expect
(
response
.
body
).
to
match
'\"is_image\":true'
end
end
end
end
...
@@ -41,7 +41,7 @@ describe Projects::UploadsController do
...
@@ -41,7 +41,7 @@ describe Projects::UploadsController do
it
'returns a content with original filename, new link, and correct type.'
do
it
'returns a content with original filename, new link, and correct type.'
do
expect
(
response
.
body
).
to
match
'\"alt\":\"doc_sample.txt\"'
expect
(
response
.
body
).
to
match
'\"alt\":\"doc_sample.txt\"'
expect
(
response
.
body
).
to
match
"
\"
url
\"
:
\"
/
#{
project
.
path_with_namespace
}
/uploads"
expect
(
response
.
body
).
to
match
"
\"
url
\"
:
\"
http://localhost
/
#{
project
.
path_with_namespace
}
/uploads"
expect
(
response
.
body
).
to
match
'\"is_image\":false'
expect
(
response
.
body
).
to
match
'\"is_image\":false'
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