.view_file_header
%strong
= name
- -#= file.mime_type
= link_to "raw", blob_project_path(@project, :commit_id => @commit.id, :path => params[:path] ), :class => "right", :target => "_blank"
= link_to "history", project_commits_path(@project, :path => params[:path]), :class => "right", :style => "margin-right:10px;"
%br/
- file = params[:path] ? File.join(params[:path], content.name) : content.name
-- content_commit = @project.repo.log(@branch, file, :max_count => 1).last
+- content_commit = @project.repo.log(@commit.id, file, :max_count => 1).last
- return unless content_commit
%tr{ :class => "tree-item", :url => tree_file_project_path(@project, @commit.id, file) }
%td.tree-item-file-name
--- /dev/null
+require 'spec_helper'
+require 'benchmark'
+
+describe "Projects" do
+ before { login_as :user }
+
+ describe "GET /projects/tree" do
+ describe "head" do
+ before do
+ @project = Factory :project
+ @project.add_access(@user, :read)
+
+ end
+
+ it "should be fast" do
+ time = Benchmark.realtime do
+ visit tree_project_path(@project)
+ end
+ (time < 1.0).should be_true
+ end
+ end
+
+ describe ValidCommit::ID do
+ before do
+ @project = Factory :project
+ @project.add_access(@user, :read)
+ end
+
+ it "should be fast" do
+ time = Benchmark.realtime do
+ visit tree_project_path(@project, :commit_id => ValidCommit::ID)
+ end
+ (time < 1.0).should be_true
+ end
+ end
+ end
+end