Added benchmark for User.all
This benchmark exists to test if ordering has any noticeable impact in the test environment.
This commit is contained in:
parent
8f75200d46
commit
0df65909ef
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,16 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe User, benchmark: true do
|
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
|
describe '.by_login' do
|
||||||
before do
|
before do
|
||||||
%w{Alice Bob Eve}.each do |name|
|
%w{Alice Bob Eve}.each do |name|
|
||||||
|
|
Loading…
Reference in a new issue