diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-03 15:09:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-03 15:09:25 +0300 |
commit | aeee636c18f82107ec7a489f33c944c65ad5f34e (patch) | |
tree | 2c30286279e096c9114e9a41a3ed07a83293c059 /spec/models | |
parent | 3d8459c18b7a20d9142359bb9334b467e774eb36 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index d71ae75aefb..e138d7a4c1b 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -7300,6 +7300,32 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr end end + describe '#pages_variables' do + let(:group) { build(:group, path: 'group') } + let(:project) { build(:project, path: 'project', namespace: group) } + + it 'returns the pages variables' do + expect(project.pages_variables.to_hash).to eq({ + 'CI_PAGES_DOMAIN' => 'example.com', + 'CI_PAGES_URL' => 'http://group.example.com/project' + }) + end + + it 'returns the pages variables' do + build( + :project_setting, + project: project, + pages_unique_domain_enabled: true, + pages_unique_domain: 'unique-domain' + ) + + expect(project.pages_variables.to_hash).to eq({ + 'CI_PAGES_DOMAIN' => 'example.com', + 'CI_PAGES_URL' => 'http://unique-domain.example.com' + }) + end + end + describe '#closest_setting' do shared_examples_for 'fetching closest setting' do let!(:namespace) { create(:namespace) } |