mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-23 02:33:21 +00:00
Add Status.only_polls (and without polls) scope (#35330)
This commit is contained in:
parent
a315934314
commit
4ecfbd3920
4 changed files with 26 additions and 2 deletions
|
|
@ -363,6 +363,28 @@ RSpec.describe Status do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.only_polls' do
|
||||
let!(:poll_status) { Fabricate :status, poll: Fabricate(:poll) }
|
||||
let!(:no_poll_status) { Fabricate :status }
|
||||
|
||||
it 'returns the expected statuses' do
|
||||
expect(described_class.only_polls)
|
||||
.to include(poll_status)
|
||||
.and not_include(no_poll_status)
|
||||
end
|
||||
end
|
||||
|
||||
describe '.without_polls' do
|
||||
let!(:poll_status) { Fabricate :status, poll: Fabricate(:poll) }
|
||||
let!(:no_poll_status) { Fabricate :status }
|
||||
|
||||
it 'returns the expected statuses' do
|
||||
expect(described_class.without_polls)
|
||||
.to not_include(poll_status)
|
||||
.and include(no_poll_status)
|
||||
end
|
||||
end
|
||||
|
||||
describe '.tagged_with' do
|
||||
let(:tag_cats) { Fabricate(:tag, name: 'cats') }
|
||||
let(:tag_dogs) { Fabricate(:tag, name: 'dogs') }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue