Skip to content

A platform for community discussion. Free, open, simple.

DEV: Prevent warnings in specs

Gerhard Schlagerac27bdce14e4
diff --git a/lib/js_locale_helper.rb b/lib/js_locale_helper.rb
index 8628759b1e6..4fd5ab1c749 100644
--- a/lib/js_locale_helper.rb
+++ b/lib/js_locale_helper.rb
@@ -162,7 +162,7 @@ module JsLocaleHelper
result
end
- MOMENT_LOCALE_MAPPING = {
+ MOMENT_LOCALE_MAPPING ||= {
"hy" => "hy-am"
}
diff --git a/spec/requests/theme_javascripts_controller_spec.rb b/spec/requests/theme_javascripts_controller_spec.rb
index ac9475c1664..57a415e7c72 100644
--- a/spec/requests/theme_javascripts_controller_spec.rb
+++ b/spec/requests/theme_javascripts_controller_spec.rb
@@ -49,7 +49,9 @@ describe ThemeJavascriptsController do
end
def clear_disk_cache
- `rm #{ThemeJavascriptsController::DISK_CACHE_PATH}/*`
+ if Dir.exist?(ThemeJavascriptsController::DISK_CACHE_PATH)
+ `rm #{ThemeJavascriptsController::DISK_CACHE_PATH}/*`
+ end
end
end
end