diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/models/wiki_page_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r-- | spec/models/wiki_page_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb index be94eca550c..579a9e664cf 100644 --- a/spec/models/wiki_page_spec.rb +++ b/spec/models/wiki_page_spec.rb @@ -620,16 +620,12 @@ RSpec.describe WikiPage do end describe "#versions" do - include_context 'subject is persisted page' + let(:subject) { create_wiki_page } it "returns an array of all commits for the page" do - 3.times { |i| subject.update(content: "content #{i}") } - - expect(subject.versions.count).to eq(4) - end - - it 'returns instances of WikiPageVersion' do - expect(subject.versions).to all( be_a(Gitlab::Git::WikiPageVersion) ) + expect do + 3.times { |i| subject.update(content: "content #{i}") } + end.to change { subject.versions.count }.by(3) end end @@ -640,6 +636,7 @@ RSpec.describe WikiPage do let_it_be(:existing_page) { create_wiki_page(title: 'test page') } let_it_be(:directory_page) { create_wiki_page(title: 'parent directory/child page') } let_it_be(:page_with_special_characters) { create_wiki_page(title: 'test+page') } + let(:untitled_page) { described_class.new(wiki) } where(:page, :title, :changed) do @@ -776,8 +773,11 @@ RSpec.describe WikiPage do end describe '#historical?' do - include_context 'subject is persisted page' + let!(:container) { create(:project) } + + subject { create_wiki_page } + let(:wiki) { subject.wiki } let(:old_version) { subject.versions.last.id } let(:old_page) { wiki.find_page(subject.title, old_version) } let(:latest_version) { subject.versions.first.id } |