improve finder spec
This commit is contained in:
parent
037ad5a5a3
commit
bfe5f2d19f
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue