feat(analytics): AB testing

User model update for AB tests, and the first AB test to start Sept 12

closes #7984
This commit is contained in:
Sabe Jones
2016-09-08 19:54:27 +00:00
committed by Blade Barringer
parent 6f2767edd3
commit f20a7b851f
225 changed files with 606 additions and 614 deletions

View File

@@ -3,6 +3,7 @@ import {
requester,
translate as t,
createAndPopulateGroup,
getProperty,
} from '../../../../../helpers/api-integration/v3';
import { v4 as generateRandomUserName } from 'uuid';
import { each } from 'lodash';
@@ -52,6 +53,21 @@ describe('POST /user/auth/local/register', () => {
expect(user.tasksOrder.habits).to.have.a.lengthOf(0);
});
it('enrolls new users in an A/B test', async () => {
let username = generateRandomUserName();
let email = `${username}@example.com`;
let password = 'password';
let user = await api.post('/user/auth/local/register', {
username,
email,
password,
confirmPassword: password,
});
await expect(getProperty('users', user._id, '_ABtest')).to.eventually.be.a('string');
});
it('requires password and confirmPassword to match', async () => {
let username = generateRandomUserName();
let email = `${username}@example.com`;