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:
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r--spec/models/wiki_page_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index ee61f191f05..2e1cb9d3d9b 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -394,6 +394,22 @@ RSpec.describe WikiPage, feature_category: :wiki do
expect { subject.create(title: '') }.not_to change { wiki.list_pages.length }
end
end
+
+ context "with front matter context" do
+ let(:attributes) do
+ {
+ title: SecureRandom.hex,
+ content: "---\nxxx: abc\n---\nHome Page",
+ format: "markdown",
+ message: 'Custom Commit Message'
+ }
+ end
+
+ it 'create the page with front matter' do
+ subject.create(attributes)
+ expect(wiki.find_page(title).front_matter).to eq({ xxx: "abc" })
+ end
+ end
end
describe "dot in the title" do