mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:41:17 +08:00
DEV: Stop leaking state in dashboard controller specs (#19608)
A few specs in `dashboard_controller_spec.rb` set some state in redis but don't clean it up afterwards which causes other specs to fail when they're ran after `dashboard_controller_spec.rb`. Related commit: 18467d4.
This commit is contained in:
@ -186,6 +186,21 @@ module DiscourseUpdates
|
||||
Discourse.redis.hset(last_viewed_feature_dates_for_users_key, user_id.to_s, feature_date)
|
||||
end
|
||||
|
||||
def clean_state
|
||||
Discourse.redis.del(
|
||||
last_installed_version_key,
|
||||
latest_version_key,
|
||||
critical_updates_available_key,
|
||||
missing_versions_count_key,
|
||||
updated_at_key,
|
||||
missing_versions_list_key,
|
||||
new_features_key,
|
||||
last_viewed_feature_dates_for_users_key,
|
||||
*Discourse.redis.keys("#{missing_versions_key_prefix}*"),
|
||||
*Discourse.redis.keys(new_features_last_seen_key("*")),
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def last_installed_version_key
|
||||
|
Reference in New Issue
Block a user