Remove default endpoint from config file
Change-Id: I1bc5ac2b0972d149e217898d28111bf5c7a7e89d
diff --git a/t/api.t b/t/api.t
new file mode 100644
index 0000000..5570d0d
--- /dev/null
+++ b/t/api.t
@@ -0,0 +1,32 @@
+use Mojo::Base -strict;
+use Test::More;
+use Test::Mojo;
+
+our %ENV;
+
+my $app = Test::Mojo->new('Kalamar')->app;
+is($app->korap->api, 'https://korap.ids-mannheim.de/api/v1.0/');
+
+
+$ENV{KALAMAR_API} = 'https://example.com/';
+$app = Test::Mojo->new('Kalamar')->app;
+is($app->korap->api, 'https://example.com/v1.0/');
+
+$app = Test::Mojo->new('Kalamar' => {
+ Kalamar => {
+ api_path => 'https://example.org/'
+ }
+})->app;
+is($app->korap->api, 'https://example.org/v1.0/');
+
+$ENV{KALAMAR_API} = undef;
+$app = Test::Mojo->new('Kalamar' => {
+ Kalamar => {
+ api_version => '1.1'
+ }
+})->app;
+is($app->korap->api, 'https://korap.ids-mannheim.de/api/v1.1/');
+
+
+done_testing;
+__END__