Fixed: invalid browse code for commit. Perfomance test added
This commit is contained in:
parent
153f6cd86b
commit
5f8255ac67
4 changed files with 40 additions and 2 deletions
37
spec/requests/projects_tree_perfomance_spec.rb
Normal file
37
spec/requests/projects_tree_perfomance_spec.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue