mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +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:
@ -172,12 +172,13 @@ RSpec.describe Admin::DashboardController do
|
||||
end
|
||||
|
||||
describe '#new_features' do
|
||||
after do
|
||||
DiscourseUpdates.clean_state
|
||||
end
|
||||
|
||||
context "when logged in as an admin" do
|
||||
before do
|
||||
sign_in(admin)
|
||||
Discourse.redis.del "new_features_last_seen_user_#{admin.id}"
|
||||
Discourse.redis.del "new_features"
|
||||
Discourse.redis.del "last_viewed_feature_dates_for_users_hash"
|
||||
end
|
||||
|
||||
it 'is empty by default' do
|
||||
@ -284,6 +285,10 @@ RSpec.describe Admin::DashboardController do
|
||||
end
|
||||
|
||||
describe '#mark_new_features_as_seen' do
|
||||
after do
|
||||
DiscourseUpdates.clean_state
|
||||
end
|
||||
|
||||
context "when logged in as an admin" do
|
||||
before { sign_in(admin) }
|
||||
|
||||
|
Reference in New Issue
Block a user