mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: Remove tags from experimental sidebar on notification level changed (#17083)
As part of this commit, a bug where updating a tag's notification level on the server side does not update the state of the user's tag notification levels on the client side is fixed too.
This commit is contained in:

committed by
GitHub

parent
47034d9ca0
commit
e7e23e8d9c
@ -60,19 +60,21 @@ RSpec.describe CurrentUserSerializer do
|
||||
end
|
||||
end
|
||||
|
||||
context "#muted_tag_ids" do
|
||||
context "#muted_tag" do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:tag) { Fabricate(:tag) }
|
||||
|
||||
let!(:tag_user) do
|
||||
TagUser.create!(user_id: user.id,
|
||||
notification_level: TagUser.notification_levels[:muted],
|
||||
tag_id: tag.id
|
||||
)
|
||||
TagUser.create!(
|
||||
user_id: user.id,
|
||||
notification_level: TagUser.notification_levels[:muted],
|
||||
tag_id: tag.id
|
||||
)
|
||||
end
|
||||
|
||||
it 'include muted tag ids' do
|
||||
it 'includes muted tag names' do
|
||||
payload = serializer.as_json
|
||||
expect(payload[:muted_tag_ids]).to eq([tag.id])
|
||||
expect(payload[:muted_tags]).to eq([tag.name])
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user