21 lines
504 B
Ruby
21 lines
504 B
Ruby
|
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 = '<script>alert('storage name');)</script>'
|
||
|
|
||
|
result = helper.failing_storage_health_message(health)
|
||
|
|
||
|
expect(result).to include(escaped_storage_name)
|
||
|
end
|
||
|
end
|
||
|
end
|