diff --git a/app/controllers/foreman_xen/cache_controller.rb b/app/controllers/foreman_xen/cache_controller.rb index aad5b7c..c7832d3 100644 --- a/app/controllers/foreman_xen/cache_controller.rb +++ b/app/controllers/foreman_xen/cache_controller.rb @@ -6,9 +6,7 @@ class CacheController < ::ApplicationController def refresh type = params[:type] - unless cache_attribute_whitelist.include?(type) - process_error(:error_msg => "Error refreshing cache. #{type} is not a white listed attribute") - end + process_error(:error_msg => "Error refreshing cache. #{type} is not a white listed attribute") unless cache_attribute_whitelist.include?(type) unless @compute_resource.respond_to?("#{type}!") process_error(:error_msg => "Error refreshing cache. Method '#{type}!' not found for compute resource" + diff --git a/test/test_helper.rb b/test/test_helper.rb index c404f18..21eb0b8 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -10,6 +10,4 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } # Load fixtures from the engine -if ActiveSupport::TestCase.method_defined?(:fixture_path=) - ActiveSupport::TestCase.fixture_path = File.expand_path('fixtures', __dir__) -end +ActiveSupport::TestCase.fixture_path = File.expand_path('fixtures', __dir__) if ActiveSupport::TestCase.method_defined?(:fixture_path=)