Commit f32a75f5 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

move tests t/ directory

parent 6b2516b7
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 144;
BEGIN { require 'xt/utils.pl' }
RT::Init();
use RT::Extension::CommandByMail::Test tests => undef;
my $test = 'RT::Extension::CommandByMail::Test';
RT->Config->Set('MailPlugins', 'Auth::MailFrom', 'Filter::TakeAction');
my $test_ticket_id;
......@@ -18,7 +15,7 @@ From: root\@localhost
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -37,7 +34,7 @@ Status: $status
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -56,7 +53,7 @@ FinalPriority: $final_priority
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -82,7 +79,7 @@ FinalPriority: $final_priority
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -106,7 +103,7 @@ $field: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -126,7 +123,7 @@ $field: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -146,7 +143,7 @@ TimeWorked: 5
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -166,7 +163,7 @@ $field: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -186,7 +183,7 @@ AddRequestor: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -204,7 +201,7 @@ DelRequestor: root\@localhost
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -222,7 +219,7 @@ $field: $test_ticket_id
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -258,7 +255,7 @@ CustomField.{$cf_name}: foo
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -282,7 +279,7 @@ CustomField.{$cf_name}: foo
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -332,7 +329,7 @@ CF.{$cf_name}: fro'b
owner test
END
$id = create_ticket_via_gate( $text );
(undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $ticket = RT::Ticket->new($RT::SystemUser);
$ticket->Load( $id );
......@@ -353,7 +350,7 @@ Cc: $cc
cc test
END
$id = create_ticket_via_gate( $text );
(undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $ticket = RT::Ticket->new($RT::SystemUser);
$ticket->Load( $id );
......@@ -365,4 +362,4 @@ END
}
1;
done_testing();
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 24;
BEGIN { require 'xt/utils.pl' }
use_ok('RT');
RT::LoadConfig();
use RT::Extension::CommandByMail::Test tests => undef, nodb => 1;
use_ok('RT::Interface::Email::Filter::TakeAction');
......@@ -140,3 +134,5 @@ diag( "test _CompileAdditiveForUpdate") if $ENV{'TEST_VERBOSE'};
);
is_deeply(\@res, [[],[]], 'del not current: do nothing');
}
done_testing();
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 134;
BEGIN { require 'xt/utils.pl' }
RT::Init();
use RT::Extension::CommandByMail::Test tests => undef;
my $test = 'RT::Extension::CommandByMail::Test';
RT->Config->Set('MailPlugins', 'Auth::MailFrom', 'Filter::TakeAction');
my $test_ticket_id;
......@@ -18,7 +15,7 @@ From: root\@localhost
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -37,7 +34,7 @@ Status: $status
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -56,7 +53,7 @@ FinalPriority: $final_priority
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -79,7 +76,7 @@ $field: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -99,7 +96,7 @@ $field: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -124,7 +121,7 @@ TimeWorked: 10
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
$obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -150,7 +147,7 @@ TimeWorked: 5
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
$obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -170,7 +167,7 @@ $field: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -192,7 +189,7 @@ AddRequestor: $value
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -210,7 +207,7 @@ DelRequestor: root\@localhost
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -230,7 +227,7 @@ From: root\@localhost
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
ok($id, "created ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -249,7 +246,7 @@ $field: $link_ticket_id
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -285,7 +282,7 @@ CustomField.{$cf_name}: foo
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -305,7 +302,7 @@ Priority: 44
test
END
my $id = create_ticket_via_gate( $text );
my (undef, $id) = $test->send_via_mailgate( $text );
is($id, $test_ticket_id, "updated ticket");
my $obj = RT::Ticket->new( $RT::SystemUser );
$obj->Load( $id );
......@@ -316,3 +313,4 @@ END
like($content, qr/Priority: 44/, "invalid Priority command not stripped");
}
done_testing();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment