Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIzaak Alpert <ialpert@blackberry.com>2013-10-03 00:37:11 +0400
committerIzaak Alpert <ialpert@blackberry.com>2013-10-10 17:19:28 +0400
commit7cad12f77f223e72a05a3cf79a793b69dd9c0b87 (patch)
treec9e1eee5a2f67dd27b7e52c45317ab68ea9dfc5b /spec/requests
parenta00c534c4c7921e40f58f714291a2bb09ad02225 (diff)
Added more tests for archive api
Change-Id: I2b0752bc2593a944d42dde0ffe0ef9ce408228a5
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/repositories_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb
index 6cd8c2688ff..2fcf6ba27b8 100644
--- a/spec/requests/api/repositories_spec.rb
+++ b/spec/requests/api/repositories_spec.rb
@@ -229,6 +229,15 @@ describe API::API do
it "should get the archive" do
get api("/projects/#{project.id}/repository/archive", user)
response.status.should == 200
+ response.content_type.should == 'application/x-gzip'
+ storage_path = Rails.root.join("tmp", "repositories")
+ file_path = project.repository.archive_repo(nil, storage_path)
+ file_path_compare = file_path + 'compare'
+ File.open(file_path_compare,'wb'){|f|f.write(response.body)}
+ FileUtils.compare_file(file_path, file_path_compare).should be_true
+ #cleanup
+ File.delete(file_path)
+ File.delete(file_path_compare)
end
it "should return 404 for invalid sha" do