Commit 23f799d0 authored by James Lopez's avatar James Lopez

improve finder spec

parent 02a3f55d
...@@ -63,11 +63,14 @@ describe UsersFinder do ...@@ -63,11 +63,14 @@ describe UsersFinder do
end end
it 'filters by created_at' do 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, users = described_class.new(user,
created_after: 2.days.ago, created_after: 2.days.ago,
created_before: Time.now + 2.days).execute 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
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