[Rt-commit] r4987 - in rtir/branches/1.9-EXPERIMENTAL: t

ruz at bestpractical.com ruz at bestpractical.com
Wed Apr 5 13:47:29 EDT 2006


Author: ruz
Date: Wed Apr  5 13:47:28 2006
New Revision: 4987

Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/t/006-saved-searches.t

Log:
 r1261 at cubic-pc:  cubic | 2006-04-05 21:37:38 +0400
 * update saved searches tests


Modified: rtir/branches/1.9-EXPERIMENTAL/t/006-saved-searches.t
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/006-saved-searches.t	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/006-saved-searches.t	Wed Apr  5 13:47:28 2006
@@ -25,9 +25,10 @@
 my $search1 = "saved".rand();
 $agent->field(SavedSearchDescription => $search1);
 $agent->click("SavedSearchSave");
-ok_and_content_like($agent, 
-                    qr{<option value="">My saved searches</option>.*<option value="RT::User[^"]+"> -$search1</option>}s,
-                    "saved my search");
+
+$agent->form_name("BuildQuery");
+is($agent->value('SavedSearchDescription'), $search1, "name is correct");
+ok_and_content_like($agent, qr{Privacy:\s*My saved searches}s, "privacy is fixed");
 
 # add some other random clause in order to change the search, so we can save it again
 
@@ -36,28 +37,28 @@
 $agent->click("AddClause");
 ok_and_content_like($agent, qr/AND id &lt; &#39;200/, "added another clause");
 
-# figure out how to change the privacy popup. (can't use like, since that ends up clobbering $1)
-$agent->content =~ qr{<select name="SavedSearchOwner">\s*<option value="RT::User-\d+">My saved searches</option>\s*<option value="RT::Group-(\d+)">DutyTeam's saved searches</option>}s;
-my $DT_id = $1;
+$agent->form_name("BuildQuery");
+is($agent->value('SavedSearchDescription'), $search1, "name is correct");
+ok_and_content_like($agent, qr{Privacy:\s*My saved searches}s, "privacy is fixed");
 
-ok($DT_id > 0, "found dutyteam ID");
+# copy query
+$agent->form_name("BuildQuery");
+$agent->click("SavedSearchCopy");
 
 $agent->form_name("BuildQuery");
+is($agent->field('SavedSearchDescription'), "$search1 copy", "copied search");
+
+# figure out how to change the privacy popup. (can't use like, since that ends up clobbering $1)
+$agent->content =~ qr{<option value="RT::User-\d+">My saved searches</option>\s*<option value="RT::Group-(\d+)">DutyTeam's saved searches</option>}s;
+my $DT_id = $1;
+ok($DT_id, "found dutyteam ID");
+
 $agent->select(SavedSearchOwner => "RT::Group-$DT_id");
 my $search2 = "saved".rand();
 $agent->field(SavedSearchDescription => $search2);
 $agent->click("SavedSearchSave");
-
-# Note: this currently FAILS!  Probably an RT bug.  Basically, the
-# issue is that if you save a search, it changes the UI to the
-# delete/copy/save thing instead of just save, and gets rid of the
-# privacy popup... however, if you then add a clause or whatever, it
-# goes into a funky UI which has delete/copy/save but also a somewhat
-# ignored popup... I think the bug might be that there's a popup at
-# all. Anyway, really weird an needs fixing
-
 ok_and_content_like($agent, 
-                    qr{<option value="">DutyTeam's saved searches</option>.*<option value="RT::User[^"]+"> -$search2</option>}s,
+                    qr{<option value="">DutyTeam's saved searches</option>.*<option value="RT::Group[^"]+"> -$search2</option>}s,
                     "saved DT search");
 
 


More information about the Rt-commit mailing list