[Rt-commit] [rtir] 01/01: Update tests for RT > 4.2.10 which skip PreCreate with just one Class

Alex Vandiver alexmv at bestpractical.com
Wed Mar 11 13:06:28 EDT 2015


This is an automated email from the git hooks/post-receive script.

alexmv pushed a commit to branch 3.2/rt-skips-precreate
in repository rtir.

commit 5d32bda1fbe91e8b6d81d5056d228940e2f42321
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Mar 11 13:04:44 2015 -0400

    Update tests for RT > 4.2.10 which skip PreCreate with just one Class
    
    Since bestpractical/rt at 094b91fb, the PreCreate page is skipped if there
    is only one class.  Update the RTIR tests to allow for this step being
    optional.
---
 t/articles/basics.t    | 8 ++++++--
 t/articles/on-create.t | 7 +++++--
 t/articles/on-update.t | 8 ++++++--
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/t/articles/basics.t b/t/articles/basics.t
index e4218b0..fd1e7fd 100644
--- a/t/articles/basics.t
+++ b/t/articles/basics.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 20;
+use RT::IR::Test tests => undef;
 
 RT::Test->started_ok;
 my $agent = default_agent();
@@ -19,7 +19,8 @@ $agent->back();
 
 $agent->follow_link_ok({text => "Create", url_regex => qr/Articles/, n => 1}, "followed new article link");
 
-$agent->follow_link_ok({text => "in class Templates"}, "chose a class");
+$agent->follow_link_ok({text => "in class Templates"}, "chose a class")
+    if $agent->uri =~ /PreCreate/;
 
 $agent->form_name("EditArticle");
 
@@ -36,3 +37,6 @@ $agent->display_ticket( $ir_id);
 
 $agent->follow_link_ok({text => $article_name}, "back to article");
 $agent->content_like( qr/this is a summary/, "found the summary of the article");
+
+undef $agent;
+done_testing;
diff --git a/t/articles/on-create.t b/t/articles/on-create.t
index 0c6ced0..4fcba86 100644
--- a/t/articles/on-create.t
+++ b/t/articles/on-create.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 53;
+use RT::IR::Test tests => undef;
 
 RT->Config->Set( ArticleOnTicketCreate => 1 );
 
@@ -18,7 +18,8 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
     $agent->get_ok('/', "followed 'Articles' overview link");
     $agent->follow_link_ok({text => "Articles"}, "followed 'Articles' overview link");
     $agent->follow_link_ok({text => "New Article" }, "followed new article link");
-    $agent->follow_link_ok({text => "in class Templates"}, "chose a class");
+    $agent->follow_link_ok({text => "in class Templates"}, "chose a class")
+        if $agent->uri =~ /PreCreate/;
 
     my $cf = RT::CustomField->new( RT->SystemUser );
     $cf->Load('Response');
@@ -68,3 +69,5 @@ foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
     like( $agent->field( $content_name ), qr/this is a content/ );
 }
 
+undef $agent;
+done_testing;
diff --git a/t/articles/on-update.t b/t/articles/on-update.t
index aab452e..d5917b6 100644
--- a/t/articles/on-update.t
+++ b/t/articles/on-update.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 69;
+use RT::IR::Test tests => undef;
 
 RT::Test->started_ok;
 my $agent = default_agent();
@@ -16,7 +16,8 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
     $agent->get_ok('/', "followed 'Articles' overview link");
     $agent->follow_link_ok({text => "Articles"}, "followed 'Articles' overview link");
     $agent->follow_link_ok({text => "New Article" }, "followed new article link");
-    $agent->follow_link_ok({text => "in class Templates"}, "chose a class");
+    $agent->follow_link_ok({text => "in class Templates"}, "chose a class")
+        if $agent->uri =~ /PreCreate/;
 
     my $cf = RT::CustomField->new( RT->SystemUser );
     $cf->Load('Response');
@@ -73,3 +74,6 @@ foreach my $queue ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks'
     $agent->form_name('TicketUpdate');
     like( $agent->field('UpdateContent'), qr/this is a content/ );
 }
+
+undef $agent;
+done_testing;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list