@@ -183,39 +183,48 @@ describe('AccountManager (OIDC account creation tests)', function () {
183183 } )
184184 } ) . timeout ( 20000 )
185185
186- it ( 'should create a private settings container' , function ( done ) {
187- var subdomain = supertest ( 'https://nicola.' + host )
188- subdomain . head ( '/settings/' )
189- . expect ( 401 )
190- . end ( function ( err ) {
191- done ( err )
192- } )
193- } )
186+ describe ( 'after setting up account' , ( ) => {
187+ beforeEach ( done => {
188+ var subdomain = supertest ( 'https://nicola.' + host )
189+ subdomain . post ( '/api/accounts/new' )
190+ . send ( 'username=nicola&password=12345&acceptToc=true' )
191+ . end ( done )
192+ } )
194193
195- it ( 'should create a private prefs file in the settings container' , function ( done ) {
196- var subdomain = supertest ( 'https://nicola.' + host )
197- subdomain . head ( '/inbox/prefs.ttl ' )
198- . expect ( 401 )
199- . end ( function ( err ) {
200- done ( err )
201- } )
202- } )
194+ it ( 'should create a private settings container' , function ( done ) {
195+ var subdomain = supertest ( 'https://nicola.' + host )
196+ subdomain . head ( '/settings/ ' )
197+ . expect ( 401 )
198+ . end ( function ( err ) {
199+ done ( err )
200+ } )
201+ } )
203202
204- it ( 'should create a private inbox container' , function ( done ) {
205- var subdomain = supertest ( 'https://nicola.' + host )
206- subdomain . head ( '/inbox/' )
207- . expect ( 401 )
208- . end ( function ( err ) {
209- done ( err )
210- } )
203+ it ( 'should create a private prefs file in the settings container' , function ( done ) {
204+ var subdomain = supertest ( 'https://nicola.' + host )
205+ subdomain . head ( '/inbox/prefs.ttl' )
206+ . expect ( 401 )
207+ . end ( function ( err ) {
208+ done ( err )
209+ } )
210+ } )
211+
212+ it ( 'should create a private inbox container' , function ( done ) {
213+ var subdomain = supertest ( 'https://nicola.' + host )
214+ subdomain . head ( '/inbox/' )
215+ . expect ( 401 )
216+ . end ( function ( err ) {
217+ done ( err )
218+ } )
219+ } )
211220 } )
212221 } )
213222} )
214223
215224describe ( 'Single User signup page' , ( ) => {
216225 const serverUri = 'https://localhost:7457'
217226 const port = 7457
218- var ldpHttpsServer
227+ let ldpHttpsServer
219228 const rootDir = path . join ( __dirname , '../resources/accounts/single-user/' )
220229 const configPath = path . join ( __dirname , '../resources/config' )
221230 const ldp = ldnode . createServer ( {
@@ -231,7 +240,9 @@ describe('Single User signup page', () => {
231240 const server = supertest ( serverUri )
232241
233242 before ( function ( done ) {
234- ldpHttpsServer = ldp . listen ( port , done )
243+ ldpHttpsServer = ldp . listen ( port , ( ) => server . post ( '/api/accounts/new' )
244+ . send ( 'username=foo&password=12345&acceptToc=true' )
245+ . end ( done ) )
235246 } )
236247
237248 after ( function ( ) {
0 commit comments