[Rt-commit] rt branch, master, updated. rt-4.1.8-260-g0c5918f

Alex Vandiver alexmv at bestpractical.com
Mon May 6 20:45:21 EDT 2013


The branch, master has been updated
       via  0c5918f44e1a8bfe6bb7e519a81bc91909d4bc64 (commit)
       via  453e2192e5820327695eec506ca266bf1775f79b (commit)
       via  89bafb87a5cdd17148d1019f054f474cf0159dd0 (commit)
       via  3b57e1c9a569df7caff9cbc0a5ca0605dc48e991 (commit)
       via  bd64a908b3b3d85ebe8640bcf4c23bf1bc80bcc4 (commit)
       via  c8bef5499b5072a78d7a673c266790e8657498b7 (commit)
       via  62ad73c52b8a49abb06e3c5a6344854a879ec8c5 (commit)
       via  37b097ddfd7e25f5c2524535403d369e0ab5ad58 (commit)
       via  41d601c7dc3b650e541f6cfd67d6f8ad802dfcc2 (commit)
       via  eaf2483437ebd057dc52b2c102e493257a1982ba (commit)
       via  bffa7ee2f2d27b757a7db12829b4fa146e92af05 (commit)
       via  82974e889bac53c4bdd68e5508a7ad84c6ec942b (commit)
       via  e24c52fbc57e1e5a858e256f22b4f88cc2058fe7 (commit)
       via  32b67b10fb208978d87add2cff8ed432a4706aad (commit)
       via  9728abf27744196734cb901f500bd07288ff2e67 (commit)
       via  df996e99b173b0657b92d2f6c982d8a75cca65e9 (commit)
      from  73b65483052c5a9c94bbcaa05b9d045777c87d37 (commit)

