[Rt-commit] r5266 - RT-Extension-CommandByEmail/t
ruz at bestpractical.com
ruz at bestpractical.com
Fri May 19 16:58:27 EDT 2006
Author: ruz
Date: Fri May 19 16:58:26 2006
New Revision: 5266
Modified:
RT-Extension-CommandByEmail/t/02.create.t
RT-Extension-CommandByEmail/t/03.update.t
Log:
* fixes for dates tests
Modified: RT-Extension-CommandByEmail/t/02.create.t
==============================================================================
--- RT-Extension-CommandByEmail/t/02.create.t (original)
+++ RT-Extension-CommandByEmail/t/02.create.t Fri May 19 16:58:26 2006
@@ -67,13 +67,16 @@
# XXX: these test are fail as
diag("set date on create") if $ENV{'TEST_VERBOSE'};
-foreach my $date ( qw(Due Starts Started) ) {
+foreach my $field ( qw(Due Starts Started) ) {
my $value = '2005-12-01 12:34:00';
+ my $date_obj = RT::Date->new( $RT::System );
+ $date_obj->Set( Format => 'unknown', Value => $value );
+
my $text = <<END;
Subject: test
From: root\@localhost
-$date: $value
+$field: $value
test
END
@@ -82,8 +85,8 @@
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
is($obj->id, $id, "loaded ticket");
- my $method = $date .'Obj';
- is($obj->$method->ISO, $value, 'set date' );
+ my $method = $field .'Obj';
+ is($obj->$method->ISO, $date_obj->ISO, 'set date' );
}
diag("set time on create") if $ENV{'TEST_VERBOSE'};
Modified: RT-Extension-CommandByEmail/t/03.update.t
==============================================================================
--- RT-Extension-CommandByEmail/t/03.update.t (original)
+++ RT-Extension-CommandByEmail/t/03.update.t Fri May 19 16:58:26 2006
@@ -66,13 +66,16 @@
} }
diag("set date on update") if $ENV{'TEST_VERBOSE'};
-foreach my $date ( qw(Due Starts Started) ) {
+foreach my $field ( qw(Due Starts Started) ) {
my $value = '2005-12-01 12:34:00';
+ my $date_obj = RT::Date->new( $RT::System );
+ $date_obj->Set( Format => 'unknown', Value => $value );
+
my $text = <<END;
Subject: [$RT::rtname #$test_ticket_id] test
From: root\@localhost
-$date: $value
+$field: $value
test
END
@@ -81,8 +84,8 @@
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
is($obj->id, $id, "loaded ticket");
- my $method = $date .'Obj';
- is($obj->$method->ISO, $value, 'set date' );
+ my $method = $field .'Obj';
+ is($obj->$method->ISO, $date_obj->ISO, 'set date' );
}
diag("set time on update") if $ENV{'TEST_VERBOSE'};
More information about the Rt-commit
mailing list