summaryrefslogtreecommitdiff
path: root/spec/serializers
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-08-09 12:05:13 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-08-09 18:28:05 +0100
commit5e8f11e5fdb792f17d86cf9321537c5c56801a17 (patch)
tree77a87f8692bd1a24cb4c76d11c7c7740ee1e466f /spec/serializers
parent68082d352516b5367fce76453b8992f4e44d127e (diff)
downloadgitlab-ce-5e8f11e5fdb792f17d86cf9321537c5c56801a17.tar.gz
Removes <br> sent from backend on tooltips in jobs
When backend sends HTML it requires frontend to append it to the DOM causing XSS vulnerabilities. By removing the `<br>` we avoid those vulnerabilities
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/build_serializer_spec.rb2
-rw-r--r--spec/serializers/job_entity_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/serializers/build_serializer_spec.rb b/spec/serializers/build_serializer_spec.rb
index 52459cd369d..302ef147eb2 100644
--- a/spec/serializers/build_serializer_spec.rb
+++ b/spec/serializers/build_serializer_spec.rb
@@ -37,7 +37,7 @@ describe BuildSerializer do
it 'serializes only status' do
expect(subject[:text]).to eq(status.text)
expect(subject[:label]).to eq('failed')
- expect(subject[:tooltip]).to eq('failed <br> (unknown failure)')
+ expect(subject[:tooltip]).to eq('failed - (unknown failure)')
expect(subject[:icon]).to eq(status.icon)
expect(subject[:favicon]).to match_asset_path("/assets/ci_favicons/#{status.favicon}.png")
end
diff --git a/spec/serializers/job_entity_spec.rb b/spec/serializers/job_entity_spec.rb
index a5581a34517..8e1ca3f308d 100644
--- a/spec/serializers/job_entity_spec.rb
+++ b/spec/serializers/job_entity_spec.rb
@@ -142,7 +142,7 @@ describe JobEntity do
end
it 'should indicate the failure reason on tooltip' do
- expect(subject[:status][:tooltip]).to eq('failed <br> (API failure)')
+ expect(subject[:status][:tooltip]).to eq('failed - (API failure)')
end
it 'should include a callout message with a verbose output' do
@@ -166,7 +166,7 @@ describe JobEntity do
end
it 'should indicate the failure reason on tooltip' do
- expect(subject[:status][:tooltip]).to eq('failed <br> (API failure) (allowed to fail)')
+ expect(subject[:status][:tooltip]).to eq('failed - (API failure) (allowed to fail)')
end
it 'should include a callout message with a verbose output' do