@ -63,23 +63,23 @@ RSpec.describe TagManager do
describe '#local_url?' do
describe '#local_url?' do
around do | example |
around do | example |
original_local _domain = Rails . configuration . x . local _domain
original_web _domain = Rails . configuration . x . web _domain
example . run
example . run
Rails . configuration . x . local_domain = original_local _domain
Rails . configuration . x . web_domain = original_web _domain
end
end
it 'returns true if the normalized string with port is local URL' do
it 'returns true if the normalized string with port is local URL' do
Rails . configuration . x . local _domain = 'domain:42'
Rails . configuration . x . web _domain = 'domain:42'
expect ( TagManager . instance . local_url? ( 'https://DoMaIn:42/' ) ) . to eq true
expect ( TagManager . instance . local_url? ( 'https://DoMaIn:42/' ) ) . to eq true
end
end
it 'returns true if the normalized string without port is local URL' do
it 'returns true if the normalized string without port is local URL' do
Rails . configuration . x . local _domain = 'domain'
Rails . configuration . x . web _domain = 'domain'
expect ( TagManager . instance . local_url? ( 'https://DoMaIn/' ) ) . to eq true
expect ( TagManager . instance . local_url? ( 'https://DoMaIn/' ) ) . to eq true
end
end
it 'returns false for string with irrelevant characters' do
it 'returns false for string with irrelevant characters' do
Rails . configuration . x . local _domain = 'domain'
Rails . configuration . x . web _domain = 'domain'
expect ( TagManager . instance . local_url? ( 'https://domainn/' ) ) . to eq false
expect ( TagManager . instance . local_url? ( 'https://domainn/' ) ) . to eq false
end
end
end
end