You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					19 lines
				
				499 B
			
		
		
			
		
	
	
					19 lines
				
				499 B
			| 
											3 years ago
										 | import Resource from '../../src/resource' | ||
|  | import { Article } from '../utils/models' | ||
|  | 
 | ||
|  | describe('Resource #update', () => { | ||
|  |   it('changes record and returns updated', async () => { | ||
|  |     const resource = new Resource(Article) | ||
|  |     const initialRecord = await resource.create({ | ||
|  |       content: 'Test content', | ||
|  |     }) | ||
|  | 
 | ||
|  |     const updatedRecord = await resource.update( | ||
|  |       initialRecord._id, | ||
|  |       { content: 'Updated content' }, | ||
|  |     ) | ||
|  | 
 | ||
|  |     expect(updatedRecord.content).toEqual('Updated content') | ||
|  |   }) | ||
|  | }) |