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
03d1a326
Commit
03d1a326
authored
Jun 23, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Freeze time in unique_visits_spec.rb
parent
9c7a9087
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
spec/lib/gitlab/analytics/unique_visits_spec.rb
spec/lib/gitlab/analytics/unique_visits_spec.rb
+9
-0
No files found.
spec/lib/gitlab/analytics/unique_visits_spec.rb
View file @
03d1a326
...
...
@@ -10,6 +10,15 @@ describe Gitlab::Analytics::UniqueVisits, :clean_gitlab_redis_shared_state do
let
(
:visitor1_id
)
{
'dfb9d2d2-f56c-4c77-8aeb-6cddc4a1f857'
}
let
(
:visitor2_id
)
{
'1dd9afb2-a3ee-4de1-8ae3-a405579c8584'
}
around
do
|
example
|
# We need to freeze to a reference time
# because visits are grouped by the week number in the year
# Without freezing the time, the test may behave inconsistently
# depending on which day of the week test is run.
reference_time
=
Time
.
utc
(
2020
,
6
,
1
)
Timecop
.
freeze
(
reference_time
)
{
example
.
run
}
end
describe
'#track_visit'
do
it
'tracks the unique weekly visits for targets'
do
unique_visits
.
track_visit
(
visitor1_id
,
target1_id
,
7
.
days
.
ago
)
...
...
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