Skip to content
Snippets Groups Projects
Commit 58ca7553 authored by Dan Knox's avatar Dan Knox
Browse files

Ensure old revisions are retrieved from the DB in the correct order.

parent db577200
No related branches found
No related tags found
3 merge requests!104685 0 stable,!3933Merge 5.0.1 into 5.1,!3719Add a safe migration mode to the wiki migrator.
Loading
Loading
@@ -55,7 +55,7 @@ class WikiToGollumMigrator
 
def create_page_and_revisions(project, page)
# Grab all revisions of the page
revisions = project.wikis.where(slug: page.slug).ordered.all
revisions = project.wikis.where(slug: page.slug).order('id desc').all
 
# Remove the first revision created from the array
# and use it to create the Gollum page. Each successive revision
Loading
Loading
Loading
Loading
@@ -149,7 +149,7 @@ describe WikiToGollumMigrator do
@page.user = @project.owner
@page.save!
 
create_revision(@page)
3.times { create_revision(@page) }
 
subject.migrate!
end
Loading
Loading
@@ -158,6 +158,7 @@ describe WikiToGollumMigrator do
wiki = GollumWiki.new(@project, nil)
page = wiki.find_page("2012 06 16")
page.should be_present
page.content.should == "Updated Content"
page.versions.count.should == 2
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment