Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-07-07 11:29:38 +0300
committerJames Lopez <james@jameslopez.es>2017-07-07 11:38:58 +0300
commitbfe5f2d19f5be3dd4e039fa5b2b0b6b27c748db9 (patch)
tree0592c0400c2b50bc5a8d9bd88c21e9b08b2855ee /spec/finders/users_finder_spec.rb
parent037ad5a5a30471dfbdf7164b3928cd8dd03c3eae (diff)
improve finder spec
Diffstat (limited to 'spec/finders/users_finder_spec.rb')
-rw-r--r--spec/finders/users_finder_spec.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/finders/users_finder_spec.rb b/spec/finders/users_finder_spec.rb
index a5e4a39a695..1bab6d64388 100644
--- a/spec/finders/users_finder_spec.rb
+++ b/spec/finders/users_finder_spec.rb
@@ -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