Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-08-03 15:09:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-03 15:09:25 +0300
commitaeee636c18f82107ec7a489f33c944c65ad5f34e (patch)
tree2c30286279e096c9114e9a41a3ed07a83293c059 /spec/models
parent3d8459c18b7a20d9142359bb9334b467e774eb36 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb26
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) }