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:
authorDouwe Maan <douwe@gitlab.com>2018-07-12 14:07:18 +0300
committerDouwe Maan <douwe@gitlab.com>2018-07-12 14:07:18 +0300
commit6f8cf37ebeaa0098072df66e556b6c59de531734 (patch)
tree00c4bd16f5f6d10fd4548862ca8df834d494834c /spec/models
parent9e13da029a420bda671a19911db472ffa83d0968 (diff)
parent26072c1a646d39547c3eaca57b7715b81ce5b177 (diff)
Merge branch 'sh-optimize-wiki-empty-check' into 'master'
Optimize ProjectWiki#empty? check See merge request gitlab-org/gitlab-ce!20573
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_wiki_spec.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb
index a3c20b3b3c1..a544940800a 100644
--- a/spec/models/project_wiki_spec.rb
+++ b/spec/models/project_wiki_spec.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require "spec_helper"
describe ProjectWiki do
@@ -10,7 +11,6 @@ describe ProjectWiki do
subject { project_wiki }
- it { is_expected.to delegate_method(:empty?).to :pages }
it { is_expected.to delegate_method(:repository_storage).to :project }
it { is_expected.to delegate_method(:hashed_storage?).to :project }
@@ -92,11 +92,19 @@ describe ProjectWiki do
context "when the wiki has pages" do
before do
project_wiki.create_page("index", "This is an awesome new Gollum Wiki")
+ project_wiki.create_page("another-page", "This is another page")
end
describe '#empty?' do
subject { super().empty? }
it { is_expected.to be_falsey }
+
+ # Re-enable this when https://gitlab.com/gitlab-org/gitaly/issues/1204 is fixed
+ xit 'only instantiates a Wiki page once' do
+ expect(WikiPage).to receive(:new).once.and_call_original
+
+ subject
+ end
end
end
end