Commit 7cad12f7 authored by Izaak Alpert's avatar Izaak Alpert

Added more tests for archive api

Change-Id: I2b0752bc2593a944d42dde0ffe0ef9ce408228a5
parent a00c534c
...@@ -229,6 +229,15 @@ describe API::API do ...@@ -229,6 +229,15 @@ describe API::API do
it "should get the archive" do it "should get the archive" do
get api("/projects/#{project.id}/repository/archive", user) get api("/projects/#{project.id}/repository/archive", user)
response.status.should == 200 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 end
it "should return 404 for invalid sha" do it "should return 404 for invalid sha" do
......
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