Support API version 1.1 in paths
Change-Id: Ibf951092318a71cb9f9d63ac6d21a92fd7ac36f5
diff --git a/t/fixtures.t b/t/fixtures.t
index c3fbfdc..9816fe6 100644
--- a/t/fixtures.t
+++ b/t/fixtures.t
@@ -10,7 +10,7 @@
$t->get_ok('/v1.0')
->status_is(200)
- ->content_is('Fake server available');
+ ->content_is('Fake server available: 1.0');
$t->get_ok('/v1.0/search?ql=cosmas3')
->status_is(400)
diff --git a/t/plugin/auth-oauth.t b/t/plugin/auth-oauth.t
index f1349a6..04fcc3c 100644
--- a/t/plugin/auth-oauth.t
+++ b/t/plugin/auth-oauth.t
@@ -101,7 +101,7 @@
$t->get_ok('/realapi/v1.0')
->status_is(200)
- ->content_is('Fake server available');
+ ->content_is('Fake server available: 1.0');
$t->get_ok('/?q=Baum')
->status_is(200)
diff --git a/t/plugin/query_reference.t b/t/plugin/query_reference.t
index 56053c7..d54891a 100644
--- a/t/plugin/query_reference.t
+++ b/t/plugin/query_reference.t
@@ -96,7 +96,7 @@
$t->get_ok('/realapi/v1.0')
->status_is(200)
- ->content_is('Fake server available')
+ ->content_is('Fake server available: 1.0')
;
# Login
diff --git a/t/proxy.t b/t/proxy.t
index 5d5280a..3c7e4ea 100644
--- a/t/proxy.t
+++ b/t/proxy.t
@@ -56,9 +56,15 @@
$t->get_ok('/realapi/v1.0')
->status_is(200)
- ->content_is('Fake server available')
+ ->content_is('Fake server available: 1.0')
;
+$t->get_ok('/realapi/v1.1')
+ ->status_is(200)
+ ->content_is('Fake server available: 1.1')
+ ;
+
+
is($rendered, 1);
$t->get_ok('/api/v1.0/')
@@ -68,7 +74,7 @@
->header_is('Connection', 'close')
->header_is('Access-Control-Allow-Origin', '*')
->header_is('Access-Control-Allow-Methods', 'GET, OPTIONS')
- ->content_is('Fake server available')
+ ->content_is('Fake server available: 1.0')
;
# Proxy renders
diff --git a/t/server/mock.pl b/t/server/mock.pl
index 1af2fb0..0aa8a9b 100644
--- a/t/server/mock.pl
+++ b/t/server/mock.pl
@@ -111,11 +111,11 @@
app->defaults('oauth.pluginin_list' => []);
# Base page
-get '/v1.0/' => sub {
- shift->render(text => 'Fake server available');
+get '/v#apiv' => [apiv => ['1.0','1.1']] => sub {
+ my $c = shift;
+ $c->render(text => 'Fake server available: ' . $c->stash('apiv'));
};
-
get '/v1.0/redirect-target-a' => sub {
shift->render(text => 'Redirect Target!');
} => 'redirect-target';