diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-10 21:10:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-10 21:10:06 +0000 |
commit | caff5659c981d9b8ed2c086fb35deac9e189b865 (patch) | |
tree | 6129c7c93513655eff4a3e0351fb902ac2ed3127 /spec/initializers/rails_asset_host_spec.rb | |
parent | 1c17f34a4bdf51030a36985b097161a914fb7ea8 (diff) | |
download | gitlab-ce-caff5659c981d9b8ed2c086fb35deac9e189b865.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/initializers/rails_asset_host_spec.rb')
-rw-r--r-- | spec/initializers/rails_asset_host_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/initializers/rails_asset_host_spec.rb b/spec/initializers/rails_asset_host_spec.rb new file mode 100644 index 00000000000..682ef9d9bbe --- /dev/null +++ b/spec/initializers/rails_asset_host_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Rails asset host initializer' do + def load_initializer + load Rails.root.join('config/initializers/rails_asset_host.rb') + end + + subject { Rails.application.config.action_controller.asset_host } + + it 'uses no asset host by default' do + load_initializer + + expect(subject).to be nil + end + + context 'with cdn_host defined in gitlab.yml' do + before do + stub_config_setting(cdn_host: 'https://gitlab.example.com') + end + + it 'returns https://gitlab.example.com' do + load_initializer + + expect(subject).to eq('https://gitlab.example.com') + end + end +end |