diff options
author | gitlabhq <m@gitlabhq.com> | 2011-10-14 23:43:25 +0400 |
---|---|---|
committer | gitlabhq <m@gitlabhq.com> | 2011-10-14 23:43:25 +0400 |
commit | 5f8255ac67e26d8d7dc98cff37ecae5eab4ab3cf (patch) | |
tree | 18a1b313e45f568f4ada7fc013363542d5dc581b /spec | |
parent | 153f6cd86bff0f78abbee07feec6832b73535298 (diff) |
Fixed: invalid browse code for commit. Perfomance test added
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/projects_tree_perfomance_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/requests/projects_tree_perfomance_spec.rb b/spec/requests/projects_tree_perfomance_spec.rb new file mode 100644 index 00000000000..5b4facb17d6 --- /dev/null +++ b/spec/requests/projects_tree_perfomance_spec.rb @@ -0,0 +1,37 @@ +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 |