[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.6-34-g8ec9c13

sunnavy at bestpractical.com sunnavy at bestpractical.com
Mon Oct 26 21:06:22 EDT 2009


The branch, 3.8-trunk has been updated
       via  8ec9c13c06758f77b38e86edb1c8f3f9ab24907c (commit)
      from  1a8fd23ee6c068f9d7f949ada4c28be31e1b8dfe (commit)

Summary of changes:
 t/web/command_line_with_unknown_field.t |   34 +++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 t/web/command_line_with_unknown_field.t

- Log -----------------------------------------------------------------
commit 8ec9c13c06758f77b38e86edb1c8f3f9ab24907c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Oct 27 09:03:40 2009 +0800

    add t/web/command_line_with_unknown_field

diff --git a/t/web/command_line_with_unknown_field.t b/t/web/command_line_with_unknown_field.t
new file mode 100644
index 0000000..9a7ec7a
--- /dev/null
+++ b/t/web/command_line_with_unknown_field.t
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Spec ();
+use Test::Expect;
+use RT::Test tests => 10;
+my ($baseurl, $m) = RT::Test->started_ok;
+my $rt_tool_path = "$RT::BinPath/rt";
+
+$ENV{'RTUSER'} = 'root';
+$ENV{'RTPASSWD'} = 'password';
+$RT::Logger->debug("Connecting to server at ".RT->Config->Get('WebBaseURL'));
+$ENV{'RTSERVER'} =RT->Config->Get('WebBaseURL') ;
+$ENV{'RTDEBUG'} = '1';
+
+expect_run(
+    command => "$rt_tool_path shell",
+    prompt => 'rt> ',
+    quit => 'quit',
+);
+expect_send(q{create -t ticket set subject='new ticket' add cc=foo at example.com}, "Creating a ticket...");
+expect_like(qr/Ticket \d+ created/, "Created the ticket");
+expect_handle->before() =~ /Ticket (\d+) created/;
+my $ticket_id = $1;
+
+expect_send("edit ticket/$ticket_id set marge=simpson", 'set unknown field');
+expect_like(qr/marge: Unknown field/, 'marge is unknown field');
+expect_like(qr/marge: simpson/, 'the value we set for marge is shown too');
+
+expect_send("edit ticket/$ticket_id set homer=simpson", 'set unknown field');
+expect_like(qr/homer: Unknown field/, 'homer is unknown field');
+expect_like(qr/homer: simpson/, 'the value we set for homer is shown too');
+
+expect_quit();

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


More information about the Rt-commit mailing list