Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Sep 24, 2023
1 parent 18b4b43 commit c4d6989
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/services/process_mentions_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,27 @@
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

0 comments on commit c4d6989

Please sign in to comment.