DEV: reset plugin added directory columns in testing (#13420)
This commit is contained in:
parent
854d965679
commit
6fd13f38a2
|
@ -30,4 +30,8 @@ class DirectoryColumn < ActiveRecord::Base
|
|||
def self.plugin_directory_columns
|
||||
@@plugin_directory_columns
|
||||
end
|
||||
|
||||
def self.clear_plugin_directory_columns
|
||||
@@plugin_directory_columns = []
|
||||
end
|
||||
end
|
||||
|
|
|
@ -34,6 +34,10 @@ class DirectoryItem < ActiveRecord::Base
|
|||
@@plugin_queries
|
||||
end
|
||||
|
||||
def self.clear_plugin_queries
|
||||
@@plugin_queries = []
|
||||
end
|
||||
|
||||
def self.refresh_period!(period_type, force: false)
|
||||
|
||||
Discourse.redis.set("directory_#{period_types[period_type]}", Time.zone.now.to_i)
|
||||
|
|
|
@ -604,6 +604,11 @@ describe Plugin::Instance do
|
|||
describe '#add_directory_column' do
|
||||
let!(:plugin) { Plugin::Instance.new }
|
||||
|
||||
after do
|
||||
DirectoryItem.clear_plugin_queries
|
||||
DirectoryColumn.clear_plugin_directory_columns
|
||||
end
|
||||
|
||||
it 'creates a directory column record' do
|
||||
plugin.add_directory_column('random_c', query: "SELECT COUNT(*) FROM users", icon: 'recycle')
|
||||
|
||||
|
|
Loading…
Reference in New Issue