[Bps-public-commit] rt-extension-rest2 branch, dev, updated. bb549d006e8fca3323a519879aec40411c92addf
Wallace Reis
wreis at bestpractical.com
Wed Feb 11 11:48:42 EST 2015
The branch, dev has been updated
via bb549d006e8fca3323a519879aec40411c92addf (commit)
from c9a53e942ff3641b6b6127a25e55e283bf4d177a (commit)
Summary of changes:
t/acceptance/main.t | 12 ++++++++++++
t/lib/RT/Extension/REST2/Test.pm | 16 ++++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 t/acceptance/main.t
create mode 100644 t/lib/RT/Extension/REST2/Test.pm
- Log -----------------------------------------------------------------
commit bb549d006e8fca3323a519879aec40411c92addf
Author: Wallace Reis <wreis at bestpractical.com>
Date: Tue Sep 16 18:12:16 2014 -0300
Tests baseline
diff --git a/t/acceptance/main.t b/t/acceptance/main.t
new file mode 100644
index 0000000..29c92f8
--- /dev/null
+++ b/t/acceptance/main.t
@@ -0,0 +1,12 @@
+use strict;
+use warnings;
+use lib 't/lib';
+use RT::Extension::REST2::Test tests => undef;
+
+my $mech = RT::Extension::REST2::Test->mech;
+ok(my $res = $mech->get('/'));
+is($res->code, 401, 'Unauthorized');
+is($res->content, 'Authorization required');
+like($res->header('www-authenticate'), qr/example\.com\s+API/);
+
+done_testing;
diff --git a/t/lib/RT/Extension/REST2/Test.pm b/t/lib/RT/Extension/REST2/Test.pm
new file mode 100644
index 0000000..fe97952
--- /dev/null
+++ b/t/lib/RT/Extension/REST2/Test.pm
@@ -0,0 +1,16 @@
+package RT::Extension::REST2::Test;
+
+use strict;
+use warnings;
+use base 'RT::Test';
+
+use RT::Extension::REST2;
+use Test::WWW::Mechanize::PSGI;
+
+sub mech {
+ my $mech = Test::WWW::Mechanize::PSGI->new(
+ app => RT::Extension::REST2->to_app,
+ );
+}
+
+1;
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list