FIX: The 'reviewed' status filter should include deleted elements (#8630)
This commit is contained in:
parent
5214f82841
commit
c751291769
|
@ -604,7 +604,7 @@ protected
|
|||
return partial_result if status == :all
|
||||
|
||||
if status == :reviewed
|
||||
partial_result.where(status: [statuses[:approved], statuses[:rejected], statuses[:ignored]])
|
||||
partial_result.where(status: statuses.except(:pending).values)
|
||||
else
|
||||
partial_result.where(status: statuses[status])
|
||||
end
|
||||
|
|
|
@ -460,4 +460,12 @@ RSpec.describe Reviewable, type: :model do
|
|||
expect(results.first).to eq first_reviewable
|
||||
end
|
||||
end
|
||||
|
||||
describe '.by_status' do
|
||||
it 'includes reviewables with deleted targets when passing the reviewed status' do
|
||||
reviewable = Fabricate(:reviewable_queued_post, status: Reviewable.statuses[:deleted])
|
||||
|
||||
expect(Reviewable.by_status(Reviewable.all, :reviewed)).to contain_exactly(reviewable)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue