diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-03 11:47:23 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-11-03 11:47:23 +0100 |
commit | 0df65909eff560f2d313c4034ed21a65d643a0c3 (patch) | |
tree | bca0f1881450ce25e5c51fba7aa241f0a1e35c31 /spec/benchmarks | |
parent | 8f75200d466d41707f3b1ca12ca4244cfa2e2e7b (diff) | |
download | gitlab-ce-0df65909eff560f2d313c4034ed21a65d643a0c3.tar.gz |
Added benchmark for User.all
This benchmark exists to test if ordering has any noticeable impact in
the test environment.
Diffstat (limited to 'spec/benchmarks')
-rw-r--r-- | spec/benchmarks/models/user_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/benchmarks/models/user_spec.rb b/spec/benchmarks/models/user_spec.rb index 4cdba66939b..1be7a8d3ed9 100644 --- a/spec/benchmarks/models/user_spec.rb +++ b/spec/benchmarks/models/user_spec.rb @@ -1,6 +1,16 @@ require 'spec_helper' describe User, benchmark: true do + describe '.all' do + before do + 10.times { create(:user) } + end + + benchmark_subject { User.all.to_a } + + it { is_expected.to iterate_per_second(500) } + end + describe '.by_login' do before do %w{Alice Bob Eve}.each do |name| |