improve finder spec

This commit is contained in:
James Lopez 2017-07-07 10:29:38 +02:00
parent 037ad5a5a3
commit bfe5f2d19f

View file

@ -47,11 +47,14 @@ describe UsersFinder do
end
it 'filters by created_at' do
filtered_user_before = create(:user, created_at: 3.days.ago)
filtered_user_after = create(:user, created_at: Time.now + 3.days)
users = described_class.new(user,
created_after: 2.days.ago,
created_before: Time.now + 2.days).execute
expect(users.count).to eq(4)
expect(users.map(&:username)).not_to include([filtered_user_before.username, filtered_user_after.username])
end
end