Mercurial > hg > soundsoftware-site
diff test/unit/wiki_page_test.rb @ 1526:404aa68d4227
Merge from live branch
author | Chris Cannam |
---|---|
date | Thu, 11 Sep 2014 12:46:20 +0100 |
parents | dffacf8a6908 |
children |
line wrap: on
line diff
--- a/test/unit/wiki_page_test.rb Mon Mar 17 08:57:04 2014 +0000 +++ b/test/unit/wiki_page_test.rb Thu Sep 11 12:46:20 2014 +0100 @@ -1,5 +1,5 @@ # Redmine - project management software -# Copyright (C) 2006-2012 Jean-Philippe Lang +# Copyright (C) 2006-2014 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 @@ -106,8 +106,8 @@ page.destroy assert_nil WikiPage.find_by_id(1) # make sure that page content and its history are deleted - assert WikiContent.find_all_by_page_id(1).empty? - assert WikiContent.versioned_class.find_all_by_page_id(1).empty? + assert_equal 0, WikiContent.where(:page_id => 1).count + assert_equal 0, WikiContent.versioned_class.where(:page_id => 1).count end def test_destroy_should_not_nullify_children @@ -117,15 +117,15 @@ page.destroy assert_nil WikiPage.find_by_id(2) - children = WikiPage.find_all_by_id(child_ids) - assert_equal child_ids.size, children.size + children = WikiPage.where(:id => child_ids) + assert_equal child_ids.size, children.count children.each do |child| assert_nil child.parent_id end end def test_updated_on_eager_load - page = WikiPage.with_updated_on.first(:order => 'id') + page = WikiPage.with_updated_on.order('id').first assert page.is_a?(WikiPage) assert_not_nil page.read_attribute(:updated_on) assert_equal Time.gm(2007, 3, 6, 23, 10, 51), page.content.updated_on