diff options
author | Stan Hu <stanhu@gmail.com> | 2015-03-21 18:04:29 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-03-21 18:33:51 -0700 |
commit | 59d5c779758a696233d2f2adcf145c0a93a8fb2f (patch) | |
tree | 5410c902bf776147ec55febe8014179b0250740e /spec/models | |
parent | aadd38dbb9b8fbae91be4b509dc18295ff06c8ee (diff) | |
download | gitlab-ce-59d5c779758a696233d2f2adcf145c0a93a8fb2f.tar.gz |
Fix dots in Wiki slug causing errors
Closes #1263, #431
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/wiki_page_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index f3fd805783f..fceb7668cac 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -78,6 +78,47 @@ describe WikiPage do end end + describe "dot in the title" do + let(:title) { 'Index v1.2.3' } + + before do + @wiki_attr = {title: title, content: "Home Page", format: "markdown"} + end + + describe "#create" do + after do + destroy_page(title) + end + + context "with valid attributes" do + it "saves the wiki page" do + subject.create(@wiki_attr) + expect(wiki.find_page(title)).not_to be_nil + end + + it "returns true" do + expect(subject.create(@wiki_attr)).to eq(true) + end + end + end + + describe "#update" do + before do + create_page(title, "content") + @page = wiki.find_page(title) + end + + it "updates the content of the page" do + @page.update("new content") + @page = wiki.find_page(title) + end + + it "returns true" do + expect(@page.update("more content")).to be_truthy + end + end + end + describe "#update" do before do create_page("Update", "content") |