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
Jérome Perrin
gitlab-ce
Commits
671d247e
Commit
671d247e
authored
Aug 04, 2016
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write test for RemoveExpiredMembersWorker.
parent
8354810f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
spec/workers/remove_expired_members_worker_spec.rb
spec/workers/remove_expired_members_worker_spec.rb
+25
-0
No files found.
spec/workers/remove_expired_members_worker_spec.rb
0 → 100644
View file @
671d247e
require
'spec_helper'
describe
RemoveExpiredMembersWorker
do
let!
(
:worker
)
{
RemoveExpiredMembersWorker
.
new
}
let!
(
:expired_member
)
{
create
(
:project_member
,
expires_at:
1
.
hour
.
ago
)
}
let!
(
:member_expiring_in_future
)
{
create
(
:project_member
,
expires_at:
10
.
days
.
from_now
)
}
let!
(
:non_expiring_member
)
{
create
(
:project_member
,
expires_at:
nil
)
}
describe
"#perform"
do
it
"removes expired members"
do
expect
{
worker
.
perform
}.
to
change
{
Member
.
count
}.
by
(
-
1
)
expect
(
Member
.
find_by
(
id:
expired_member
.
id
)).
to
be_nil
end
it
"leaves members who expire in the future"
do
worker
.
perform
expect
(
member_expiring_in_future
.
reload
).
to
be_present
end
it
"leaves members who do not expire at all"
do
worker
.
perform
expect
(
non_expiring_member
.
reload
).
to
be_present
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