fix: Referer URL validation (#4309)

Fixes #354
This commit is contained in:
Muhsin Keloth
2022-03-30 14:36:22 +05:30
committed by GitHub
parent bfe6324d9a
commit 24b20c10ce
6 changed files with 52 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
require 'rails_helper'
describe UrlHelper, type: :helper do
describe '#url_valid' do
context 'when url valid called' do
it 'return if valid url passed' do
expect(helper.url_valid?('https://app.chatwoot.com/')).to eq true
end
it 'return false if invalid url passed' do
expect(helper.url_valid?('javascript:alert(document.cookie)')).to eq false
end
end
end
end