discourse/spec/models/ignored_user_spec.rb
Mark VanLandingham a32f887725
FIX: Hide ignored user posts from nested topic view (#39504)
Behavior matches flat mode. OP simply says "Ignored content":
<img width="1291" height="578" alt="Screenshot 2026-04-23 at 3 25 35 PM"
src="https://github.com/user-attachments/assets/ce7d23ef-79c1-4aa5-8a43-7afbf00e554b"
/>

For ignored replies, they are hidden by default but clicking the eye
opens them

<img width="1292" height="946" alt="Screenshot 2026-04-23 at 3 05 33 PM"
src="https://github.com/user-attachments/assets/9b2a50ac-8c6d-458e-895b-6dc01eb4b2d7"
/>
<img width="1289" height="928" alt="Screenshot 2026-04-23 at 3 05 38 PM"
src="https://github.com/user-attachments/assets/52707e3d-25e1-41bd-b466-c15a131303c6"
/>
2026-04-28 12:50:09 -05:00

24 lines
736 B
Ruby

# frozen_string_literal: true
RSpec.describe IgnoredUser do
describe ".ignored_ids_for" do
fab!(:user)
fab!(:target, :user)
fab!(:admin) { Fabricate(:user, admin: true) }
before { Fabricate(:ignored_user, user: user, ignored_user: target) }
it "returns ids of users ignored by the given user" do
expect(described_class.ignored_ids_for(user)).to contain_exactly(target.id)
end
it "excludes staff even if ignored" do
Fabricate(:ignored_user, user: user, ignored_user: admin)
expect(described_class.ignored_ids_for(user)).not_to include(admin.id)
end
it "returns an empty array when user is nil" do
expect(described_class.ignored_ids_for(nil)).to eq([])
end
end
end