Commit 8aae7405 authored by Francisco Javier López's avatar Francisco Javier López Committed by Sean McGivern

Fix bug with wiki page create message

parent 1b788c66
...@@ -195,7 +195,7 @@ class WikiPage ...@@ -195,7 +195,7 @@ class WikiPage
update_attributes(attrs) update_attributes(attrs)
save(page_details: title) do save(page_details: title) do
wiki.create_page(title, content, format, message) wiki.create_page(title, content, format, attrs[:message])
end end
end end
......
---
title: Fix bug with wiki page create message
merge_request: 22849
author:
type: fixed
...@@ -126,23 +126,34 @@ describe WikiPage do ...@@ -126,23 +126,34 @@ describe WikiPage do
end end
end end
before do
@wiki_attr = { title: "Index", content: "Home Page", format: "markdown" }
end
describe "#create" do describe "#create" do
let(:wiki_attr) do
{
title: "Index",
content: "Home Page",
format: "markdown",
message: 'Custom Commit Message'
}
end
after do after do
destroy_page("Index") destroy_page("Index")
end end
context "with valid attributes" do context "with valid attributes" do
it "saves the wiki page" do it "saves the wiki page" do
subject.create(@wiki_attr) subject.create(wiki_attr)
expect(wiki.find_page("Index")).not_to be_nil expect(wiki.find_page("Index")).not_to be_nil
end end
it "returns true" do 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 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