summaryrefslogtreecommitdiff
path: root/spec/helpers/storage_health_helper_spec.rb
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-05-17 18:17:15 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-08-04 15:38:48 +0200
commit3598e60bf20b185b3f8d4e9a88a8eff39c8f729b (patch)
treeba84a7e7972d4a2563bb79485933fb78462868de /spec/helpers/storage_health_helper_spec.rb
parent990feb9f2b886c5bd0ac37339f149b8e80202019 (diff)
downloadgitlab-ce-3598e60bf20b185b3f8d4e9a88a8eff39c8f729b.tar.gz
Add a Circuitbreaker for storage paths
Diffstat (limited to 'spec/helpers/storage_health_helper_spec.rb')
-rw-r--r--spec/helpers/storage_health_helper_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/storage_health_helper_spec.rb b/spec/helpers/storage_health_helper_spec.rb
new file mode 100644
index 00000000000..874498e6338
--- /dev/null
+++ b/spec/helpers/storage_health_helper_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe StorageHealthHelper do
+ describe '#failing_storage_health_message' do
+ let(:health) do
+ Gitlab::Git::Storage::Health.new(
+ "<script>alert('storage name');)</script>",
+ []
+ )
+ end
+
+ it 'escapes storage names' do
+ escaped_storage_name = '&lt;script&gt;alert(&#39;storage name&#39;);)&lt;/script&gt;'
+
+ result = helper.failing_storage_health_message(health)
+
+ expect(result).to include(escaped_storage_name)
+ end
+ end
+end