Use describe instead of suite

This commit is contained in:
Raul Ochoa 2015-09-25 13:31:51 +02:00
parent 5e1bc3e199
commit b368463670
2 changed files with 10 additions and 10 deletions

View File

@ -4,25 +4,25 @@ var assert = require('assert');
var _ = require('underscore');
var NamedMapsCacheEntry = require('../../../../../lib/cartodb/cache/model/named_maps_entry');
suite('cache named_maps_entry', function() {
describe('cache named_maps_entry', function() {
var namedMapOwner = 'foo',
namedMapName = 'wadus_name',
namedMapsCacheEntry = new NamedMapsCacheEntry(namedMapOwner, namedMapName),
entryKey = namedMapsCacheEntry.key();
test('key is a string', function() {
it('key is a string', function() {
assert.ok(_.isString(entryKey));
});
test('key is 8 chars length', function() {
it('key is 8 chars length', function() {
assert.equal(entryKey.length, 8);
var entryKeyParts = entryKey.split(':');
assert.equal(entryKeyParts.length, 2);
assert.equal(entryKeyParts[0], 'n');
});
test('key is name spaced for named maps', function() {
it('key is name spaced for named maps', function() {
var entryKeyParts = entryKey.split(':');
assert.equal(entryKeyParts.length, 2);
assert.equal(entryKeyParts[0], 'n');

View File

@ -11,7 +11,7 @@ var TemplateMaps = require('../../../lib/cartodb/backends/template_maps');
var BaseController = require('../../../lib/cartodb/controllers/base');
var windshaft = require('windshaft');
suite('req2params', function() {
describe('req2params', function() {
var test_user = _.template(global.environment.postgres_auth_user, {user_id:1});
var test_pubuser = global.environment.postgres.user;
@ -31,7 +31,7 @@ suite('req2params', function() {
});
test('can be found in server_options', function(){
it('can be found in server_options', function(){
assert.ok(_.isFunction(baseController.req2params));
});
@ -43,7 +43,7 @@ suite('req2params', function() {
return req;
}
test('cleans up request', function(done){
it('cleans up request', function(done){
var req = {headers: { host:'localhost' }, query: {dbuser:'hacker',dbname:'secret'}};
baseController.req2params(prepareRequest(req), function(err, req) {
if ( err ) { done(err); return; }
@ -57,7 +57,7 @@ suite('req2params', function() {
});
});
test('sets dbname from redis metadata', function(done){
it('sets dbname from redis metadata', function(done){
var req = {headers: { host:'localhost' }, query: {} };
baseController.req2params(prepareRequest(req), function(err, req) {
if ( err ) { done(err); return; }
@ -71,7 +71,7 @@ suite('req2params', function() {
});
});
test('sets also dbuser for authenticated requests', function(done){
it('sets also dbuser for authenticated requests', function(done){
var req = {headers: { host:'localhost' }, query: {map_key: '1234'} };
baseController.req2params(prepareRequest(req), function(err, req) {
if ( err ) { done(err); return; }
@ -98,7 +98,7 @@ suite('req2params', function() {
});
});
test('it should extend params with decoded lzma', function(done) {
it('it should extend params with decoded lzma', function(done) {
var qo = {
config: {
version: '1.3.0'