mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FEATURE: improved tag and category watching and tracking
- present tags watched on the user prefs page - automatically watch or unwatch old topics based on watch status New watching and tracking logic takes care of handling old topics (either with or without read state) When you watch a topic you now watch historically Also removes confusing warnings from user.
This commit is contained in:
@@ -39,6 +39,28 @@ describe UserUpdater do
|
||||
expect(user.reload.name).to eq 'Jim Tom'
|
||||
end
|
||||
|
||||
it 'can update categories and tags' do
|
||||
category = Fabricate(:category)
|
||||
tag = Fabricate(:tag)
|
||||
|
||||
user = Fabricate(:user)
|
||||
updater = UserUpdater.new(acting_user, user)
|
||||
updater.update(watched_tags: [tag.name], muted_category_ids: [category.id])
|
||||
|
||||
expect(TagUser.where(
|
||||
user_id: user.id,
|
||||
tag_id: tag.id,
|
||||
notification_level: TagUser.notification_levels[:watching]
|
||||
).count).to eq(1)
|
||||
|
||||
expect(CategoryUser.where(
|
||||
user_id: user.id,
|
||||
category_id: category.id,
|
||||
notification_level: CategoryUser.notification_levels[:muted]
|
||||
).count).to eq(1)
|
||||
|
||||
end
|
||||
|
||||
it 'updates various fields' do
|
||||
user = Fabricate(:user)
|
||||
updater = UserUpdater.new(acting_user, user)
|
||||
|
||||
Reference in New Issue
Block a user