summaryrefslogtreecommitdiff
path: root/spec/presenters/ci
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/presenters/ci
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/presenters/ci')
-rw-r--r--spec/presenters/ci/build_presenter_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/presenters/ci/build_presenter_spec.rb b/spec/presenters/ci/build_presenter_spec.rb
index 6dfaa3b72f7..547d95e0908 100644
--- a/spec/presenters/ci/build_presenter_spec.rb
+++ b/spec/presenters/ci/build_presenter_spec.rb
@@ -78,7 +78,7 @@ describe Ci::BuildPresenter do
it 'returns the reason of failure' do
status_title = presenter.status_title
- expect(status_title).to eq('Failed <br> (unknown failure)')
+ expect(status_title).to eq('Failed - (unknown failure)')
end
end
@@ -89,7 +89,7 @@ describe Ci::BuildPresenter do
status_title = presenter.status_title
expect(status_title).not_to include('(retried)')
- expect(status_title).to eq('Failed <br> (unknown failure)')
+ expect(status_title).to eq('Failed - (unknown failure)')
end
end
@@ -99,7 +99,7 @@ describe Ci::BuildPresenter do
it 'returns the reason of failure' do
status_title = presenter.status_title
- expect(status_title).to eq('Failed <br> (unknown failure)')
+ expect(status_title).to eq('Failed - (unknown failure)')
end
end
@@ -173,7 +173,7 @@ describe Ci::BuildPresenter do
it 'returns the reason of failure' do
tooltip = subject.tooltip_message
- expect(tooltip).to eq("#{build.name} - failed <br> (script failure)")
+ expect(tooltip).to eq("#{build.name} - failed - (script failure)")
end
end
@@ -183,7 +183,7 @@ describe Ci::BuildPresenter do
it 'should include the reason of failure and the retried title' do
tooltip = subject.tooltip_message
- expect(tooltip).to eq("#{build.name} - failed <br> (script failure) (retried)")
+ expect(tooltip).to eq("#{build.name} - failed - (script failure) (retried)")
end
end
@@ -193,7 +193,7 @@ describe Ci::BuildPresenter do
it 'should include the reason of failure' do
tooltip = subject.tooltip_message
- expect(tooltip).to eq("#{build.name} - failed <br> (script failure) (allowed to fail)")
+ expect(tooltip).to eq("#{build.name} - failed - (script failure) (allowed to fail)")
end
end