Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
mamot
Commits
affd7593
Commit
affd7593
authored
Apr 26, 2017
by
Matt Jankowski
Committed by
Eugen Rochko
Apr 26, 2017
Browse files
Add spec for Status.as_home_timeline (#2451)
parent
3e78b7cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
spec/models/status_spec.rb
View file @
affd7593
...
...
@@ -126,4 +126,31 @@ RSpec.describe Status, type: :model do
describe
'#filter_from_context?'
do
pending
end
describe
'.as_home_timeline'
do
before
do
account
=
Fabricate
(
:account
)
followed
=
Fabricate
(
:account
)
not_followed
=
Fabricate
(
:account
)
Fabricate
(
:follow
,
account:
account
,
target_account:
followed
)
@self_status
=
Fabricate
(
:status
,
account:
account
)
@followed_status
=
Fabricate
(
:status
,
account:
followed
)
@not_followed_status
=
Fabricate
(
:status
,
account:
not_followed
)
@results
=
Status
.
as_home_timeline
(
account
)
end
it
'includes statuses from self'
do
expect
(
@results
).
to
include
(
@self_status
)
end
it
'includes statuses from followed'
do
expect
(
@results
).
to
include
(
@followed_status
)
end
it
'does not include statuses from non-followed'
do
expect
(
@results
).
not_to
include
(
@not_followed_status
)
end
end
end
Write
Preview
Supports
Markdown
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