Moved wiki page updated_on eager load to a scope and fixed timestamp titles on wiki page index (#7818).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5098 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-03-12 18:09:46 +00:00
parent f7127e9466
commit b8b35ab05f
5 changed files with 45 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -339,6 +339,7 @@ class WikiControllerTest < ActionController::TestCase
pages = assigns(:pages)
assert_not_nil pages
assert_equal Project.find(1).wiki.pages.size, pages.size
assert_equal pages.first.content.updated_on, pages.first.updated_on
assert_tag :ul, :attributes => { :class => 'pages-hierarchy' },
:child => { :tag => 'li', :child => { :tag => 'a', :attributes => { :href => '/projects/ecookbook/wiki/CookBook_documentation' },

View File

@@ -1,5 +1,5 @@
# redMine - project management software
# Copyright (C) 2006-2007 Jean-Philippe Lang
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -121,4 +121,11 @@ class WikiPageTest < ActiveSupport::TestCase
assert_nil child.parent_id
end
end
def test_updated_on_eager_load
page = WikiPage.with_updated_on.first
assert page.is_a?(WikiPage)
assert_not_nil page.read_attribute(:updated_on)
assert_equal page.content.updated_on, page.updated_on
end
end