From d6447ef3112180d38567a164d0f3ee0010cb30f7 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 13 Jul 2015 16:36:41 +0200 Subject: [PATCH] Fix tests related to surrogate keys, includes tables --- test/acceptance/templates.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/acceptance/templates.js b/test/acceptance/templates.js index 79f24ac5..e0ba8bc7 100644 --- a/test/acceptance/templates.js +++ b/test/acceptance/templates.js @@ -3,7 +3,8 @@ var _ = require('underscore'); var redis = require('redis'); var step = require('step'); var strftime = require('strftime'); -var NamedMapsCacheEntry = require(__dirname + '/../../lib/cartodb/cache/model/named_maps_entry'); +var NamedMapsCacheEntry = require('../../lib/cartodb/cache/model/named_maps_entry'); +var TablesCacheEntry = require('../../lib/cartodb/cache/model/database_tables_entry'); var redis_stats_db = 5; // Pollute the PG environment to make sure @@ -1543,7 +1544,11 @@ describe('template_api', function() { assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); // See https://github.com/CartoDB/Windshaft-cartodb/issues/176 helper.checkCache(res); - helper.checkSurrogateKey(res, new NamedMapsCacheEntry('localhost', template_acceptance_open.name).key()); + var expectedSurrogateKey = [ + new TablesCacheEntry('test_windshaft_cartodb_user_1_db', ['public.test_table_private_1']).key(), + new NamedMapsCacheEntry('localhost', template_acceptance_open.name).key() + ].join(' '); + helper.checkSurrogateKey(res, expectedSurrogateKey); return null; }, function finish(err) { @@ -1612,7 +1617,11 @@ describe('template_api', function() { assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); // See https://github.com/CartoDB/Windshaft-cartodb/issues/176 helper.checkCache(res); - helper.checkSurrogateKey(res, new NamedMapsCacheEntry('localhost', template_acceptance_open.name).key()); + var expectedSurrogateKey = [ + new TablesCacheEntry('test_windshaft_cartodb_user_1_db', ['public.test_table_private_1']).key(), + new NamedMapsCacheEntry('localhost', template_acceptance_open.name).key() + ].join(' '); + helper.checkSurrogateKey(res, expectedSurrogateKey); return null; }, function finish(err) {