diff test/test_helper.rb @ 1517:dffacf8a6908 redmine-2.5

Update to Redmine SVN revision 13367 on 2.5-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:29:00 +0100
parents e248c7af89ec
children fb9a13467253
line wrap: on
line diff
--- a/test/test_helper.rb	Tue Sep 09 09:28:31 2014 +0100
+++ b/test/test_helper.rb	Tue Sep 09 09:29:00 2014 +0100
@@ -24,12 +24,20 @@
 require File.expand_path(File.dirname(__FILE__) + '/object_helpers')
 include ObjectHelpers
 
+require 'awesome_nested_set/version'
+
 class ActiveSupport::TestCase
   include ActionDispatch::TestProcess
 
   self.use_transactional_fixtures = true
   self.use_instantiated_fixtures  = false
 
+  ESCAPED_CANT  = 'can't'
+  ESCAPED_UCANT = 'Can't'
+  # Rails 4.0.2
+  #ESCAPED_CANT  = 'can't'
+  #ESCAPED_UCANT = 'Can't'
+
   def log_user(login, password)
     User.anonymous
     get "/login"
@@ -205,6 +213,16 @@
   def mail_body(mail)
     mail.parts.first.body.encoded
   end
+
+  # awesome_nested_set new node lft and rgt value changed this refactor revision.
+  #   https://github.com/collectiveidea/awesome_nested_set/commit/199fca9bb938e40200cd90714dc69247ef017c61
+  # The reason of behavior change is that "self.class.base_class.unscoped" was added to this line.
+  #   https://github.com/collectiveidea/awesome_nested_set/commit/199fca9bb9#diff-f61b59a5e6319024e211b0ffdd0e4ef1R273
+  # It seems correct behavior because of this line comment.
+  #   https://github.com/collectiveidea/awesome_nested_set/blame/199fca9bb9/lib/awesome_nested_set/model.rb#L278
+  def new_issue_lft
+    ::AwesomeNestedSet::VERSION > "2.1.6" ? Issue.maximum(:rgt) + 1 : 1
+  end
 end
 
 module Redmine