2011-10-14 21:43:25 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'benchmark'
|
|
|
|
|
|
|
|
describe "Projects" do
|
|
|
|
before { login_as :user }
|
|
|
|
|
|
|
|
describe "GET /projects/tree" do
|
|
|
|
describe "head" do
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2011-10-14 21:43:25 +02:00
|
|
|
@project = Factory :project
|
|
|
|
@project.add_access(@user, :read)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
it "should be fast" do
|
2011-10-14 21:43:25 +02:00
|
|
|
time = Benchmark.realtime do
|
|
|
|
visit tree_project_path(@project)
|
|
|
|
end
|
|
|
|
(time < 1.0).should be_true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe ValidCommit::ID do
|
2011-10-26 15:46:25 +02:00
|
|
|
before do
|
2011-10-14 21:43:25 +02:00
|
|
|
@project = Factory :project
|
|
|
|
@project.add_access(@user, :read)
|
|
|
|
end
|
|
|
|
|
2011-10-26 15:46:25 +02:00
|
|
|
it "should be fast" do
|
2011-10-14 21:43:25 +02:00
|
|
|
time = Benchmark.realtime do
|
|
|
|
visit tree_project_path(@project, :commit_id => ValidCommit::ID)
|
|
|
|
end
|
|
|
|
(time < 1.0).should be_true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|