提交 7cad12f7 编写于 作者: I Izaak Alpert

Added more tests for archive api

Change-Id: I2b0752bc2593a944d42dde0ffe0ef9ce408228a5
上级 a00c534c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册