mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:37:44 +08:00
FIX: sidebar_list_destination on CurrentUserSerializer (#18660)
Before, `sidebar_list_destination` was an attribute on UserOptionSerializer. The problem was that this attribute was added to user model only when the user entered the preferences panel. We want that attribute to be available all the time, therefore it was moved to CurrentUserSerializer.
This commit is contained in:

committed by
GitHub

parent
99d9c933c6
commit
45bdfa1c84
@ -388,5 +388,14 @@ RSpec.describe CurrentUserSerializer do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#sidebar_list_destination" do
|
||||
it "returns choosen value or default" do
|
||||
expect(serializer.as_json[:sidebar_list_destination]).to eq(SiteSetting.default_sidebar_list_destination)
|
||||
|
||||
user.user_option.update!(sidebar_list_destination: "unread_new")
|
||||
expect(serializer.as_json[:sidebar_list_destination]).to eq("unread_new")
|
||||
end
|
||||
end
|
||||
|
||||
include_examples "#display_sidebar_tags", described_class
|
||||
end
|
||||
|
Reference in New Issue
Block a user