Merge branch 'master' of github.com:sharelatex/web-sharelatex
This commit is contained in:
@@ -61,7 +61,7 @@ describe 'Project deleter', ->
|
||||
|
||||
describe "deleteProject", ->
|
||||
beforeEach ->
|
||||
@Project.remove.callsArgWith(1)
|
||||
@Project.update.callsArgWith(2)
|
||||
|
||||
it "should flushProjectToMongoAndDelete in doc updater", (done)->
|
||||
@deleter.deleteProject @project_id, =>
|
||||
@@ -70,7 +70,11 @@ describe 'Project deleter', ->
|
||||
|
||||
it "should remove the project", (done)->
|
||||
@deleter.deleteProject @project_id, =>
|
||||
@Project.remove.calledWith(_id:@project_id).should.equal true
|
||||
@Project.update.calledWith({
|
||||
_id:@project_id
|
||||
}, {
|
||||
$set: { archived: true }
|
||||
}).should.equal true
|
||||
done()
|
||||
|
||||
it "should removeProjectFromAllTags", (done)->
|
||||
|
||||
@@ -6,7 +6,7 @@ modulePath = require('path').join __dirname, '../../../../app/js/Features/Tags/T
|
||||
_ = require('underscore')
|
||||
|
||||
|
||||
describe 'Tags handler', ->
|
||||
describe 'TagsHandler', ->
|
||||
user_id = "123nd3ijdks"
|
||||
project_id = "123njdskj9jlk"
|
||||
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)->
|
||||
@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()
|
||||
|
||||
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, =>
|
||||
@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()
|
||||
|
||||
it 'should tell the tags api to remove the project_id from all the users tags', (done)->
|
||||
@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()
|
||||
|
||||
describe "groupTagsByProject", ->
|
||||
|
||||
Reference in New Issue
Block a user