Summary of changes:
 docs/UPGRADING-4.2                                 |   7 +
 docs/customizing/styling_rt.pod                    |  28 +---
 etc/RT_Config.pm.in                                |   2 +-
 etc/upgrade/sanity-check-stylesheets.pl            |  16 +-
 lib/RT.pm                                          |   4 +-
 lib/RT/Config.pm                                   |   6 +-
 lib/RT/Dashboard/Mailer.pm                         |  61 +++----
 lib/RT/Interface/Web.pm                            |  10 ++
 lib/RT/Interface/Web/Handler.pm                    |  24 ++-
 lib/RT/Squish/CSS.pm                               |  23 +--
 lib/RT/Squish/JS.pm                                |  12 +-
 lib/RT/User.pm                                     |   6 +-
 sbin/rt-test-dependencies.in                       |   1 +
 share/html/Elements/Header                         |   8 +-
 share/html/NoAuth/css/aileron/InHeader             |   4 +-
 share/html/NoAuth/css/aileron/base.css             |  62 -------
 share/html/NoAuth/css/aileron/forms.css            |  80 ---------
 share/html/NoAuth/css/aileron/layout.css           | 174 --------------------
 share/html/NoAuth/css/aileron/login.css            |  50 ------
 share/html/NoAuth/css/aileron/main.css             |  63 --------
 share/html/NoAuth/css/aileron/misc.css             |  58 -------
 share/html/NoAuth/css/aileron/msie.css             | 180 ---------------------
 share/html/NoAuth/css/aileron/msie6.css            |  86 ----------
 share/html/NoAuth/css/aileron/ticket.css           |  56 -------
 share/html/NoAuth/css/ballard/InHeader             |   4 +-
 share/html/NoAuth/css/ballard/base.css             |  62 -------
 share/html/NoAuth/css/ballard/layout.css           | 177 --------------------
 share/html/NoAuth/css/ballard/main.css             |  61 -------
 share/html/NoAuth/css/ballard/misc.css             |  58 -------
 share/html/NoAuth/css/ballard/msie6.css            |  88 ----------
 share/html/NoAuth/css/base/accordion.css           |  83 ----------
 share/html/NoAuth/css/base/admin.css               | 105 ------------
 share/html/NoAuth/css/base/articles.css            |  54 -------
 share/html/NoAuth/css/base/collection.css          |  55 -------
 share/html/NoAuth/css/base/farbtastic.css          |  98 -----------
 share/html/NoAuth/css/base/history-folding.css     |  91 -----------
 share/html/NoAuth/css/base/jquery-ui.css           |  48 ------
 share/html/NoAuth/css/base/login.css               | 114 -------------
 share/html/NoAuth/css/base/main.css                |  78 ---------
 share/html/NoAuth/css/base/misc.css                | 116 -------------
 share/html/NoAuth/css/base/nav.css                 |  64 --------
 share/html/NoAuth/css/base/portlets.css            |  64 --------
 share/html/NoAuth/css/base/record.css              |  57 -------
 share/html/NoAuth/css/base/theme-editor.css        | 116 -------------
 share/html/NoAuth/css/base/ticket-form.css         | 122 --------------
 share/html/NoAuth/css/base/tools.css               |  54 -------
 share/html/NoAuth/css/dhandler                     |   2 +-
 share/html/NoAuth/css/web2/InHeader                |   4 +-
 share/html/NoAuth/css/web2/base.css                |  62 -------
 share/html/NoAuth/css/web2/main.css                |  61 -------
 share/html/NoAuth/css/web2/misc.css                |  58 -------
 share/html/NoAuth/css/web2/msie6.css               |  96 -----------
 share/html/m/_elements/header                      |   2 +-
 share/html/m/_elements/login                       |   6 +-
 share/html/m/style.css                             |  52 ------
 share/static/css/aileron/base.css                  |  15 ++
 .../{html/NoAuth => static}/css/aileron/boxes.css  |  51 +-----
 share/static/css/aileron/forms.css                 |  33 ++++
 share/static/css/aileron/layout.css                | 127 +++++++++++++++
 share/static/css/aileron/login.css                 |   3 +
 share/static/css/aileron/main.css                  |  12 ++
 share/static/css/aileron/misc.css                  |  11 ++
 share/static/css/aileron/msie.css                  | 133 +++++++++++++++
 share/static/css/aileron/msie6.css                 |  39 +++++
 share/{html/NoAuth => static}/css/aileron/nav.css  |  49 +-----
 .../NoAuth => static}/css/aileron/ticket-lists.css |  47 ------
 .../css/aileron/ticket-search.css                  |  47 ------
 share/static/css/aileron/ticket.css                |   9 ++
 share/static/css/ballard/base.css                  |  15 ++
 .../{html/NoAuth => static}/css/ballard/boxes.css  |  51 +-----
 .../css/ballard/images/background-gradient.png     | Bin 394 -> 0 bytes
 share/static/css/ballard/layout.css                | 130 +++++++++++++++
 share/static/css/ballard/main.css                  |   9 ++
 share/static/css/ballard/misc.css                  |  11 ++
 share/{html/NoAuth => static}/css/ballard/msie.css |  47 ------
 share/static/css/ballard/msie6.css                 |  41 +++++
 share/{html/NoAuth => static}/css/ballard/nav.css  |  47 ------
 .../web2 => static/css/ballard}/ticket-lists.css   |  47 ------
 .../css/ballard/ticket-search.css                  |  47 ------
 share/static/css/base/accordion.css                |  36 +++++
 share/static/css/base/admin.css                    |  58 +++++++
 share/static/css/base/articles.css                 |   7 +
 share/static/css/base/collection.css               |   8 +
 share/static/css/base/farbtastic.css               |  51 ++++++
 share/{html/NoAuth => static}/css/base/forms.css   |  49 ------
 share/static/css/base/history-folding.css          |  44 +++++
 share/{html/NoAuth => static}/css/base/history.css |  47 ------
 .../css/base/jquery-ui-timepicker-addon.css        |   0
 share/static/css/base/jquery-ui.css                |   1 +
 .../css/base/jquery-ui.custom.modified.css         |  32 ++--
 .../NoAuth => static}/css/base/jquery.modal.css    |   2 +-
 share/static/css/base/login.css                    |  67 ++++++++
 share/static/css/base/main.css                     |  26 +++
 share/static/css/base/misc.css                     |  69 ++++++++
 share/static/css/base/nav.css                      |  17 ++
 share/static/css/base/portlets.css                 |  17 ++
 share/static/css/base/record.css                   |  10 ++
 .../NoAuth => static}/css/base/rights-editor.css   |  47 ------
 .../css/base/superfish-navbar.css                  |   0
 .../css/base/superfish-vertical.css                |   0
 .../{html/NoAuth => static}/css/base/superfish.css |   4 +-
 .../NoAuth => static}/css/base/tablesorter.css     |   6 +-
 share/static/css/base/theme-editor.css             |  69 ++++++++
 share/static/css/base/ticket-form.css              |  75 +++++++++
 share/{html/NoAuth => static}/css/base/ticket.css  |  47 ------
 share/static/css/base/tools.css                    |   7 +
 .../{html/NoAuth => static}/css/base/yui-fonts.css |   0
 .../{aileron => }/images/background-gradient.png   | Bin
 .../_elements/raw_style => static/css/mobile.css}  |  49 +-----
 share/{html/NoAuth => static}/css/print.css        |  49 +-----
 share/static/css/web2/base.css                     |  15 ++
 share/{html/NoAuth => static}/css/web2/boxes.css   |  51 +-----
 .../static/css/web2/images/background-gradient.png | Bin 394 -> 0 bytes
 share/{html/NoAuth => static}/css/web2/layout.css  |  51 +-----
 share/static/css/web2/main.css                     |   9 ++
 share/static/css/web2/misc.css                     |  11 ++
 share/{html/NoAuth => static}/css/web2/msie.css    |  47 ------
 share/static/css/web2/msie6.css                    |  49 ++++++
 share/{html/NoAuth => static}/css/web2/nav.css     |  51 +-----
 .../ballard => static/css/web2}/ticket-lists.css   |  47 ------
 .../NoAuth => static}/css/web2/ticket-search.css   |  47 ------
 t/web/attachments.t                                |   2 +-
 t/web/squish.t                                     |   4 +-
 123 files changed, 1375 insertions(+), 4057 deletions(-)
 delete mode 100644 share/html/NoAuth/css/aileron/base.css
 delete mode 100644 share/html/NoAuth/css/aileron/forms.css
 delete mode 100644 share/html/NoAuth/css/aileron/layout.css
 delete mode 100644 share/html/NoAuth/css/aileron/login.css
 delete mode 100644 share/html/NoAuth/css/aileron/main.css
 delete mode 100644 share/html/NoAuth/css/aileron/misc.css
 delete mode 100644 share/html/NoAuth/css/aileron/msie.css
 delete mode 100644 share/html/NoAuth/css/aileron/msie6.css
 delete mode 100644 share/html/NoAuth/css/aileron/ticket.css
 delete mode 100644 share/html/NoAuth/css/ballard/base.css
 delete mode 100644 share/html/NoAuth/css/ballard/layout.css
 delete mode 100644 share/html/NoAuth/css/ballard/main.css
 delete mode 100644 share/html/NoAuth/css/ballard/misc.css
 delete mode 100644 share/html/NoAuth/css/ballard/msie6.css
 delete mode 100644 share/html/NoAuth/css/base/accordion.css
 delete mode 100644 share/html/NoAuth/css/base/admin.css
 delete mode 100644 share/html/NoAuth/css/base/articles.css
 delete mode 100644 share/html/NoAuth/css/base/collection.css
 delete mode 100644 share/html/NoAuth/css/base/farbtastic.css
 delete mode 100644 share/html/NoAuth/css/base/history-folding.css
 delete mode 100644 share/html/NoAuth/css/base/jquery-ui.css
 delete mode 100644 share/html/NoAuth/css/base/login.css
 delete mode 100644 share/html/NoAuth/css/base/main.css
 delete mode 100644 share/html/NoAuth/css/base/misc.css
 delete mode 100644 share/html/NoAuth/css/base/nav.css
 delete mode 100644 share/html/NoAuth/css/base/portlets.css
 delete mode 100644 share/html/NoAuth/css/base/record.css
 delete mode 100644 share/html/NoAuth/css/base/theme-editor.css
 delete mode 100644 share/html/NoAuth/css/base/ticket-form.css
 delete mode 100644 share/html/NoAuth/css/base/tools.css
 delete mode 100644 share/html/NoAuth/css/web2/base.css
 delete mode 100644 share/html/NoAuth/css/web2/main.css
 delete mode 100644 share/html/NoAuth/css/web2/misc.css
 delete mode 100644 share/html/NoAuth/css/web2/msie6.css
 delete mode 100644 share/html/m/style.css
 create mode 100644 share/static/css/aileron/base.css
 rename share/{html/NoAuth => static}/css/aileron/boxes.css (51%)
 create mode 100644 share/static/css/aileron/forms.css
 create mode 100644 share/static/css/aileron/layout.css
 create mode 100644 share/static/css/aileron/login.css
 create mode 100644 share/static/css/aileron/main.css
 create mode 100644 share/static/css/aileron/misc.css
 create mode 100644 share/static/css/aileron/msie.css
 create mode 100644 share/static/css/aileron/msie6.css
 rename share/{html/NoAuth => static}/css/aileron/nav.css (62%)
 rename share/{html/NoAuth => static}/css/aileron/ticket-lists.css (58%)
 rename share/{html/NoAuth => static}/css/aileron/ticket-search.css (59%)
 create mode 100644 share/static/css/aileron/ticket.css
 create mode 100644 share/static/css/ballard/base.css
 rename share/{html/NoAuth => static}/css/ballard/boxes.css (51%)
 delete mode 100644 share/static/css/ballard/images/background-gradient.png
 create mode 100644 share/static/css/ballard/layout.css
 create mode 100644 share/static/css/ballard/main.css
 create mode 100644 share/static/css/ballard/misc.css
 rename share/{html/NoAuth => static}/css/ballard/msie.css (56%)
 create mode 100644 share/static/css/ballard/msie6.css
 rename share/{html/NoAuth => static}/css/ballard/nav.css (55%)
 rename share/{html/NoAuth/css/web2 => static/css/ballard}/ticket-lists.css (58%)
 rename share/{html/NoAuth => static}/css/ballard/ticket-search.css (60%)
 create mode 100644 share/static/css/base/accordion.css
 create mode 100644 share/static/css/base/admin.css
 create mode 100644 share/static/css/base/articles.css
 create mode 100644 share/static/css/base/collection.css
 create mode 100644 share/static/css/base/farbtastic.css
 rename share/{html/NoAuth => static}/css/base/forms.css (63%)
 create mode 100644 share/static/css/base/history-folding.css
 rename share/{html/NoAuth => static}/css/base/history.css (57%)
 rename share/{html/NoAuth => static}/css/base/jquery-ui-timepicker-addon.css (100%)
 create mode 100644 share/static/css/base/jquery-ui.css
 rename share/{html/NoAuth => static}/css/base/jquery-ui.custom.modified.css (92%)
 rename share/{html/NoAuth => static}/css/base/jquery.modal.css (94%)
 create mode 100644 share/static/css/base/login.css
 create mode 100644 share/static/css/base/main.css
 create mode 100644 share/static/css/base/misc.css
 create mode 100644 share/static/css/base/nav.css
 create mode 100644 share/static/css/base/portlets.css
 create mode 100644 share/static/css/base/record.css
 rename share/{html/NoAuth => static}/css/base/rights-editor.css (52%)
 rename share/{html/NoAuth => static}/css/base/superfish-navbar.css (100%)
 rename share/{html/NoAuth => static}/css/base/superfish-vertical.css (100%)
 rename share/{html/NoAuth => static}/css/base/superfish.css (92%)
 rename share/{html/NoAuth => static}/css/base/tablesorter.css (80%)
 create mode 100644 share/static/css/base/theme-editor.css
 create mode 100644 share/static/css/base/ticket-form.css
 rename share/{html/NoAuth => static}/css/base/ticket.css (64%)
 create mode 100644 share/static/css/base/tools.css
 rename share/{html/NoAuth => static}/css/base/yui-fonts.css (100%)
 rename share/static/css/{aileron => }/images/background-gradient.png (100%)
 rename share/{html/m/_elements/raw_style => static/css/mobile.css} (77%)
 rename share/{html/NoAuth => static}/css/print.css (58%)
 create mode 100644 share/static/css/web2/base.css
 rename share/{html/NoAuth => static}/css/web2/boxes.css (50%)
 delete mode 100644 share/static/css/web2/images/background-gradient.png
 rename share/{html/NoAuth => static}/css/web2/layout.css (54%)
 create mode 100644 share/static/css/web2/main.css
 create mode 100644 share/static/css/web2/misc.css
 rename share/{html/NoAuth => static}/css/web2/msie.css (57%)
 create mode 100644 share/static/css/web2/msie6.css
 rename share/{html/NoAuth => static}/css/web2/nav.css (68%)
 rename share/{html/NoAuth/css/ballard => static/css/web2}/ticket-lists.css (58%)
 rename share/{html/NoAuth => static}/css/web2/ticket-search.css (59%)

