From cf8ae7c28c304715068040ee5f31399be59cdf69 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 11 Sep 2018 16:45:39 +0100 Subject: [PATCH] Add test for redirecting to v1 if project unimported --- .../web/test/acceptance/coffee/TokenAccessTests.coffee | 7 +++++++ services/web/test/acceptance/config/settings.test.coffee | 3 +++ 2 files changed, 10 insertions(+) diff --git a/services/web/test/acceptance/coffee/TokenAccessTests.coffee b/services/web/test/acceptance/coffee/TokenAccessTests.coffee index 0e2985f75a..d54f19d0eb 100644 --- a/services/web/test/acceptance/coffee/TokenAccessTests.coffee +++ b/services/web/test/acceptance/coffee/TokenAccessTests.coffee @@ -415,3 +415,10 @@ describe 'TokenAccess', -> try_content_access(@other2, @project_id, (response, body) => expect(body.privilegeLevel).to.equal false , done) + + describe 'unimported v1 project', -> + it 'should redirect to v1', (done) -> + unimportedV1Token = '123abc' + try_read_and_write_token_access(@owner, unimportedV1Token, (response, body) => + expect(response.statusCode).to.equal 302 + , done) diff --git a/services/web/test/acceptance/config/settings.test.coffee b/services/web/test/acceptance/config/settings.test.coffee index 4dd820f4a7..4d1fcabe34 100644 --- a/services/web/test/acceptance/config/settings.test.coffee +++ b/services/web/test/acceptance/config/settings.test.coffee @@ -105,3 +105,6 @@ module.exports = path: (params) -> "/universities/list/#{params.id}" '/institutions/domains': { baseUrl: v1Api.url, path: '/university/domains' } '/proxy/missing/baseUrl': path: '/foo/bar' + + overleaf: + host: "http://#{process.env['V1_HOST']}:5000"