0
0
Fork 0

Fixes NoMethodError: undefined method 'first' for nil:NilClass (#3036)

This commit is contained in:
alpaca-tc 2017-05-13 22:56:12 +09:00 committed by Eugen Rochko
parent 1027556614
commit e9810cbad6
2 changed files with 14 additions and 1 deletions

View file

@ -179,6 +179,19 @@ RSpec.describe Status, type: :model do
end
end
describe '#ancestors' do
it 'ignores deleted records' do
first_status = Fabricate(:status, account: bob)
second_status = Fabricate(:status, thread: first_status, account: alice)
# Create cache and delete cached record
second_status.ancestors
first_status.destroy
expect(second_status.ancestors).to eq([])
end
end
describe '#filter_from_context?' do
pending
end