Add circle posts history support (#18)

* Wip: make web backend

* Wip: keep statuses if edit circle

* Wip: Add circle history page and record circle posts

* Add circle post to history in web ui when post

* Add test
This commit is contained in:
KMY(雪あすか) 2023-09-24 13:01:09 +09:00 committed by GitHub
parent 0a42f4b7e2
commit df3b3f4185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 544 additions and 15 deletions

View file

@ -103,4 +103,27 @@ RSpec.describe ProcessMentionsService, type: :service do
end
end
end
context 'with circle post' do
let(:status) { Fabricate(:status, account: account) }
let(:circle) { Fabricate(:circle, account: account) }
let(:follower) { Fabricate(:account) }
let(:other) { Fabricate(:account) }
before do
follower.follow!(account)
other.follow!(account)
circle.accounts << follower
described_class.new.call(status, limited_type: :circle, circle: circle)
end
it 'remains circle post on history' do
expect(CircleStatus.exists?(circle_id: circle.id, status_id: status.id)).to be true
end
it 'post is delivered to circle members' do
expect(status.mentioned_accounts.count).to eq 1
expect(status.mentioned_accounts.first.id).to eq follower.id
end
end
end