2022-03-30 09:06:22 +00:00
|
|
|
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
|
2022-07-15 02:51:59 +00:00
|
|
|
expect(helper.url_valid?('https://app.chatwoot.com/')).to be true
|
2022-03-30 09:06:22 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'return false if invalid url passed' do
|
2022-07-15 02:51:59 +00:00
|
|
|
expect(helper.url_valid?('javascript:alert(document.cookie)')).to be false
|
2022-03-30 09:06:22 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|