mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	#33 Added unit test for createdBy
This commit is contained in:
		
							parent
							
								
									e146dd9e81
								
							
						
					
					
						commit
						529ff2aeea
					
				@ -36,6 +36,22 @@ describe('The features api', function () {
 | 
			
		||||
            .expect(201, done);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    it('creates new feature toggle with createdBy', function (done) {
 | 
			
		||||
        request
 | 
			
		||||
            .post('/features')
 | 
			
		||||
            .send({name: 'com.test.Username', enabled: false})
 | 
			
		||||
            .set('Cookie', ['username=ivaosthu'])
 | 
			
		||||
            .set('Content-Type', 'application/json')
 | 
			
		||||
            .end(function(){
 | 
			
		||||
              request
 | 
			
		||||
                  .get('/events')
 | 
			
		||||
                  .end(function (err, res) {
 | 
			
		||||
                      assert.equal(res.body.events[0].createdBy, 'ivaosthu');
 | 
			
		||||
                      done();
 | 
			
		||||
                  });
 | 
			
		||||
            });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    it('require new feature toggle to have a name', function (done) {
 | 
			
		||||
        request
 | 
			
		||||
            .post('/features')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user