Commit bfe5f2d1 authored by James Lopez's avatar James Lopez

improve finder spec

parent 037ad5a5
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment