Commit 5a1a2487 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

WikiPage: test using a mutable wiki repo

This test ran fine when ran with other tests, but depended on order and
a repository which was unmutable. This commit keeps the spirit of the
test the same; with the `subject.update` calls, but switches out the
wiki repo for a mutable one.
parent c6fc46d7
...@@ -620,16 +620,12 @@ RSpec.describe WikiPage do ...@@ -620,16 +620,12 @@ RSpec.describe WikiPage do
end end
describe "#versions" do 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 it "returns an array of all commits for the page" do
3.times { |i| subject.update(content: "content #{i}") } expect do
3.times { |i| subject.update(content: "content #{i}") }
expect(subject.versions.count).to eq(4) end.to change { subject.versions.count }.by(3)
end
it 'returns instances of WikiPageVersion' do
expect(subject.versions).to all( be_a(Gitlab::Git::WikiPageVersion) )
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