fix(prefill): it should be possible to prefill a dossier on a test procedure

This commit is contained in:
Paul Chavard 2023-06-12 12:05:48 +02:00
parent 54968daf17
commit b3aeb46c1b
23 changed files with 51 additions and 136 deletions

View file

@ -1,23 +1,4 @@
describe ApplicationHelper do
describe "#sanitize_url" do
subject { sanitize_url(url) }
describe 'does nothing on clean url' do
let(:url) { "https://tps.fr/toto" }
it { is_expected.to eq(url) }
end
describe 'clean a dangerous url' do
let(:url) { "javascript:alert('coucou jtai hacké')" }
it { is_expected.to eq(root_url) }
end
describe 'can deal with a nil url' do
let(:url) { nil }
it { is_expected.to be_nil }
end
end
describe "#flash_class" do
it { expect(flash_class('notice')).to eq 'alert-success' }
it { expect(flash_class('alert', sticky: true, fixed: true)).to eq 'alert-danger sticky alert-fixed' }