diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/models/member_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/models/member_spec.rb')
-rw-r--r-- | spec/models/member_spec.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/models/member_spec.rb b/spec/models/member_spec.rb index 118b1492cd6..1a791820f1b 100644 --- a/spec/models/member_spec.rb +++ b/spec/models/member_spec.rb @@ -252,12 +252,17 @@ RSpec.describe Member do end describe '.last_ten_days_excluding_today' do - let_it_be(:created_today) { create(:group_member, created_at: Date.today.beginning_of_day) } - let_it_be(:created_yesterday) { create(:group_member, created_at: 1.day.ago) } - let_it_be(:created_eleven_days_ago) { create(:group_member, created_at: 11.days.ago) } + let_it_be(:now) { Time.current } + let_it_be(:created_today) { create(:group_member, created_at: now.beginning_of_day) } + let_it_be(:created_yesterday) { create(:group_member, created_at: now - 1.day) } + let_it_be(:created_eleven_days_ago) { create(:group_member, created_at: now - 11.days) } subject { described_class.last_ten_days_excluding_today } + before do + travel_to now + end + it { is_expected.to include(created_yesterday) } it { is_expected.not_to include(created_today, created_eleven_days_ago) } end |