[Rt-commit] [rtir] 03/03: Add tests for the Lookup.html page

Jim Brandt jbrandt at bestpractical.com
Fri May 9 13:53:26 EDT 2014


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

jbrandt pushed a commit to branch 3.2/makeclicky-on-lookup
in repository rtir.

commit 36fe93b31356ae615b8b30e55a23c4e5c1af2ee3
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri May 9 11:44:20 2014 -0400

    Add tests for the Lookup.html page
---
 t/tools/lookup.t | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/t/tools/lookup.t b/t/tools/lookup.t
new file mode 100644
index 0000000..900dfa7
--- /dev/null
+++ b/t/tools/lookup.t
@@ -0,0 +1,59 @@
+use strict;
+use warnings;
+
+use RT::IR::Test tests => undef;
+use Test::Warn;
+
+RT::Test->started_ok;
+my $agent = default_agent();
+
+# The whois lookup requires an internet connection. Skip those tests if
+# there is no network.
+$agent->get("http://bestpractical.com");
+my $no_network;
+unless ($agent->status == 200){
+    $no_network = 1;
+    diag "No network connection. Skipping whois tests";
+}
+
+diag "Test Lookup page directly";
+{
+    $agent->get_ok("/RTIR/Tools/Lookup.html", "Loaded Lookup page");
+
+SKIP:{
+    skip "No network", 2 if $no_network;
+    $agent->form_name('ToolFormWhois');
+    $agent->field('q', 'mit.edu');
+    $agent->select('WhoisServer', 'IANA');
+    $agent->click;
+    $agent->content_contains('WHOIS Results');
+    $agent->content_contains('IANA WHOIS server');
+}
+}
+
+diag "Test Lookup page in context of ticket";
+{
+    my $ir1 = $agent->create_ir(
+    {Subject => 'First IR for testing whois lookup'},
+    {IP => '172.16.0.1'}, );
+    $agent->display_ticket( $ir1);
+    $agent->follow_link_ok({text => '172.16.0.1'}, "Followed IP link");
+
+    my $ir2 = $agent->create_ir(
+    {Subject => 'Another IR for testing whois lookup'},
+    {IP => '172.16.0.1'}, );
+    $agent->display_ticket( $ir2);
+    $agent->follow_link_ok({text => '172.16.0.1'}, "Followed IP link");
+    $agent->content_contains('First IR for testing whois lookup');
+
+SKIP:{
+    skip "No network", 2 if $no_network;
+    $agent->form_name('ToolFormWhois');
+    $agent->click;
+    $agent->content_contains('WHOIS Results');
+    $agent->content_contains('Domain names in the .com and .net domains');
+}
+}
+
+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