Remove obsolete rake tasks
These tasks dealt with data migrations or stats generations which were done only once, so we don't need them anymore. New CONSUL installations don't need these tasks, and existing CONSUL installations will execute them when upgrading one release at a time.
This commit is contained in:
@@ -35,72 +35,6 @@ describe Setting do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#per_page_code_migration" do
|
||||
|
||||
let :run_rake_task do
|
||||
Rake::Task["settings:per_page_code_migration"].reenable
|
||||
Rake.application.invoke_task "settings:per_page_code_migration"
|
||||
end
|
||||
|
||||
context "Neither per_page_code_head or per_page_code Settings exist" do
|
||||
before do
|
||||
Setting.where(key: "per_page_code").first&.destroy
|
||||
Setting.where(key: "per_page_code_head").first&.destroy
|
||||
run_rake_task
|
||||
end
|
||||
|
||||
it "has per_page_code_head setting present and no per_page_code" do
|
||||
expect(Setting.where(key: "per_page_code_head").count).to eq(1)
|
||||
expect(Setting["per_page_code_head"]).to eq(nil)
|
||||
expect(Setting.where(key: "per_page_code").count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
context "Both per_page_code_head or per_page_code Settings exist" do
|
||||
before do
|
||||
Setting["per_page_code"] = "per_page_code"
|
||||
Setting["per_page_code_head"] = "per_page_code_head"
|
||||
run_rake_task
|
||||
end
|
||||
|
||||
it "has per_page_code_head setting present and no per_page_code" do
|
||||
expect(Setting.where(key: "per_page_code_head").count).to eq(1)
|
||||
expect(Setting["per_page_code_head"]).to eq("per_page_code_head")
|
||||
expect(Setting.where(key: "per_page_code").count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
context "per_page_code_head exists, but per_page_code does not" do
|
||||
before do
|
||||
Setting.where(key: "per_page_code").first&.destroy
|
||||
Setting["per_page_code_head"] = "per_page_code_head"
|
||||
run_rake_task
|
||||
end
|
||||
|
||||
it "has per_page_code_head setting present and no per_page_code" do
|
||||
expect(Setting.where(key: "per_page_code_head").count).to eq(1)
|
||||
expect(Setting["per_page_code_head"]).to eq("per_page_code_head")
|
||||
expect(Setting.where(key: "per_page_code").count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
context "per_page_code_head does not exist, but per_page_code does" do
|
||||
before do
|
||||
Setting["per_page_code"] = "per_page_code"
|
||||
Setting.where(key: "per_page_code_head").first&.destroy
|
||||
run_rake_task
|
||||
end
|
||||
|
||||
it "has per_page_code_head setting present and no per_page_code" do
|
||||
expect(Setting.where(key: "per_page_code_head").count).to eq(1)
|
||||
expect(Setting["per_page_code_head"]).to eq("per_page_code")
|
||||
expect(Setting.where(key: "per_page_code").count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
describe "#rename_setting_keys" do
|
||||
|
||||
let :run_rake_task do
|
||||
|
||||
Reference in New Issue
Block a user