[Rt-commit] rt branch, 4.2/hide-unset-fields-in-display, updated. rt-4.0.0rc7-252-g6ee2617
? sunnavy
sunnavy at bestpractical.com
Fri Jul 8 01:43:42 EDT 2011
The branch, 4.2/hide-unset-fields-in-display has been updated
via 6ee26179a62795d4f36f7d85092cbffa46d8a830 (commit)
from d60bf72eec0a2b2c0e4edcf6f5792e666ca34723 (commit)
Summary of changes:
t/web/ticket_display_unset_fields.t | 77 +++++++++++++++++++++++++++++++++++
1 files changed, 77 insertions(+), 0 deletions(-)
create mode 100644 t/web/ticket_display_unset_fields.t
- Log -----------------------------------------------------------------
commit 6ee26179a62795d4f36f7d85092cbffa46d8a830
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Jul 8 13:36:51 2011 +0800
tests of hiding unset fields
diff --git a/t/web/ticket_display_unset_fields.t b/t/web/ticket_display_unset_fields.t
new file mode 100644
index 0000000..7f7caf8
--- /dev/null
+++ b/t/web/ticket_display_unset_fields.t
@@ -0,0 +1,77 @@
+use strict;
+use warnings;
+
+use RT::Test tests => 36;
+
+my @link_labels = (
+ 'Depends on',
+ 'Depended on by',
+ 'Parents',
+ 'Children',
+ 'Refers to',
+ 'Referred to by',
+);
+
+my $foo = RT::Test->create_ticket(
+ Queue => 'General',
+ Subject => 'test display page',
+);
+my $dep = RT::Test->create_ticket(
+ Queue => 'General',
+ Subject => 'dep ticket',
+);
+my $bar = RT::Test->create_ticket(
+ Queue => 'General',
+ Subject => 'depend ticket',
+ Starts => '2011-07-08 00:00:00',
+ Started => '2011-07-09 00:00:00',
+ Told => '2011-07-10 00:00:00',
+ Resolved => '2011-07-11 00:00:00',
+ Due => '2011-07-12 00:00:00',
+ Cc => 'foo at example.com',
+ AdminCc => 'admin at example.com',
+ DependsOn => [ $dep->id ],
+);
+
+my ( $baseurl, $m ) = RT::Test->started_ok;
+
+diag "test with root";
+{
+ $m->login;
+ $m->goto_ticket( $foo->id );
+
+ for my $label (qw/Starts Started Closed Cc AdminCc/) {
+ $m->content_lacks( "$label:", "lacks $label as value is unset" );
+ }
+
+ # there is one Due: in reminder
+ $m->content_unlike( qr/Due:.*Due:/s, "lacks Due as value is unset" );
+
+ $m->content_contains( "Last Contact", "has Told as root can set it" );
+ for my $label (@link_labels) {
+ $m->content_contains( "$label", "has $label as root can create" );
+ }
+
+ $m->goto_ticket( $bar->id );
+ for my $label (qw/Starts Started Closed Cc AdminCc/) {
+ $m->content_contains( "$label:", "has $label as value is set" );
+ }
+ $m->content_like( qr/Due:.*Due:/s, "has Due as value is set" );
+}
+
+diag "test without ModifyTicket right";
+{
+ my $user =
+ RT::Test->load_or_create_user( Name => 'foo', Password => 'password' );
+ RT::Test->set_rights( Principal => $user, Right => ['ShowTicket'] );
+ $m->login( 'foo', 'password', logout => 1 );
+ $m->goto_ticket( $foo->id );
+ $m->content_lacks( "Last Contact", "lacks Told as it is unset" );
+ for my $label ( @link_labels ) {
+ $m->content_lacks( $label, "lacks $label as it is unset" );
+ }
+
+ $m->goto_ticket( $bar->id );
+ $m->content_contains( "Depends on", "has Depends on as it is set" );
+}
+
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list