Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd7d578e89 | ||
|
|
905ed3aa75 | ||
|
|
bb4c530ba2 | ||
|
|
e3958ef577 | ||
|
|
c5f2dadb2c | ||
|
|
af8dcccb7b | ||
|
|
c0742ed9e6 | ||
|
|
8c7ae20402 | ||
|
|
06b68f1948 | ||
|
|
b51203bc83 | ||
|
|
f578a5c4f6 | ||
|
|
17d1907747 |
2
Gemfile
2
Gemfile
@@ -41,7 +41,7 @@ end
|
||||
|
||||
platforms :mri_18, :mingw_18 do
|
||||
group :mysql do
|
||||
gem "mysql"
|
||||
gem "mysql", "~> 2.8.1"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ class WikiController < ApplicationController
|
||||
|
||||
# Export wiki to a single pdf or html file
|
||||
def export
|
||||
@pages = @wiki.pages.all(:order => 'title', :include => [:content, :attachments], :limit => 75)
|
||||
@pages = @wiki.pages.all(:order => 'title', :include => [:content, :attachments])
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
export = render_to_string :action => 'export_multiple', :layout => false
|
||||
|
||||
@@ -124,6 +124,7 @@ class MailHandler < ActionMailer::Base
|
||||
|
||||
def dispatch
|
||||
headers = [email.in_reply_to, email.references].flatten.compact
|
||||
subject = email.subject.to_s
|
||||
if headers.detect {|h| h.to_s =~ MESSAGE_ID_RE}
|
||||
klass, object_id = $1, $2.to_i
|
||||
method_name = "receive_#{klass}_reply"
|
||||
@@ -132,9 +133,9 @@ class MailHandler < ActionMailer::Base
|
||||
else
|
||||
# ignoring it
|
||||
end
|
||||
elsif m = email.subject.match(ISSUE_REPLY_SUBJECT_RE)
|
||||
elsif m = subject.match(ISSUE_REPLY_SUBJECT_RE)
|
||||
receive_issue_reply(m[1].to_i)
|
||||
elsif m = email.subject.match(MESSAGE_REPLY_SUBJECT_RE)
|
||||
elsif m = subject.match(MESSAGE_REPLY_SUBJECT_RE)
|
||||
receive_message_reply(m[1].to_i)
|
||||
else
|
||||
dispatch_to_default
|
||||
@@ -244,9 +245,26 @@ class MailHandler < ActionMailer::Base
|
||||
def add_attachments(obj)
|
||||
if email.attachments && email.attachments.any?
|
||||
email.attachments.each do |attachment|
|
||||
filename = attachment.filename
|
||||
unless filename.respond_to?(:encoding)
|
||||
# try to reencode to utf8 manually with ruby1.8
|
||||
h = attachment.header['Content-Disposition']
|
||||
unless h.nil?
|
||||
begin
|
||||
if m = h.value.match(/filename\*[0-9\*]*=([^=']+)'/)
|
||||
filename = Redmine::CodesetUtil.to_utf8(filename, m[1])
|
||||
elsif m = h.value.match(/filename=.*=\?([^\?]+)\?[BbQq]\?/)
|
||||
# http://tools.ietf.org/html/rfc2047#section-4
|
||||
filename = Redmine::CodesetUtil.to_utf8(filename, m[1])
|
||||
end
|
||||
rescue
|
||||
# nop
|
||||
end
|
||||
end
|
||||
end
|
||||
obj.attachments << Attachment.create(:container => obj,
|
||||
:file => attachment.decoded,
|
||||
:filename => attachment.filename,
|
||||
:filename => filename,
|
||||
:author => user,
|
||||
:content_type => attachment.mime_type)
|
||||
end
|
||||
|
||||
@@ -427,5 +427,9 @@ class Repository < ActiveRecord::Base
|
||||
connection.delete("DELETE FROM #{ci} WHERE #{ci}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})")
|
||||
connection.delete("DELETE FROM #{cp} WHERE #{cp}.changeset_id IN (SELECT #{cs}.id FROM #{cs} WHERE #{cs}.repository_id = #{id})")
|
||||
connection.delete("DELETE FROM #{cs} WHERE #{cs}.repository_id = #{id}")
|
||||
clear_extra_info_of_changesets
|
||||
end
|
||||
|
||||
def clear_extra_info_of_changesets
|
||||
end
|
||||
end
|
||||
|
||||
@@ -255,4 +255,15 @@ class Repository::Git < Repository
|
||||
:order => 'committed_on DESC'
|
||||
)
|
||||
end
|
||||
|
||||
def clear_extra_info_of_changesets
|
||||
return if extra_info.nil?
|
||||
v = extra_info["extra_report_last_commit"]
|
||||
write_attribute(:extra_info, nil)
|
||||
h = {}
|
||||
h["extra_report_last_commit"] = v
|
||||
merge_extra_info(h)
|
||||
self.save
|
||||
end
|
||||
private :clear_extra_info_of_changesets
|
||||
end
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<tr class="<%= cycle 'odd', 'even' %>">
|
||||
<td>
|
||||
<%= link_to repository.identifier,
|
||||
{:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier_param.present? %>
|
||||
{:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier.present? %>
|
||||
</td>
|
||||
<td align="center"><%= checked_image repository.is_default? %></td>
|
||||
<td><%=h repository.scm_name %></td>
|
||||
|
||||
@@ -4,6 +4,16 @@ Redmine - project management software
|
||||
Copyright (C) 2006-2012 Jean-Philippe Lang
|
||||
http://www.redmine.org/
|
||||
|
||||
== 2012-11-24 v2.1.4
|
||||
|
||||
* Defect #12274: Wiki export from Index by title is truncated
|
||||
* Defect #12298: Right-click context menu unable to batch/bulk update (IE8)
|
||||
* Defect #12332: Repository identifier does not display on Project/Settings/Repositories
|
||||
* Defect #12396: Error when receiving an email without subject header
|
||||
* Defect #12399: Non ASCII attachment filename encoding broken (MOJIBAKE) in receiving mail on Ruby 1.8
|
||||
* Defect #12409: Git: changesets aren't read after clear_changesets call
|
||||
* Defect #12431: Project.rebuild! sorts root projects by id instead of name
|
||||
|
||||
== 2012-11-17 v2.1.3
|
||||
|
||||
* Defect #12050: :export links to repository files lead to a 404 error
|
||||
|
||||
@@ -186,7 +186,7 @@ module CollectiveIdea #:nodoc:
|
||||
end
|
||||
|
||||
# Find root node(s)
|
||||
root_nodes = where("#{quoted_parent_column_name} IS NULL").order("#{quoted_left_column_name}, #{quoted_right_column_name}, id").each do |root_node|
|
||||
root_nodes = where("#{quoted_parent_column_name} IS NULL").order(acts_as_nested_set_options[:order]).each do |root_node|
|
||||
# setup index for this scope
|
||||
indices[scope.call(root_node)] ||= 0
|
||||
set_left_and_rights.call(root_node)
|
||||
|
||||
@@ -4,7 +4,7 @@ module Redmine
|
||||
module VERSION #:nodoc:
|
||||
MAJOR = 2
|
||||
MINOR = 1
|
||||
TINY = 3
|
||||
TINY = 4
|
||||
|
||||
# Branch values:
|
||||
# * official release: nil
|
||||
|
||||
@@ -25,7 +25,7 @@ function contextMenuClick(event) {
|
||||
}
|
||||
contextMenuHide();
|
||||
if (target.is('a') || target.is('img')) { return; }
|
||||
if (event.which == 1 /*TODO || (navigator.appVersion.match(/\bMSIE\b/))*/) {
|
||||
if (event.which == 1 || (navigator.appVersion.match(/\bMSIE\b/))) {
|
||||
var tr = target.parents('tr').first();
|
||||
if (tr.length && tr.hasClass('hascontextmenu')) {
|
||||
// a row was clicked, check if the click was on checkbox
|
||||
|
||||
26
test/fixtures/mail_handler/gmail_with_attachment_iso-8859-1.eml
vendored
Normal file
26
test/fixtures/mail_handler/gmail_with_attachment_iso-8859-1.eml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Date: Tue, 20 Nov 2012 23:08:25 +0900
|
||||
Message-ID: <CANBr5-UZM=Odz4U3Q6vHd_9cd2tCT-_P9xDd=hRJ0aoMNTWXbw@mail.gmail.com>
|
||||
Subject: test
|
||||
From: John Smith <JSmith@somenet.foo>
|
||||
To: redmine@somenet.foo
|
||||
Content-Type: multipart/mixed; boundary=14dae93a13bf76ca5d04ceedc458
|
||||
|
||||
--14dae93a13bf76ca5d04ceedc458
|
||||
Content-Type: text/plain; charset=ISO-8859-1
|
||||
|
||||
test
|
||||
|
||||
--14dae93a13bf76ca5d04ceedc458
|
||||
Content-Type: text/plain; charset=US-ASCII;
|
||||
name="=?ISO-8859-1?B?xOTW9tz8xOTW9tz8xOTW9tz8xOTW9tz8xOTW9tw=?=
|
||||
=?ISO-8859-1?B?/MTk1vbc/MTk1vbc/MTk1vbc/MTk1vbc/MTk1vbc?=
|
||||
=?ISO-8859-1?B?/MTk1vbc/C50eHQ=?="
|
||||
Content-Disposition: attachment;
|
||||
filename="=?ISO-8859-1?B?xOTW9tz8xOTW9tz8xOTW9tz8xOTW9tz8xOTW9tw=?=
|
||||
=?ISO-8859-1?B?/MTk1vbc/MTk1vbc/MTk1vbc/MTk1vbc/MTk1vbc?=
|
||||
=?ISO-8859-1?B?/MTk1vbc/C50eHQ=?="
|
||||
Content-Transfer-Encoding: base64
|
||||
X-Attachment-Id: f_h9r3mcjz0
|
||||
|
||||
dGVzdAo=
|
||||
--14dae93a13bf76ca5d04ceedc458--
|
||||
20
test/fixtures/mail_handler/gmail_with_attachment_ja.eml
vendored
Normal file
20
test/fixtures/mail_handler/gmail_with_attachment_ja.eml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Date: Mon, 19 Nov 2012 10:17:45 +0900
|
||||
Message-ID: <CANBr5-U6cXMfLek5QiB2ZrBPR3vTThn9_Upvdkf3Dkod664+Xw@mail.gmail.com>
|
||||
Subject: test
|
||||
From: John Smith <JSmith@somenet.foo>
|
||||
To: redmine@somenet.foo
|
||||
Content-Type: multipart/mixed; boundary=bcaec54ee4ea84f77904cecee22e
|
||||
|
||||
--bcaec54ee4ea84f77904cecee22e
|
||||
Content-Type: text/plain; charset=ISO-8859-1
|
||||
|
||||
test
|
||||
|
||||
--bcaec54ee4ea84f77904cecee22e
|
||||
Content-Type: text/plain; charset=US-ASCII; name="=?ISO-2022-JP?B?GyRCJUYlOSVIGyhCLnR4dA==?="
|
||||
Content-Disposition: attachment; filename="=?ISO-2022-JP?B?GyRCJUYlOSVIGyhCLnR4dA==?="
|
||||
Content-Transfer-Encoding: base64
|
||||
X-Attachment-Id: f_h9owndpv0
|
||||
|
||||
dGVzdAo=
|
||||
--bcaec54ee4ea84f77904cecee22e--
|
||||
10
test/fixtures/mail_handler/no_subject_header.eml
vendored
Normal file
10
test/fixtures/mail_handler/no_subject_header.eml
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
Content-Type: application/ms-tnef; name="winmail.dat"
|
||||
Content-Transfer-Encoding: binary
|
||||
From: John Smith <JSmith@somenet.foo>
|
||||
To: "redmine@somenet.foo" <redmine@somenet.foo>
|
||||
Date: Fri, 1 Jun 2012 14:39:38 +0200
|
||||
Message-ID: <87C31D42249DD0489D1A1444E3232DD7019D6183@foo.bar>
|
||||
Accept-Language: de-CH, en-US
|
||||
Content-Language: de-CH
|
||||
|
||||
Fixture
|
||||
34
test/fixtures/mail_handler/thunderbird_with_attachment_iso-8859-1.eml
vendored
Normal file
34
test/fixtures/mail_handler/thunderbird_with_attachment_iso-8859-1.eml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
Message-ID: <50AB9546.7020800@gmail.com>
|
||||
Date: Tue, 20 Nov 2012 23:35:50 +0900
|
||||
From: John Smith <JSmith@somenet.foo>
|
||||
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc13 Thunderbird/3.1.10
|
||||
MIME-Version: 1.0
|
||||
To: redmine@somenet.foo
|
||||
Subject: test
|
||||
Content-Type: multipart/mixed;
|
||||
boundary="------------050902080306030406090208"
|
||||
|
||||
This is a multi-part message in MIME format.
|
||||
--------------050902080306030406090208
|
||||
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
|
||||
Content-Transfer-Encoding: 7bit
|
||||
|
||||
test
|
||||
|
||||
--------------050902080306030406090208
|
||||
Content-Type: image/png;
|
||||
name="=?ISO-8859-1?Q?=C4=E4=D6=F6=DC=FC=C4=E4=D6=F6=DC=FC=C4=E4=D6=F6=DC=FC=C4=E4?=
|
||||
=?ISO-8859-1?Q?=D6=F6=DC=FC=C4=E4=D6=F6=DC=FC=C4=E4=D6=F6=DC=FC=C4=E4=D6?=
|
||||
=?ISO-8859-1?Q?=F6=DC=FC=C4=E4=D6=F6=DC=FC=C4=E4=D6=F6=DC=FC=C4=E4=D6=F6?=
|
||||
=?ISO-8859-1?Q?=DC=FC=C4=E4=D6=F6=DC=FC=2Epng?="
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Disposition: attachment;
|
||||
filename*0*=ISO-8859-1''%C4%E4%D6%F6%DC%FC%C4%E4%D6%F6%DC%FC%C4%E4%D6%F6;
|
||||
filename*1*=%DC%FC%C4%E4%D6%F6%DC%FC%C4%E4%D6%F6%DC%FC%C4%E4%D6%F6%DC%FC;
|
||||
filename*2*=%C4%E4%D6%F6%DC%FC%C4%E4%D6%F6%DC%FC%C4%E4%D6%F6%DC%FC%C4%E4;
|
||||
filename*3*=%D6%F6%DC%FC%C4%E4%D6%F6%DC%FC%2E%70%6E%67
|
||||
|
||||
iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAAXNSR0IArs4c6QAAAAlwSFlz
|
||||
AAALEwAACxMBAJqcGAAAAAd0SU1FB9wLFA4fJhRKIUQAAAAUSURBVAjXY/z//z8DEmBiQAWk
|
||||
8gHq9gMHP8uZWAAAAABJRU5ErkJggg==
|
||||
--------------050902080306030406090208--
|
||||
26
test/fixtures/mail_handler/thunderbird_with_attachment_ja.eml
vendored
Normal file
26
test/fixtures/mail_handler/thunderbird_with_attachment_ja.eml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Message-ID: <50AA00C6.4070108@gmail.com>
|
||||
Date: Mon, 19 Nov 2012 18:49:58 +0900
|
||||
From: John Smith <JSmith@somenet.foo>
|
||||
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Lightning/1.0b1 Thunderbird/3.0.10
|
||||
MIME-Version: 1.0
|
||||
To: redmine@somenet.foo
|
||||
Subject: test
|
||||
Content-Type: multipart/mixed;
|
||||
boundary="------------030104060902010800050907"
|
||||
|
||||
This is a multi-part message in MIME format.
|
||||
--------------030104060902010800050907
|
||||
Content-Type: text/plain; charset=ISO-2022-JP
|
||||
Content-Transfer-Encoding: 7bit
|
||||
|
||||
test
|
||||
|
||||
--------------030104060902010800050907
|
||||
Content-Type: text/plain;
|
||||
name="=?ISO-2022-JP?B?GyRCJUYlOSVIGyhCLnR4dA==?="
|
||||
Content-Transfer-Encoding: base64
|
||||
Content-Disposition: attachment;
|
||||
filename*=ISO-2022-JP''%1B%24%42%25%46%25%39%25%48%1B%28%42%2E%74%78%74
|
||||
|
||||
dGVzdAo=
|
||||
--------------030104060902010800050907--
|
||||
@@ -373,6 +373,80 @@ class MailHandlerTest < ActiveSupport::TestCase
|
||||
assert_equal 'caaf384198bcbc9563ab5c058acd73cd', attachment.digest
|
||||
end
|
||||
|
||||
def test_thunderbird_with_attachment_ja
|
||||
issue = submit_email(
|
||||
'thunderbird_with_attachment_ja.eml',
|
||||
:issue => {:project => 'ecookbook'}
|
||||
)
|
||||
assert_kind_of Issue, issue
|
||||
assert_equal 1, issue.attachments.size
|
||||
ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88.txt"
|
||||
ja.force_encoding('UTF-8') if ja.respond_to?(:force_encoding)
|
||||
attachment = issue.attachments.first
|
||||
assert_equal ja, attachment.filename
|
||||
assert_equal 5, attachment.filesize
|
||||
assert File.exist?(attachment.diskfile)
|
||||
assert_equal 5, File.size(attachment.diskfile)
|
||||
assert_equal 'd8e8fca2dc0f896fd7cb4cb0031ba249', attachment.digest
|
||||
end
|
||||
|
||||
def test_gmail_with_attachment_ja
|
||||
issue = submit_email(
|
||||
'gmail_with_attachment_ja.eml',
|
||||
:issue => {:project => 'ecookbook'}
|
||||
)
|
||||
assert_kind_of Issue, issue
|
||||
assert_equal 1, issue.attachments.size
|
||||
ja = "\xe3\x83\x86\xe3\x82\xb9\xe3\x83\x88.txt"
|
||||
ja.force_encoding('UTF-8') if ja.respond_to?(:force_encoding)
|
||||
attachment = issue.attachments.first
|
||||
assert_equal ja, attachment.filename
|
||||
assert_equal 5, attachment.filesize
|
||||
assert File.exist?(attachment.diskfile)
|
||||
assert_equal 5, File.size(attachment.diskfile)
|
||||
assert_equal 'd8e8fca2dc0f896fd7cb4cb0031ba249', attachment.digest
|
||||
end
|
||||
|
||||
def test_thunderbird_with_attachment_latin1
|
||||
issue = submit_email(
|
||||
'thunderbird_with_attachment_iso-8859-1.eml',
|
||||
:issue => {:project => 'ecookbook'}
|
||||
)
|
||||
assert_kind_of Issue, issue
|
||||
assert_equal 1, issue.attachments.size
|
||||
u = ""
|
||||
u.force_encoding('UTF-8') if u.respond_to?(:force_encoding)
|
||||
u1 = "\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc"
|
||||
u1.force_encoding('UTF-8') if u1.respond_to?(:force_encoding)
|
||||
11.times { u << u1 }
|
||||
attachment = issue.attachments.first
|
||||
assert_equal "#{u}.png", attachment.filename
|
||||
assert_equal 130, attachment.filesize
|
||||
assert File.exist?(attachment.diskfile)
|
||||
assert_equal 130, File.size(attachment.diskfile)
|
||||
assert_equal '4d80e667ac37dddfe05502530f152abb', attachment.digest
|
||||
end
|
||||
|
||||
def test_gmail_with_attachment_latin1
|
||||
issue = submit_email(
|
||||
'gmail_with_attachment_iso-8859-1.eml',
|
||||
:issue => {:project => 'ecookbook'}
|
||||
)
|
||||
assert_kind_of Issue, issue
|
||||
assert_equal 1, issue.attachments.size
|
||||
u = ""
|
||||
u.force_encoding('UTF-8') if u.respond_to?(:force_encoding)
|
||||
u1 = "\xc3\x84\xc3\xa4\xc3\x96\xc3\xb6\xc3\x9c\xc3\xbc"
|
||||
u1.force_encoding('UTF-8') if u1.respond_to?(:force_encoding)
|
||||
11.times { u << u1 }
|
||||
attachment = issue.attachments.first
|
||||
assert_equal "#{u}.txt", attachment.filename
|
||||
assert_equal 5, attachment.filesize
|
||||
assert File.exist?(attachment.diskfile)
|
||||
assert_equal 5, File.size(attachment.diskfile)
|
||||
assert_equal 'd8e8fca2dc0f896fd7cb4cb0031ba249', attachment.digest
|
||||
end
|
||||
|
||||
def test_add_issue_with_iso_8859_1_subject
|
||||
issue = submit_email(
|
||||
'subject_as_iso-8859-1.eml',
|
||||
@@ -393,6 +467,15 @@ class MailHandlerTest < ActiveSupport::TestCase
|
||||
assert_equal ja, issue.subject
|
||||
end
|
||||
|
||||
def test_add_issue_with_no_subject_header
|
||||
issue = submit_email(
|
||||
'no_subject_header.eml',
|
||||
:issue => {:project => 'ecookbook'}
|
||||
)
|
||||
assert_kind_of Issue, issue
|
||||
assert_equal '(no subject)', issue.subject
|
||||
end
|
||||
|
||||
def test_add_issue_with_mixed_japanese_subject
|
||||
issue = submit_email(
|
||||
'subject_japanese_2.eml',
|
||||
|
||||
@@ -28,17 +28,17 @@ class ProjectNestedSetTest < ActiveSupport::TestCase
|
||||
@a2 = Project.create!(:name => 'A2', :identifier => 'projecta2')
|
||||
@a2.set_parent!(@a)
|
||||
|
||||
@c = Project.create!(:name => 'C', :identifier => 'projectc')
|
||||
@c1 = Project.create!(:name => 'C1', :identifier => 'projectc1')
|
||||
@c1.set_parent!(@c)
|
||||
|
||||
@b = Project.create!(:name => 'B', :identifier => 'projectb')
|
||||
@b2 = Project.create!(:name => 'B2', :identifier => 'projectb2')
|
||||
@b2.set_parent!(@b)
|
||||
@b1 = Project.create!(:name => 'B1', :identifier => 'projectb1')
|
||||
@b1.set_parent!(@b)
|
||||
@b11 = Project.create!(:name => 'B11', :identifier => 'projectb11')
|
||||
@b11.set_parent!(@b1)
|
||||
@b2 = Project.create!(:name => 'B2', :identifier => 'projectb2')
|
||||
@b2.set_parent!(@b)
|
||||
|
||||
@c = Project.create!(:name => 'C', :identifier => 'projectc')
|
||||
@c1 = Project.create!(:name => 'C1', :identifier => 'projectc1')
|
||||
@c1.set_parent!(@c)
|
||||
|
||||
@a, @a1, @a2, @b, @b1, @b11, @b2, @c, @c1 = *(Project.all.sort_by(&:name))
|
||||
end
|
||||
@@ -47,6 +47,13 @@ class ProjectNestedSetTest < ActiveSupport::TestCase
|
||||
assert_valid_nested_set
|
||||
end
|
||||
|
||||
def test_rebuild_should_build_valid_tree
|
||||
Project.update_all "lft = NULL, rgt = NULL"
|
||||
|
||||
Project.rebuild!
|
||||
assert_valid_nested_set
|
||||
end
|
||||
|
||||
def test_moving_a_child_to_a_different_parent_should_keep_valid_tree
|
||||
assert_no_difference 'Project.count' do
|
||||
Project.find_by_name('B1').set_parent!(Project.find_by_name('A2'))
|
||||
|
||||
@@ -217,6 +217,40 @@ class RepositoryGitTest < ActiveSupport::TestCase
|
||||
assert_equal h1, h2
|
||||
end
|
||||
|
||||
def test_keep_extra_report_last_commit_in_clear_changesets
|
||||
assert_nil @repository.extra_info
|
||||
h = {}
|
||||
h["extra_report_last_commit"] = "1"
|
||||
@repository.merge_extra_info(h)
|
||||
@repository.save
|
||||
@project.reload
|
||||
|
||||
assert_equal 0, @repository.changesets.count
|
||||
@repository.fetch_changesets
|
||||
@project.reload
|
||||
|
||||
assert_equal NUM_REV, @repository.changesets.count
|
||||
@repository.send(:clear_changesets)
|
||||
assert_equal 1, @repository.extra_info.size
|
||||
assert_equal "1", @repository.extra_info["extra_report_last_commit"]
|
||||
end
|
||||
|
||||
def test_refetch_after_clear_changesets
|
||||
assert_nil @repository.extra_info
|
||||
assert_equal 0, @repository.changesets.count
|
||||
@repository.fetch_changesets
|
||||
@project.reload
|
||||
assert_equal NUM_REV, @repository.changesets.count
|
||||
|
||||
@repository.send(:clear_changesets)
|
||||
@project.reload
|
||||
assert_equal 0, @repository.changesets.count
|
||||
|
||||
@repository.fetch_changesets
|
||||
@project.reload
|
||||
assert_equal NUM_REV, @repository.changesets.count
|
||||
end
|
||||
|
||||
def test_parents
|
||||
assert_equal 0, @repository.changesets.count
|
||||
@repository.fetch_changesets
|
||||
|
||||
Reference in New Issue
Block a user