Mocks API Version 1.0 and 1.1
Change-Id: Ic125455e6690343f296c82a2373a9a7f8c5ce86d
diff --git a/t/plugin/auth-oauth.t b/t/plugin/auth-oauth.t
index f83bd2a..659fe5d 100644
--- a/t/plugin/auth-oauth.t
+++ b/t/plugin/auth-oauth.t
@@ -11,6 +11,11 @@
my $mount_point = '/realapi/';
$ENV{KALAMAR_API} = $mount_point;
+# Get the fixture path
+my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, '..', 'server');
+
+my $q = qr!(?:\"|")!;
+
my $t = Test::Mojo::WithRoles->new('Kalamar' => {
Kalamar => {
plugins => ['Auth']
@@ -23,9 +28,9 @@
}
});
+my $api_version = $t->app->config('Kalamar')->{api_version};
+
# Mount fake backend
-# Get the fixture path
-my $fixtures_path = path(Mojo::File->new(__FILE__)->dirname, '..', 'server');
my $fake_backend = $t->app->plugin(
Mount => {
$mount_point =>
@@ -97,11 +102,9 @@
}
);
-my $q = qr!(?:\"|")!;
-
-$t->get_ok('/realapi/v1.0')
+$t->get_ok("/realapi/v$api_version")
->status_is(200)
- ->content_is('Fake server available: 1.0');
+ ->content_is("Fake server available: $api_version");
$t->get_ok('/?q=Baum')
->status_is(200)