- Log -----------------------------------------------------------------
commit 0c5918f44e1a8bfe6bb7e519a81bc91909d4bc64
Merge: 73b6548 453e219
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon May 6 20:34:24 2013 -0400

    Merge branch '4.2/static-css'
    
    Conflicts:
    	docs/UPGRADING-4.2

diff --cc docs/UPGRADING-4.2
index 29bd771,ae7dcf5..e6a94f1
--- a/docs/UPGRADING-4.2
+++ b/docs/UPGRADING-4.2
@@@ -89,10 -89,9 +89,17 @@@ UPGRADING FROM RT 4.0.0 and greate
    This command deletes records from Transactions table. This script can only fix
    TimeWorked mismatch, but not TimeLeft or TimeEstimated.
  
 +* A new action, "Open Inactive Tickets", has been added, and on new
 +  installs the default scrip "On Correspond Open Tickets" has been
 +  replaced by "On Correspond Open Inactive Tickets".  The key difference
 +  between "Open Tickets" and "Open Inactive Tickets" is that the latter
 +  will not adjust the status of a ticket if it is already active.  This
 +  is particularly useful when creating complex workflows using
 +  Lifecycles.
++
+ * CSS is no longer processed through Mason; it's served by a proper static file
+   handler.  If you used the Begin or End callbacks of main.css in the aileron,
+   web2, or ballard themes, you should transition to the @CSSFiles config option.
+   If you need to target specific themes, you can use the class set on the <body>
+   element (for example: body.aileron).  See docs/customizing/styling_rt.pd for
+   more information on custom styles.
diff --cc sbin/rt-test-dependencies.in
index b88b1a5,6880c3f..bbcd02c
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@@ -326,8 -325,10 +326,9 @@@ Data::ICa
  .
  
  $deps{'DASHBOARDS'} = [ text_to_hash( << '.') ];
 -HTML::RewriteAttributes 0.05
  MIME::Types
  URI 1.59
