From 2feecd20ee09ac2091ef8b31c1ee3e7632e49f6b Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Tue, 21 Jul 2015 12:16:17 +0200 Subject: [PATCH] referrer-tracking.t skips test without HTTPS As oddmuse.org now uses HTTPS, this test requires LWP::Protocol::https to be installed. --- t/referrer-tracking.t | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/t/referrer-tracking.t b/t/referrer-tracking.t index 7bedd903..6c3b878b 100644 --- a/t/referrer-tracking.t +++ b/t/referrer-tracking.t @@ -30,16 +30,23 @@ SKIP: { my $wiki = 'http://localhost/cgi-bin/wiki.pl'; my $ua = LWP::UserAgent->new; my $response = $ua->get("$wiki?action=version"); + skip("No wiki running at $wiki", 12) unless $response->is_success; + # check that the wiki is capable of running these tests skip("Wiki running at $wiki doesn't have the Referrer-Tracking Extension installed", 12) unless $response->content =~ /referrer-tracking\.pl/; + # if we're running in some random environment where localhost is not # a wiki for us to interact with skip("Wiki running at $wiki has the Question Asker Extension installed", 12) if $response->content =~ /questionasker\.pl/; + # if HTTPS is not supported + skip("No HTTPS support available: $@", 12) + unless eval { require LWP::Protocol::https; }; + my $id = 'Random' . time; # make sure we're not being fooled by 404 errors $response = $ua->get("$wiki?title=$id;text=test"); @@ -59,8 +66,8 @@ SKIP: { qq{//div[\@class="content refer"]/div/p/a[text()="$id"]}); # This page must actually exist and link back! - $response = $ua->get('http://oddmuse.org/test.html'); - ok($response->is_success, "http://oddmuse.org/test.html exists"); + $response = $ua->get('https://oddmuse.org/test.html'); + ok($response->is_success, "https://oddmuse.org/test.html exists"); test_page($response->content, "http://localhost/cgi-bin/wiki.pl"); # If it is lost, here's what it should contain: