Commit 2570e4df authored by Douwe Maan's avatar Douwe Maan

Fix specs.

parent 7f1adc3d
...@@ -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
......
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment