Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
225c6582
Unverified
Commit
225c6582
authored
3 years ago
by
Claire
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for BootstrapTimelineService (#16476)
parent
8af7f3b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/services/bootstrap_timeline_service_spec.rb
+33
-0
33 additions, 0 deletions
spec/services/bootstrap_timeline_service_spec.rb
with
33 additions
and
0 deletions
spec/services/bootstrap_timeline_service_spec.rb
+
33
−
0
View file @
225c6582
require
'rails_helper'
RSpec
.
describe
BootstrapTimelineService
,
type: :service
do
subject
{
BootstrapTimelineService
.
new
}
context
'when the new user has registered from an invite'
do
let
(
:service
)
{
double
}
let
(
:autofollow
)
{
false
}
let
(
:inviter
)
{
Fabricate
(
:user
,
confirmed_at:
2
.
days
.
ago
)
}
let
(
:invite
)
{
Fabricate
(
:invite
,
user:
inviter
,
max_uses:
nil
,
expires_at:
1
.
hour
.
from_now
,
autofollow:
autofollow
)
}
let
(
:new_user
)
{
Fabricate
(
:user
,
invite_code:
invite
.
code
)
}
before
do
allow
(
FollowService
).
to
receive
(
:new
).
and_return
(
service
)
allow
(
service
).
to
receive
(
:call
)
end
context
'when the invite has auto-follow enabled'
do
let
(
:autofollow
)
{
true
}
it
'calls FollowService to follow the inviter'
do
subject
.
call
(
new_user
.
account
)
expect
(
service
).
to
have_received
(
:call
).
with
(
new_user
.
account
,
inviter
.
account
)
end
end
context
'when the invite does not have auto-follow enable'
do
let
(
:autofollow
)
{
false
}
it
'calls FollowService to follow the inviter'
do
subject
.
call
(
new_user
.
account
)
expect
(
service
).
to_not
have_received
(
:call
)
end
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment