[Hotfix] Fix DataUpdateScripts::RemoveSiteConfigScripts script (#13824)
This commit is contained in:
parent
6dfabd578f
commit
cfff766d37
2 changed files with 19 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ module DataUpdateScripts
|
|||
].freeze
|
||||
|
||||
def run
|
||||
DataUpdateScript.delete_by(name: SCRIPTS_TO_REMOVE)
|
||||
DataUpdateScript.delete_by(file_name: SCRIPTS_TO_REMOVE)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
require "rails_helper"
|
||||
require Rails.root.join(
|
||||
"lib/data_update_scripts/20210518043957_remove_site_config_scripts.rb",
|
||||
)
|
||||
|
||||
describe DataUpdateScripts::RemoveSiteConfigScripts do
|
||||
it "removes scripts correctly from the DB", :aggregate_failures do
|
||||
described_class::SCRIPTS_TO_REMOVE.each do |script_name|
|
||||
create(:data_update_script, file_name: script_name)
|
||||
end
|
||||
|
||||
described_class.new.run
|
||||
|
||||
described_class::SCRIPTS_TO_REMOVE.each do |script_name|
|
||||
expect(DataUpdateScript.exists?(file_name: script_name)).to be(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue