diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-11-07 21:07:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 21:07:01 +0100 |
commit | ac219dd1f6d660d3728c5881c4eb3b672fea432e (patch) | |
tree | fd2f30f2cb28a964442cc7b10d8ad8729bd659d2 /spec/lib | |
parent | c493c967d67058a305006a09de66a1e08d877680 (diff) | |
parent | 2bc22be66cf09ed19eb7fb23b08324882a73b2b9 (diff) |
Merge pull request #1903 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/status_cache_hydrator_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/status_cache_hydrator_spec.rb b/spec/lib/status_cache_hydrator_spec.rb index c9d8d0fe1..5c78de711 100644 --- a/spec/lib/status_cache_hydrator_spec.rb +++ b/spec/lib/status_cache_hydrator_spec.rb @@ -28,6 +28,18 @@ describe StatusCacheHydrator do end end + context 'when handling a filtered status' do + let(:status) { Fabricate(:status, text: 'this toot is about that banned word') } + + before do + account.custom_filters.create!(phrase: 'filter1', context: %w(home), action: :hide, keywords_attributes: [{ keyword: 'banned' }, { keyword: 'irrelevant' }]) + end + + it 'renders the same attributes as a full render' do + expect(subject).to eql(compare_to_hash) + end + end + context 'when handling a reblog' do let(:reblog) { Fabricate(:status) } let(:status) { Fabricate(:status, reblog: reblog) } @@ -99,6 +111,18 @@ describe StatusCacheHydrator do expect(subject).to eql(compare_to_hash) end end + + context 'that matches account filters' do + let(:reblog) { Fabricate(:status, text: 'this toot is about that banned word') } + + before do + account.custom_filters.create!(phrase: 'filter1', context: %w(home), action: :hide, keywords_attributes: [{ keyword: 'banned' }, { keyword: 'irrelevant' }]) + end + + it 'renders the same attributes as a full render' do + expect(subject).to eql(compare_to_hash) + end + end end end |