// @flow
import { expect } from 'chai';
import sinon from 'sinon';
import { spies } from '@test';
import { nameValidator } from './beat.js';

describe('nameValidator', () => {
	describe('database names', () => {
		let be = 'database';
		let otherNames = [];
		it('should not accept names with a "-" character', () => {
			expect(nameValidator(be, otherNames)('replay-me/1')).to.equal(false);
		});
		it('should accept names with a "_" character', () => {
			expect(nameValidator(be, otherNames)('replay_me/1')).to.equal(true);
		});
		it('should accept names with only ascii characters', () => {
			expect(nameValidator(be, otherNames)('replayme/1')).to.equal(true);
		});
	});
});