+ URI::QueryParam
  .
  
  $deps{'GRAPHVIZ'} = [ text_to_hash( << '.') ];
diff --cc t/web/attachments.t
index 316396d,82efa6e..ea110d4
--- a/t/web/attachments.t
+++ b/t/web/attachments.t
@@@ -5,501 -5,90 +5,501 @@@ use RT::Test tests => 159
  
  use constant LogoFile => $RT::StaticPath .'/images/bpslogo.png';
  use constant FaviconFile => $RT::StaticPath .'/images/favicon.png';
- use constant TextFile => $RT::MasonComponentRoot .'/NoAuth/css/print.css';
+ use constant TextFile => $RT::StaticPath .'/css/print.css';
  
 -my ($baseurl, $m) = RT::Test->started_ok;
 +my ($url, $m) = RT::Test->started_ok;
  ok $m->login, 'logged in';
  
 -my $queue = RT::Queue->new(RT->Nobody);
 -my $qid = $queue->Load('General');
 -ok( $qid, "Loaded General queue" );
 -
 -$m->form_name('CreateTicketInQueue');
 -$m->field('Queue', $qid);
 -$m->submit;
 -is($m->status, 200, "request successful");
 -$m->content_contains("Create a new ticket", 'ticket create page');
 -
 -$m->form_name('TicketCreate');
 -$m->field('Subject', 'Attachments test');
 -$m->field('Attach',  LogoFile);
 -$m->field('Content', 'Some content');
 -$m->submit;
 -is($m->status, 200, "request successful");
 -
 -$m->content_contains('Attachments test', 'we have subject on the page');
 -$m->content_contains('Some content', 'and content');
 -$m->content_contains('Download bpslogo.png', 'page has file name');
 -
 -open LOGO, "<", LogoFile or die "Can't open logo file: $!";
 -binmode LOGO;
 -my $logo_contents = do {local $/; <LOGO>};
 -close LOGO;
 -$m->follow_link_ok({text => "Download bpslogo.png"});
 -is($m->content_type, "image/png");
 -is($m->content, $logo_contents, "Binary content matches");
 -
 -$m->back;
 -$m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 -$m->form_name('TicketUpdate');
 -$m->field('Attach',  TextFile);
 -$m->click('AddMoreAttach');
 -is($m->status, 200, "request successful");
 -
 -$m->form_name('TicketUpdate');
 -$m->field('Attach',  FaviconFile);
 -$m->field('UpdateContent', 'Message');
 -$m->click('SubmitTicket');
 -is($m->status, 200, "request successful");
 -
 -$m->content_contains('Download bpslogo.png', 'page has file name');
 -$m->content_contains('Download favicon.png', 'page has file name');
 -$m->content_contains('Download print.css', 'page has file name');
 -
 -$m->follow_link_ok( { text => 'Download bpslogo.png' } );
 -is( $m->response->header('Content-Type'), 'image/png', 'Content-Type of png lacks charset' );
 -
 -$m->back;
 -
 -$m->follow_link_ok( { text => 'Download print.css' } );
 -is( $m->response->header('Content-Type'),
 -    'text/css;charset=UTF-8', 'Content-Type of text has charset' );
 -
 -diag "test mobile ui";
 -$m->get_ok( $baseurl . '/m/ticket/create?Queue=' . $qid );
 -
 -$m->form_name('TicketCreate');
 -$m->field('Subject', 'Attachments test');
 -$m->field('Attach',  LogoFile);
 -$m->field('Content', 'Some content');
 -$m->submit;
 -is($m->status, 200, "request successful");
 -
 -$m->content_contains('Attachments test', 'we have subject on the page');
 -$m->content_contains('bpslogo.png', 'page has file name');
 -
 -$m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 -$m->form_name('TicketUpdate');
 -$m->field('Attach',  LogoFile);
 -$m->click('AddMoreAttach');
 -is($m->status, 200, "request successful");
 -
 -$m->form_name('TicketUpdate');
 -$m->field('Attach',  FaviconFile);
 -$m->field('UpdateContent', 'Message');
 -$m->click('SubmitTicket');
 -is($m->status, 200, "request successful");
 -
 -$m->content_contains('bpslogo.png', 'page has file name');
 -$m->content_contains('favicon.png', 'page has file name');
 +my $queue = RT::Test->load_or_create_queue( Name => 'General' );
 +ok( $queue && $queue->id, "Loaded General queue" );
 +
 +diag "create a ticket in full interface";
 +diag "w/o attachments";
 +{
 +    $m->goto_create_ticket( $queue );
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->content_contains("Create a new ticket", 'ticket create page');
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +}
 +
 +diag "with one attachment";
 +{
 +    $m->goto_create_ticket( $queue );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Attach',  LogoFile);
 +    $m->field('Content', 'Some content');
 +
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Attachments test', 'we have subject on the page');
 +    $m->content_contains('Some content', 'and content');
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +}
 +
 +diag "with two attachments";
 +{
 +    $m->goto_create_ticket( $queue );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Content', 'Some content');
 +
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Attachments test', 'we have subject on the page');
 +    $m->content_contains('Some content', 'and content');
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "with one attachment, but delete one along the way";
 +{
 +    $m->goto_create_ticket( $queue );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->tick( 'DeleteAttach', LogoFile );
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Content', 'Some content');
 +
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Attachments test', 'we have subject on the page');
 +    $m->content_contains('Some content', 'and content');
 +    $m->content_lacks('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "with one attachment, but delete one along the way";
 +{
 +    $m->goto_create_ticket( $queue );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->tick( 'DeleteAttach', LogoFile );
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Content', 'Some content');
 +
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Attachments test', 'we have subject on the page');
 +    $m->content_contains('Some content', 'and content');
 +    $m->content_lacks('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "reply to a ticket in full interface";
 +diag "with one attachment";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  LogoFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +}
 +
 +diag "with two attachments";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "with one attachment, delete one along the way";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketUpdate');
 +    $m->tick('DeleteAttach',  LogoFile);
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_lacks('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "jumbo interface";
 +diag "with one attachment";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->follow_link_ok({text => 'Jumbo'}, "jumbo the ticket");
 +    $m->form_name('TicketModifyAll');
 +    $m->field('Attach',  LogoFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +}
 +
 +diag "with two attachments";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->follow_link_ok({text => 'Jumbo'}, "jumbo the ticket");
 +    $m->form_name('TicketModifyAll');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketModifyAll');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "with one attachment, delete one along the way";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->follow_link_ok({text => 'Jumbo'}, "jumbo the ticket");
 +    $m->form_name('TicketModifyAll');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketModifyAll');
 +    $m->tick('DeleteAttach',  LogoFile);
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->goto_ticket( $ticket->id );
 +    $m->content_lacks('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "bulk update";
 +diag "one attachment";
 +{
 +    my @tickets = RT::Test->create_tickets(
 +        {
 +            Queue   => $queue,
 +            Subject => 'Attachments test',
 +            Content => 'Some content',
 +        },
 +        {},
 +        {},
 +    );
 +    my $query = join ' OR ', map "id=$_", map $_->id, @tickets;
 +    $query =~ s/ /%20/g;
 +    $m->get_ok( $url . "/Search/Bulk.html?Query=$query&Rows=10" );
 +
 +    $m->form_name('BulkUpdate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    foreach my $ticket ( @tickets ) {
 +        $m->goto_ticket( $ticket->id );
 +        $m->content_lacks('Download bpslogo.png', 'page has file name');
 +        $m->content_contains('Download favicon.png', 'page has file name');
 +    }
 +}
 +
 +diag "two attachments";
 +{
 +    my @tickets = RT::Test->create_tickets(
 +        {
 +            Queue   => $queue,
 +            Subject => 'Attachments test',
 +            Content => 'Some content',
 +        },
 +        {},
 +        {},
 +    );
 +    my $query = join ' OR ', map "id=$_", map $_->id, @tickets;
 +    $query =~ s/ /%20/g;
 +    $m->get_ok( $url . "/Search/Bulk.html?Query=$query&Rows=10" );
 +
 +    $m->form_name('BulkUpdate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('BulkUpdate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    foreach my $ticket ( @tickets ) {
 +        $m->goto_ticket( $ticket->id );
 +        $m->content_contains('Download bpslogo.png', 'page has file name');
 +        $m->content_contains('Download favicon.png', 'page has file name');
 +    }
 +}
 +
 +diag "one attachment, delete one along the way";
 +{
 +    my @tickets = RT::Test->create_tickets(
 +        {
 +            Queue   => $queue,
 +            Subject => 'Attachments test',
 +            Content => 'Some content',
 +        },
 +        {},
 +        {},
 +    );
 +    my $query = join ' OR ', map "id=$_", map $_->id, @tickets;
 +    $query =~ s/ /%20/g;
 +    $m->get_ok( $url . "/Search/Bulk.html?Query=$query&Rows=10" );
 +
 +    $m->form_name('BulkUpdate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('BulkUpdate');
 +    $m->tick('DeleteAttach',  LogoFile);
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    foreach my $ticket ( @tickets ) {
 +        $m->goto_ticket( $ticket->id );
 +        $m->content_lacks('Download bpslogo.png', 'page has file name');
 +        $m->content_contains('Download favicon.png', 'page has file name');
 +    }
 +}
 +
 +diag "self service";
 +diag "create with attachment";
 +{
 +    $m->get_ok( $url . "/SelfService/Create.html?Queue=". $queue->id );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('Content', 'Message');
 +    ok($m->current_form->find_input('AddMoreAttach'), "more than one attachment");
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "update with attachment";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m->get_ok( $url . "/SelfService/Update.html?id=". $ticket->id );
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    ok($m->current_form->find_input('AddMoreAttach'), "more than one attachment");
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +}
 +
 +diag "mobile ui";
 +
 +diag "simple create + reply";
 +{
 +    $m->get_ok( $url . '/m/ticket/create?Queue=' . $queue->id );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Attach',  LogoFile);
 +    $m->field('Content', 'Some content');
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Attachments test', 'we have subject on the page');
 +    $m->content_contains('bpslogo.png', 'page has file name');
 +
 +    $m->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketUpdate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('UpdateContent', 'Message');
 +    $m->click('SubmitTicket');
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('bpslogo.png', 'page has file name');
 +    $m->content_contains('favicon.png', 'page has file name');
 +}
 +
 +
 +diag "check content type and content";
 +{
 +    $m->goto_create_ticket( $queue );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  LogoFile);
 +    $m->click('AddMoreAttach');
 +    is($m->status, 200, "request successful");
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  TextFile);
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Content', 'Some content');
 +
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_contains('Attachments test', 'we have subject on the page');
 +    $m->content_contains('Some content', 'and content');
 +    $m->content_contains('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download print.css', 'page has file name');
 +
 +    $m->follow_link_ok({text => "Download bpslogo.png"});
 +    is($m->response->header('Content-Type'), 'image/png', 'Content-Type of png lacks charset' );
 +    is($m->content_type, "image/png");
 +    is($m->content, RT::Test->file_content(LogoFile), "Binary content matches");
 +    $m->back;
 +
 +    $m->follow_link_ok( { text => 'Download print.css' } );
 +    is( $m->response->header('Content-Type'),
 +        'text/css;charset=UTF-8',
 +        'Content-Type of text has charset',
 +    );
 +    is($m->content_type, "text/css");
 +    is($m->content, RT::Test->file_content(TextFile), "Text content matches");
 +}
 +
 +diag "concurent actions";
 +my $m2 = RT::Test::Web->new;
 +ok $m2->login, 'second login';
 +
 +diag "update and create";
 +{
 +    my $ticket = RT::Test->create_ticket(
 +        Queue   => $queue,
 +        Subject => 'Attachments test',
 +        Content => 'Some content',
 +    );
 +
 +    $m2->goto_ticket( $ticket->id );
 +    $m2->follow_link_ok({text => 'Reply'}, "reply to the ticket");
 +    $m2->form_name('TicketUpdate');
 +    $m2->field('Attach',  LogoFile);
 +    $m2->click('AddMoreAttach');
 +    is($m2->status, 200, "request successful");
 +
 +    $m->goto_create_ticket( $queue );
 +
 +    $m->form_name('TicketCreate');
 +    $m->field('Attach',  FaviconFile);
 +    $m->field('Subject', 'Attachments test');
 +    $m->field('Content', 'Some content');
 +    $m->submit;
 +    is($m->status, 200, "request successful");
 +
 +    $m->content_lacks('Download bpslogo.png', 'page has file name');
 +    $m->content_contains('Download favicon.png', 'page has file name');
 +
 +    $m2->form_name('TicketUpdate');
 +    $m2->click('SubmitTicket');
 +    $m2->content_contains('Download bpslogo.png', 'page has file name');
 +    $m2->content_lacks('Download favicon.png', 'page has no file name');
 +}
 +

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


More information about the Rt-commit mailing list