0
0
Fork 0

Fix change of status callbacks not setting in_reply_to_account_id and (#3072)

possibly others when expected. Add some tests for it
This commit is contained in:
Eugen Rochko 2017-05-15 21:20:55 +02:00 committed by GitHub
parent 85c9496340
commit af706583bd
2 changed files with 14 additions and 4 deletions

View file

@ -31,6 +31,16 @@ RSpec.describe ProcessFeedService do
expect(Status.find_by(uri: 'tag:kickass.zone,2016-10-10:objectId=2:objectType=Status')).to_not be_nil
end
it 'marks replies as replies' do
status = Status.find_by(uri: 'tag:kickass.zone,2016-10-10:objectId=2:objectType=Status')
expect(status.reply?).to be true
end
it 'sets account being replied to when possible' do
status = Status.find_by(uri: 'tag:kickass.zone,2016-10-10:objectId=2:objectType=Status')
expect(status.in_reply_to_account_id).to eq status.account_id
end
it 'ignores delete statuses unless they existed before' do
expect(Status.find_by(uri: 'tag:kickass.zone,2016-10-10:objectId=3:objectType=Status')).to be_nil
expect(Status.find_by(uri: 'tag:kickass.zone,2016-10-10:objectId=12:objectType=Status')).to be_nil