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:
authorStan Hu <stanhu@gmail.com>2019-03-17 07:30:30 +0300
committerStan Hu <stanhu@gmail.com>2019-03-17 07:32:22 +0300
commitda18211fec5ecb9581a5075d22adec743bb9f901 (patch)
treed74591eed9e488f81de205627eccbad18492a32e /spec/models
parent250f6ad27963c311e757392b886397c930d6918a (diff)
Fix Error 500 when user commits Wiki page with no commit message
Previously if a user submitted a blank commit message, Gitaly would error out with `3:WikiWritePage: empty CommitDetails.Message` since Gitaly checks whether any content is present for the message. We now use a default commit message if a user leaves it blank. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/59065
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_wiki_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb
index 3ccc706edf2..7be8d67ba9e 100644
--- a/spec/models/project_wiki_spec.rb
+++ b/spec/models/project_wiki_spec.rb
@@ -71,6 +71,14 @@ describe ProjectWiki do
expect(project_wiki.create_page("index", "test content")).to be_truthy
end
+ it "creates a new wiki repo with a default commit message" do
+ expect(project_wiki.create_page("index", "test content", :markdown, "")).to be_truthy
+
+ page = project_wiki.find_page('index')
+
+ expect(page.last_version.message).to eq("#{user.username} created page: index")
+ end
+
it "raises CouldNotCreateWikiError if it can't create the wiki repository" do
# Create a fresh project which will not have a wiki
project_wiki = described_class.new(create(:project), user)