Commit 7d2673b4 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'fj-50890-fix-commit-message-wiki-new-page' into 'master'

Fix bug with wiki page create message

Closes #50890

See merge request gitlab-org/gitlab-ce!22849
parents 1b788c66 8aae7405
......@@ -195,7 +195,7 @@ class WikiPage
update_attributes(attrs)
save(page_details: title) do
wiki.create_page(title, content, format, message)
wiki.create_page(title, content, format, attrs[:message])
end
end
......
---
title: Fix bug with wiki page create message
merge_request: 22849
author:
type: fixed
......@@ -126,23 +126,34 @@ describe WikiPage do
end
end
before do
@wiki_attr = { title: "Index", content: "Home Page", format: "markdown" }
describe "#create" do
let(:wiki_attr) do
{
title: "Index",
content: "Home Page",
format: "markdown",
message: 'Custom Commit Message'
}
end
describe "#create" do
after do
destroy_page("Index")
end
context "with valid attributes" do
it "saves the wiki page" do
subject.create(@wiki_attr)
subject.create(wiki_attr)
expect(wiki.find_page("Index")).not_to be_nil
end
it "returns true" do
expect(subject.create(@wiki_attr)).to eq(true)
expect(subject.create(wiki_attr)).to eq(true)
end
it 'saves the wiki page with message' do
subject.create(wiki_attr)
expect(wiki.find_page("Index").message).to eq 'Custom Commit Message'
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment