mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 03:32:17 +08:00
FEATURE: delete multiple inactive themes/components (#23788)
Ability to select multiple inactive themes or components and delete them all together
This commit is contained in:

committed by
GitHub

parent
60e624e768
commit
e94b553e9a
@ -1052,4 +1052,23 @@ RSpec.describe Admin::ThemesController do
|
||||
include_examples "theme update not allowed"
|
||||
end
|
||||
end
|
||||
|
||||
describe "#bulk_destroy" do
|
||||
fab!(:theme) { Fabricate(:theme, name: "Awesome Theme") }
|
||||
fab!(:theme_2) { Fabricate(:theme, name: "Another awesome Theme") }
|
||||
let(:theme_ids) { [theme.id, theme_2.id] }
|
||||
|
||||
before { sign_in(admin) }
|
||||
|
||||
it "destroys all selected the themes" do
|
||||
expect do
|
||||
delete "/admin/themes/bulk_destroy.json", params: { theme_ids: theme_ids }
|
||||
end.to change { Theme.count }.by(-2)
|
||||
end
|
||||
|
||||
it "logs the theme destroy action for each theme" do
|
||||
StaffActionLogger.any_instance.expects(:log_theme_destroy).twice
|
||||
delete "/admin/themes/bulk_destroy.json", params: { theme_ids: theme_ids }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user