[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.0-444-g09dbf90

Alex Vandiver alexmv at bestpractical.com
Sat May 21 23:48:17 EDT 2011


The branch, 4.0-trunk has been updated
       via  09dbf90f4fdffab6247b3b6780184833d20190da (commit)
       via  accb31978c6a1e3826b14630b80323d8bfd35a31 (commit)
      from  2fcea5d4f711b616068f0359b6f6471fb913d8c2 (commit)

Summary of changes:
 t/fts/indexed_mysql.t  |    2 +-
 t/web/ticket_display.t |   63 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+), 1 deletions(-)
 create mode 100644 t/web/ticket_display.t

- Log -----------------------------------------------------------------
commit accb31978c6a1e3826b14630b80323d8bfd35a31
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 12 11:59:38 2011 +0800

    ticket display test, initially for ShowTicket right, also a good place for other basic tests of this page

diff --git a/t/web/ticket_display.t b/t/web/ticket_display.t
new file mode 100644
index 0000000..a9cab0c
--- /dev/null
+++ b/t/web/ticket_display.t
@@ -0,0 +1,63 @@
+use strict;
+use warnings;
+
+use RT::Test tests => 18;
+
+my $queue = RT::Test->load_or_create_queue( Name => 'General' );
+
+my $user = RT::Test->load_or_create_user(
+    Name     => 'user',
+    Password => 'password',
+);
+
+my ( $baseurl, $m ) = RT::Test->started_ok;
+ok(
+    RT::Test->set_rights(
+        { Principal => $user, Right => [qw(SeeQueue CreateTicket)] },
+    ),
+    'set rights'
+);
+
+ok $m->login( 'user', 'password' ), 'logged in as user';
+
+diag "test ShowTicket right";
+{
+
+    $m->get_ok( '/Ticket/Create.html?Queue=' . $queue->id,
+        'go to ticket create page' );
+    my $form = $m->form_name('TicketCreate');
+    $m->submit_form( fields => { Subject => 'ticket foo' } );
+
+    my $ticket = RT::Test->last_ticket;
+    ok( $ticket->id, 'ticket is created' );
+    my $id = $ticket->id;
+
+    $m->content_lacks( "Ticket $id created", 'created ticket' );
+    $m->content_contains( "No permission to view newly created ticket #$id",
+        'got no permission msg' );
+    $m->warning_like( qr/No permission to view newly created ticket #$id/,
+        'got no permission warning' );
+
+
+    $m->goto_ticket($id);
+    $m->content_contains( "No permission to view ticket",
+        'got no permission msg' );
+    $m->warning_like( qr/No permission to view ticket/, 'got warning' );
+    $m->title_is('RT Error');
+
+    ok(
+        RT::Test->add_rights(
+            { Principal => $user, Right => [qw(ShowTicket)] },
+        ),
+        'add ShowTicket right'
+    );
+
+    $m->reload;
+
+    $m->content_lacks( "No permission to view ticket", 'no error msg' );
+    $m->title_is( "#$id: ticket foo", 'we can it' );
+}
+
+
+# TODO more /Ticket/Display.html tests here
+

commit 09dbf90f4fdffab6247b3b6780184833d20190da
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Sat May 21 19:47:15 2011 -0400

    Adjust test count, post-b65f769

diff --git a/t/fts/indexed_mysql.t b/t/fts/indexed_mysql.t
index afb9409..f0395a5 100644
--- a/t/fts/indexed_mysql.t
+++ b/t/fts/indexed_mysql.t
@@ -14,7 +14,7 @@ $sphinx{'indexer'} = RT::Test->find_executable('indexer');
 plan skip_all => "No searchd and indexer under PATH"
     unless $sphinx{'searchd'} && $sphinx{'indexer'};
 
-plan tests => 13;
+plan tests => 15;
 
 RT->Config->Set( FullTextSearch => Enable => 1, Indexed => 1, Table => 'AttachmentsIndex', MaxMatches => 1000 );
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list