Skip to content

Commit 85ba11d

Browse files
committed
1 parent d401281 commit 85ba11d

1 file changed

Lines changed: 152 additions & 5 deletions

File tree

test/integration/install.js

Lines changed: 152 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,114 @@ describe('install', () => {
138138
});
139139
});
140140

141+
describe('new_gamify_corpus', () => {
142+
before(() => supertest(destination)
143+
.get('/_all_dbs')
144+
.set('Accept', 'application/json')
145+
.then((res) => {
146+
expect(res.body).includes('_users', JSON.stringify(res.body));
147+
}));
148+
149+
it('should replicate new_gamify_corpus', () => {
150+
const dbnameToReplicate = 'new_gamify_corpus';
151+
152+
return supertest(destination)
153+
.post('/_replicate')
154+
.set('Accept', 'application/json')
155+
.send({
156+
source: `${source}/${dbnameToReplicate}`,
157+
target: {
158+
url: `${destination}/${dbnameToReplicate}`,
159+
},
160+
create_target: true,
161+
})
162+
.then((res) => {
163+
debug('res.body new_gamify_corpus', res.body);
164+
expect(res.body.ok).to.equal(true);
165+
166+
return supertest(destination)
167+
.get('/_all_dbs')
168+
.set('Accept', 'application/json');
169+
})
170+
.then((res) => {
171+
debug('res.body new_gamify_corpus after', res.body);
172+
expect(res.body).includes(dbnameToReplicate);
173+
});
174+
});
175+
});
176+
177+
describe('new_learnx_corpus', () => {
178+
before(() => supertest(destination)
179+
.get('/_all_dbs')
180+
.set('Accept', 'application/json')
181+
.then((res) => {
182+
expect(res.body).includes('_users', JSON.stringify(res.body));
183+
}));
184+
185+
it('should replicate new_learnx_corpus', () => {
186+
const dbnameToReplicate = 'new_learnx_corpus';
187+
188+
return supertest(destination)
189+
.post('/_replicate')
190+
.set('Accept', 'application/json')
191+
.send({
192+
source: `${source}/${dbnameToReplicate}`,
193+
target: {
194+
url: `${destination}/${dbnameToReplicate}`,
195+
},
196+
create_target: true,
197+
})
198+
.then((res) => {
199+
debug('res.body new_learnx_corpus', res.body);
200+
expect(res.body.ok).to.equal(true);
201+
202+
return supertest(destination)
203+
.get('/_all_dbs')
204+
.set('Accept', 'application/json');
205+
})
206+
.then((res) => {
207+
debug('res.body new_learnx_corpus after', res.body);
208+
expect(res.body).includes(dbnameToReplicate);
209+
});
210+
});
211+
});
212+
213+
describe('new_wordcloud_corpus', () => {
214+
before(() => supertest(destination)
215+
.get('/_all_dbs')
216+
.set('Accept', 'application/json')
217+
.then((res) => {
218+
expect(res.body).includes('_users', JSON.stringify(res.body));
219+
}));
220+
221+
it('should replicate new_wordcloud_corpus', () => {
222+
const dbnameToReplicate = 'new_wordcloud_corpus';
223+
224+
return supertest(destination)
225+
.post('/_replicate')
226+
.set('Accept', 'application/json')
227+
.send({
228+
source: `${source}/${dbnameToReplicate}`,
229+
target: {
230+
url: `${destination}/${dbnameToReplicate}`,
231+
},
232+
create_target: true,
233+
})
234+
.then((res) => {
235+
debug('res.body new_wordcloud_corpus', res.body);
236+
expect(res.body.ok).to.equal(true);
237+
238+
return supertest(destination)
239+
.get('/_all_dbs')
240+
.set('Accept', 'application/json');
241+
})
242+
.then((res) => {
243+
debug('res.body new_wordcloud_corpus after', res.body);
244+
expect(res.body).includes(dbnameToReplicate);
245+
});
246+
});
247+
});
248+
141249
describe('new_testing_corpus', () => {
142250
before(() => supertest(destination)
143251
.get('/_all_dbs')
@@ -334,16 +442,16 @@ describe('install', () => {
334442
});
335443
});
336444

337-
describe('new_lexicon', () => {
445+
describe('new_export', () => {
338446
before(() => supertest(destination)
339447
.get('/_all_dbs')
340448
.set('Accept', 'application/json')
341449
.then((res) => {
342450
expect(res.body).includes('_users', JSON.stringify(res.body));
343451
}));
344452

345-
it('should replicate new_lexicon', () => {
346-
const dbnameToReplicate = 'new_lexicon';
453+
it('should replicate new_export', () => {
454+
const dbnameToReplicate = 'new_export';
347455

348456
return supertest(destination)
349457
.post('/_replicate')
@@ -356,17 +464,56 @@ describe('install', () => {
356464
create_target: true,
357465
})
358466
.then((res) => {
359-
debug('res.body new_lexicon', res.body);
467+
debug('res.body new_export', res.body);
360468
expect(res.body.ok).to.equal(true);
361469

362470
return supertest(destination)
363471
.get('/_all_dbs')
364472
.set('Accept', 'application/json');
365473
})
366474
.then((res) => {
367-
debug('res.body new_lexicon after ', res.body);
475+
debug('res.body new_export after ', res.body);
368476
expect(res.body).includes(dbnameToReplicate);
369477
});
370478
});
371479
});
480+
481+
describe('online prototype', () => {
482+
/**
483+
* note: unable to login and use the prototype because it is not using https in the docker container
484+
* and the app expects and requires https
485+
*/
486+
it('should replicate prototype', () => {
487+
const dbnameToReplicate = 'prototype';
488+
489+
return supertest(destination)
490+
.post('/_replicate')
491+
.set('Accept', 'application/json')
492+
.send({
493+
source: `${source}/${dbnameToReplicate}`,
494+
target: {
495+
url: `${destination}/${dbnameToReplicate}`,
496+
},
497+
create_target: true,
498+
})
499+
.then((res) => {
500+
expect(res.body.ok).to.equal(true);
501+
502+
return supertest(destination)
503+
.get(`/${dbnameToReplicate}/_design/prototype`)
504+
.set('Accept', 'application/json');
505+
})
506+
.then((res) => {
507+
debug('res.body prototype after ', res.body);
508+
expect(res.body.couchapp && res.body.couchapp.name).to.equal("LingSync Prototype (has the most features of the apps)", JSON.stringify(res.body));
509+
510+
return supertest(destination)
511+
.get(`/${dbnameToReplicate}/_design/prototype/user.html`)
512+
})
513+
.then((res) => {
514+
debug('res.body prototype after ', res.body);
515+
expect(res.status).to.equal(200);
516+
});
517+
});
518+
});
372519
});

0 commit comments

Comments
 (0)