summaryrefslogtreecommitdiff
path: root/spec/routing
diff options
context:
space:
mode:
authorJason Hollingsworth <jhworth.developer@gmail.com>2013-12-20 13:12:44 -0600
committerJason Hollingsworth <jhworth.developer@gmail.com>2014-01-02 10:18:56 -0600
commit7cc25205410efc6b20b11d94ab2cbc1a322ff816 (patch)
tree8d8ce2cd304bd46426bb4c186ca690e6650e5d57 /spec/routing
parentb512fbc0ecba0a8de9c9efe5c7d82a97f0ea744c (diff)
downloadgitlab-ce-7cc25205410efc6b20b11d94ab2cbc1a322ff816.tar.gz
Add support for various archive formats.
Used mime-types gem instead of hardcoding content types. Allow multiple extensions in archive route (.tar.gz, .tar.bz2). Change content disposition from infile(?) to attachment for api. Fixed api would return “archive” instead of {project}-{hash}.{ext}
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/project_routing_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb
index 5597f08d186..97f7392e50a 100644
--- a/spec/routing/project_routing_spec.rb
+++ b/spec/routing/project_routing_spec.rb
@@ -130,6 +130,14 @@ describe Projects::RepositoriesController, "routing" do
get("/gitlab/gitlabhq/repository/archive").should route_to('projects/repositories#archive', project_id: 'gitlab/gitlabhq')
end
+ it "to #archive format:zip" do
+ get("/gitlab/gitlabhq/repository/archive.zip").should route_to('projects/repositories#archive', project_id: 'gitlab/gitlabhq', format: 'zip')
+ end
+
+ it "to #archive format:tar.bz2" do
+ get("/gitlab/gitlabhq/repository/archive.tar.bz2").should route_to('projects/repositories#archive', project_id: 'gitlab/gitlabhq', format: 'tar.bz2')
+ end
+
it "to #show" do
get("/gitlab/gitlabhq/repository").should route_to('projects/repositories#show', project_id: 'gitlab/gitlabhq')
end