mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-01 16:04:19 +00:00
22 lines
640 B
Ruby
22 lines
640 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
RSpec.describe Gitlab::UrlHelpers, feature_category: :shared do
|
|
using RSpec::Parameterized::TableSyntax
|
|
|
|
describe '.normalized_base_url' do
|
|
where(:url, :value) do
|
|
'http://' | nil
|
|
'ssh://foo:bar@example.com' | 'ssh://example.com'
|
|
'http://foo:bar@example.com:3000/dir' | 'http://example.com:3000'
|
|
'http://foo:bar@example.com/dir' | 'http://example.com'
|
|
'https://foo:bar@subdomain.example.com/dir' | 'https://subdomain.example.com'
|
|
end
|
|
|
|
with_them do
|
|
it { expect(described_class.normalized_base_url(url)).to eq(value) }
|
|
end
|
|
end
|
|
end
|