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>2022-09-20 02:18:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-20 02:18:09 +0300
commit6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch)
treedc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb
parent9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff)
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb')
-rw-r--r--spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb b/spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb
new file mode 100644
index 00000000000..22b401bc841
--- /dev/null
+++ b/spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+RSpec.shared_context 'with GLFM example snapshot fixtures' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:group) { create(:group, name: 'glfm_group').tap { |group| group.add_owner(user) } }
+
+ let_it_be(:project) do
+ # NOTE: We hardcode the IDs on all fixtures to prevent variability in the
+ # rendered HTML/Prosemirror JSON, and to minimize the need for normalization:
+ # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization
+ create(:project, :repository, creator: user, group: group, name: 'glfm_project', id: 77777)
+ end
+
+ let_it_be(:project_snippet) { create(:project_snippet, title: 'glfm_project_snippet', id: 88888, project: project) }
+ let_it_be(:personal_snippet) { create(:snippet, id: 99999) }
+
+ before do
+ # Set 'GITLAB_TEST_FOOTNOTE_ID' in order to override random number generation in
+ # Banzai::Filter::FootnoteFilter#random_number, and thus avoid the need to
+ # perform normalization on the value. See:
+ # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization
+ stub_env('GITLAB_TEST_FOOTNOTE_ID', 42)
+
+ stub_licensed_features(group_wikis: true)
+ sign_in(user)
+ end
+end