From 28008d64e2ad82016db557fd2447688187776809 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 19 Jan 2018 23:44:08 +0100 Subject: [PATCH] Improve performance swapping keys.each for each_key, plus line lenght comply --- spec/controllers/installation_controller_spec.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spec/controllers/installation_controller_spec.rb b/spec/controllers/installation_controller_spec.rb index fb0c04fbb..5341271b7 100644 --- a/spec/controllers/installation_controller_spec.rb +++ b/spec/controllers/installation_controller_spec.rb @@ -15,12 +15,18 @@ describe InstallationController, type: :request do before do @current_feature_settings = seeds_feature_settings.pluck(:key, :value).to_h seeds_feature_settings.destroy_all - test_feature_settings.each { |feature_name, feature_value| Setting["feature.#{feature_name}"] = feature_value } + test_feature_settings.each do |feature_name, feature_value| + Setting["feature.#{feature_name}"] = feature_value + end end after do - test_feature_settings.keys.each { |feature_name| Setting.find_by(key: "feature.#{feature_name}").destroy } - @current_feature_settings.each { |feature_name, feature_value| Setting[feature_name] = feature_value } + test_feature_settings.each_key do |feature_name| + Setting.find_by(key: "feature.#{feature_name}").destroy + end + @current_feature_settings.each do |feature_name, feature_value| + Setting[feature_name] = feature_value + end end specify "with query string inside query params" do