Remove Collective Noun-Related Fields from SiteConfig (#12069) [deploy]
* Removes collective_noun and collective_noun_disabled from SiteConfig * Adds a data_update script to remove collective_noun fields from Config * Adds additional guard clauses to collective noun scripts * Adds an unfinished spec around the removal of collective_noun fields * Reworks remove_collective_noun_from_site_config_spec test and expectations * Reverts changes to data_update script and removal of Config fields * Remove safe navigator from data_update script
This commit is contained in:
parent
fab133c069
commit
fd38b77a33
2 changed files with 25 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
module DataUpdateScripts
|
||||
class RemoveCollectiveNounFromSiteConfig
|
||||
def run
|
||||
SiteConfig.where(var: %w[collective_noun collective_noun_disabled]).destroy_all
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
require "rails_helper"
|
||||
require Rails.root.join(
|
||||
"lib/data_update_scripts/20201229230456_remove_collective_noun_from_site_config.rb",
|
||||
)
|
||||
|
||||
describe DataUpdateScripts::RemoveCollectiveNounFromSiteConfig do
|
||||
context "when collective_noun and collective_noun_disabled are removed from the Config" do
|
||||
it "does not alter the community_name" do
|
||||
allow(SiteConfig).to receive(:community_name).and_return("DEV Club")
|
||||
|
||||
expect do
|
||||
described_class.new.run
|
||||
end.not_to change(SiteConfig, :community_name)
|
||||
|
||||
expect(SiteConfig.community_name).to eq("DEV Club")
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Reference in a new issue