Fix bug with wiki page create message
This commit is contained in:
parent
1b788c66a1
commit
8aae7405ee
|
@ -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
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
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" }
|
||||
end
|
||||
|
||||
describe "#create" do
|
||||
let(:wiki_attr) do
|
||||
{
|
||||
title: "Index",
|
||||
content: "Home Page",
|
||||
format: "markdown",
|
||||
message: 'Custom Commit Message'
|
||||
}
|
||||
end
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue