gitlab-org--gitlab-foss/spec/benchmarks/services/projects/create_service_spec.rb
Yorick Peterse 6369c992a6 Added benchmark for Projects::CreateService
This benchmark currently runs at ~0.6 iterations per second and is
unlikely to perform any better any time soon.
2015-10-29 12:09:25 +01:00

28 lines
731 B
Ruby

require 'spec_helper'
describe Projects::CreateService, benchmark: true do
describe '#execute' do
let(:user) { create(:user, :admin) }
let(:group) do
group = create(:group)
create(:group_member, group: group, user: user)
group
end
benchmark_subject do
name = SecureRandom.hex
service = described_class.new(user,
name: name,
path: name,
namespace_id: group.id,
visibility_level: Gitlab::VisibilityLevel::PUBLIC)
service.execute
end
it { is_expected.to iterate_per_second(0.5) }
end
end