Procházet zdrojové kódy

fix unit tests I broke by adding timeout to tags

Henry Oswald před 12 roky
rodič
revize
39b9c99735

+ 4 - 4
services/web/test/UnitTests/coffee/Tags/TagsHandlerTests.coffee

@@ -6,7 +6,7 @@ modulePath = require('path').join __dirname, '../../../../app/js/Features/Tags/T
 _ = require('underscore')
 _ = require('underscore')
 
 
 
 
-describe 'Tags handler', ->
+describe 'TagsHandler', ->
 	user_id = "123nd3ijdks"
 	user_id = "123nd3ijdks"
 	project_id = "123njdskj9jlk"
 	project_id = "123njdskj9jlk"
 	tagsUrl = "tags.sharelatex.testing"
 	tagsUrl = "tags.sharelatex.testing"
@@ -26,17 +26,17 @@ describe 'Tags handler', ->
 
 
 	it 'Should post the request to the tags api with the user id in the url', (done)->
 	it 'Should post the request to the tags api with the user id in the url', (done)->
 		@handler.addTag user_id, project_id, tag, =>
 		@handler.addTag user_id, project_id, tag, =>
-			@request.post.calledWith({uri:"#{tagsUrl}/user/#{user_id}/project/#{project_id}/tag", json:{name:tag}}).should.equal true
+			@request.post.calledWith({uri:"#{tagsUrl}/user/#{user_id}/project/#{project_id}/tag", timeout:1000, json:{name:tag}}).should.equal true
 			done()
 			done()
 
 
 	it 'should send a delete request when a delete has been recived with the body format standardised', (done)->
 	it 'should send a delete request when a delete has been recived with the body format standardised', (done)->
 		@handler.deleteTag user_id, project_id, tag, =>
 		@handler.deleteTag user_id, project_id, tag, =>
-			@request.del.calledWith({uri:"#{tagsUrl}/user/#{user_id}/project/#{project_id}/tag", json:{name:tag}}).should.equal true
+			@request.del.calledWith({uri:"#{tagsUrl}/user/#{user_id}/project/#{project_id}/tag", timeout:1000,  json:{name:tag}}).should.equal true
 			done()
 			done()
 
 
 	it 'should tell the tags api to remove the project_id from all the users tags', (done)->
 	it 'should tell the tags api to remove the project_id from all the users tags', (done)->
 		@handler.removeProjectFromAllTags user_id, project_id, =>
 		@handler.removeProjectFromAllTags user_id, project_id, =>
-			@request.del.calledWith({uri:"#{tagsUrl}/user/#{user_id}/project/#{project_id}"}).should.equal true
+			@request.del.calledWith({uri:"#{tagsUrl}/user/#{user_id}/project/#{project_id}", timeout:1000}).should.equal true
 			done()
 			done()
 
 
 	describe "groupTagsByProject", ->
 	describe "groupTagsByProject", ->