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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
d5094e7c
Commit
d5094e7c
authored
Dec 06, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve PruneWebHookLogsWorker spec
parent
536c1e40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
spec/workers/prune_web_hook_logs_worker_spec.rb
spec/workers/prune_web_hook_logs_worker_spec.rb
+9
-7
No files found.
spec/workers/prune_web_hook_logs_worker_spec.rb
View file @
d5094e7c
...
@@ -5,18 +5,20 @@ describe PruneWebHookLogsWorker do
...
@@ -5,18 +5,20 @@ describe PruneWebHookLogsWorker do
before
do
before
do
hook
=
create
(
:project_hook
)
hook
=
create
(
:project_hook
)
5
.
times
do
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
5
.
months
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
5
.
months
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
4
.
months
.
ago
)
end
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
91
.
days
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
89
.
days
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
2
.
months
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
created_at:
1
.
month
.
ago
)
create
(
:web_hook_log
,
web_hook:
hook
,
response_status:
'404'
)
create
(
:web_hook_log
,
web_hook:
hook
,
response_status:
'404'
)
end
end
it
'removes all web hook logs older than
one month
'
do
it
'removes all web hook logs older than
90 days
'
do
described_class
.
new
.
perform
described_class
.
new
.
perform
expect
(
WebHookLog
.
count
).
to
eq
(
1
)
expect
(
WebHookLog
.
count
).
to
eq
(
4
)
expect
(
WebHookLog
.
fir
st
.
response_status
).
to
eq
(
'404'
)
expect
(
WebHookLog
.
la
st
.
response_status
).
to
eq
(
'404'
)
end
end
end
end
end
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