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:
Yorick Peterse 2015-11-03 11:47:23 +01:00
parent 8f75200d46
commit 0df65909ef

View file

@ -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|