Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4249fc8a
Commit
4249fc8a
authored
Oct 22, 2020
by
Alex Pooley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky spec using relative times
parent
8aa2612e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
spec/models/member_spec.rb
spec/models/member_spec.rb
+8
-3
No files found.
spec/models/member_spec.rb
View file @
4249fc8a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment