|
@@ -1035,54 +1035,108 @@ describe('CollaboratorsInviteController', function () {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('when the getInviteByToken does not produce an invite', function () {
|
|
describe('when the getInviteByToken does not produce an invite', function () {
|
|
|
- beforeEach(async function (ctx) {
|
|
|
|
|
- await new Promise(resolve => {
|
|
|
|
|
- ctx.CollaboratorsInviteGetter.promises.getInviteByToken.resolves(null)
|
|
|
|
|
- ctx.res.callback = () => resolve()
|
|
|
|
|
- ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
- ctx.req,
|
|
|
|
|
- ctx.res,
|
|
|
|
|
- ctx.next
|
|
|
|
|
|
|
+ describe('when the sharing-updates variant is "enabled"', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ ctx.SplitTestHandler.promises.getAssignment.resolves({
|
|
|
|
|
+ variant: 'enabled',
|
|
|
|
|
+ })
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.CollaboratorsInviteGetter.promises.getInviteByToken.resolves(
|
|
|
|
|
+ null
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should render the not-valid view template', function (ctx) {
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
+ 'project/invite/not-valid',
|
|
|
|
|
+ expect.anything()
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
- it('should render the not-valid view template', function (ctx) {
|
|
|
|
|
- expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
- expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
- 'project/invite/not-valid',
|
|
|
|
|
- expect.anything()
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ it('should not call next', function (ctx) {
|
|
|
|
|
+ ctx.next.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should not call next', function (ctx) {
|
|
|
|
|
- ctx.next.callCount.should.equal(0)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ describe('when the sharing-updates variant is "default"', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ ctx.SplitTestHandler.promises.getAssignment.resolves({
|
|
|
|
|
+ variant: 'default',
|
|
|
|
|
+ })
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.CollaboratorsInviteGetter.promises.getInviteByToken.resolves(
|
|
|
|
|
+ null
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call CollaboratorsGetter.isUserInvitedMemberOfProject', function (ctx) {
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject.callCount.should.equal(
|
|
|
|
|
- 1
|
|
|
|
|
- )
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
- .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
- .should.equal(true)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ it('should render the not-valid-legacy view template', function (ctx) {
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
+ 'project/invite/not-valid-legacy',
|
|
|
|
|
+ expect.anything()
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call getInviteByToken', function (ctx) {
|
|
|
|
|
- ctx.CollaboratorsInviteGetter.promises.getInviteByToken.callCount.should.equal(
|
|
|
|
|
- 1
|
|
|
|
|
- )
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
- .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
- .should.equal(true)
|
|
|
|
|
|
|
+ it('should not call next', function (ctx) {
|
|
|
|
|
+ ctx.next.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should not call User.getUser', function (ctx) {
|
|
|
|
|
- ctx.UserGetter.promises.getUser.callCount.should.equal(0)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ describe('common behaviour', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.CollaboratorsInviteGetter.promises.getInviteByToken.resolves(
|
|
|
|
|
+ null
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should not call ProjectGetter.getProject', function (ctx) {
|
|
|
|
|
- ctx.ProjectGetter.promises.getProject.callCount.should.equal(0)
|
|
|
|
|
|
|
+ it('should call CollaboratorsGetter.isUserInvitedMemberOfProject', function (ctx) {
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject.callCount.should.equal(
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
+ .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should call getInviteByToken', function (ctx) {
|
|
|
|
|
+ ctx.CollaboratorsInviteGetter.promises.getInviteByToken.callCount.should.equal(
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
+ .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should not call User.getUser', function (ctx) {
|
|
|
|
|
+ ctx.UserGetter.promises.getUser.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should not call ProjectGetter.getProject', function (ctx) {
|
|
|
|
|
+ ctx.ProjectGetter.promises.getProject.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -1132,54 +1186,102 @@ describe('CollaboratorsInviteController', function () {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('when User.getUser does not find a user', function () {
|
|
describe('when User.getUser does not find a user', function () {
|
|
|
- beforeEach(async function (ctx) {
|
|
|
|
|
- await new Promise(resolve => {
|
|
|
|
|
- ctx.UserGetter.promises.getUser.resolves(null)
|
|
|
|
|
- ctx.res.callback = () => resolve()
|
|
|
|
|
- ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
- ctx.req,
|
|
|
|
|
- ctx.res,
|
|
|
|
|
- ctx.next
|
|
|
|
|
|
|
+ describe('when the sharing-updates variant is "enabled"', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ ctx.SplitTestHandler.promises.getAssignment.resolves({
|
|
|
|
|
+ variant: 'enabled',
|
|
|
|
|
+ })
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.UserGetter.promises.getUser.resolves(null)
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should render the not-valid view template', function (ctx) {
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
+ 'project/invite/not-valid',
|
|
|
|
|
+ expect.anything()
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
- it('should render the not-valid view template', function (ctx) {
|
|
|
|
|
- expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
- expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
- 'project/invite/not-valid',
|
|
|
|
|
- expect.anything()
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ it('should not call next', function (ctx) {
|
|
|
|
|
+ ctx.next.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should not call next', function (ctx) {
|
|
|
|
|
- ctx.next.callCount.should.equal(0)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ describe('when the sharing-updates variant is "default"', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ ctx.SplitTestHandler.promises.getAssignment.resolves({
|
|
|
|
|
+ variant: 'default',
|
|
|
|
|
+ })
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.UserGetter.promises.getUser.resolves(null)
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call CollaboratorsGetter.isUserInvitedMemberOfProject', function (ctx) {
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject.callCount.should.equal(
|
|
|
|
|
- 1
|
|
|
|
|
- )
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
- .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
- .should.equal(true)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ it('should render the not-valid-legacy view template', function (ctx) {
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
+ 'project/invite/not-valid-legacy',
|
|
|
|
|
+ expect.anything()
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call getInviteByToken', function (ctx) {
|
|
|
|
|
- ctx.CollaboratorsInviteGetter.promises.getInviteByToken.callCount.should.equal(
|
|
|
|
|
- 1
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ it('should not call next', function (ctx) {
|
|
|
|
|
+ ctx.next.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should call User.getUser', function (ctx) {
|
|
|
|
|
- ctx.UserGetter.promises.getUser.callCount.should.equal(1)
|
|
|
|
|
- ctx.UserGetter.promises.getUser
|
|
|
|
|
- .calledWith({ _id: ctx.fakeProject.owner_ref })
|
|
|
|
|
- .should.equal(true)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ describe('common behaviour', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.UserGetter.promises.getUser.resolves(null)
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should not call ProjectGetter.getProject', function (ctx) {
|
|
|
|
|
- ctx.ProjectGetter.promises.getProject.callCount.should.equal(0)
|
|
|
|
|
|
|
+ it('should call CollaboratorsGetter.isUserInvitedMemberOfProject', function (ctx) {
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject.callCount.should.equal(
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
+ .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should call getInviteByToken', function (ctx) {
|
|
|
|
|
+ ctx.CollaboratorsInviteGetter.promises.getInviteByToken.callCount.should.equal(
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should call User.getUser', function (ctx) {
|
|
|
|
|
+ ctx.UserGetter.promises.getUser.callCount.should.equal(1)
|
|
|
|
|
+ ctx.UserGetter.promises.getUser
|
|
|
|
|
+ .calledWith({ _id: ctx.fakeProject.owner_ref })
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should not call ProjectGetter.getProject', function (ctx) {
|
|
|
|
|
+ ctx.ProjectGetter.promises.getProject.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -1229,54 +1331,102 @@ describe('CollaboratorsInviteController', function () {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
describe('when Project.getUser does not find a user', function () {
|
|
describe('when Project.getUser does not find a user', function () {
|
|
|
- beforeEach(async function (ctx) {
|
|
|
|
|
- await new Promise(resolve => {
|
|
|
|
|
- ctx.ProjectGetter.promises.getProject.resolves(null)
|
|
|
|
|
- ctx.res.callback = () => resolve()
|
|
|
|
|
- ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
- ctx.req,
|
|
|
|
|
- ctx.res,
|
|
|
|
|
- ctx.next
|
|
|
|
|
|
|
+ describe('when the sharing-updates variant is "enabled"', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ ctx.SplitTestHandler.promises.getAssignment.resolves({
|
|
|
|
|
+ variant: 'enabled',
|
|
|
|
|
+ })
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.ProjectGetter.promises.getProject.resolves(null)
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should render the not-valid view template', function (ctx) {
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
+ 'project/invite/not-valid',
|
|
|
|
|
+ expect.anything()
|
|
|
)
|
|
)
|
|
|
})
|
|
})
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
- it('should render the not-valid view template', function (ctx) {
|
|
|
|
|
- expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
- expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
- 'project/invite/not-valid',
|
|
|
|
|
- expect.anything()
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ it('should not call next', function (ctx) {
|
|
|
|
|
+ ctx.next.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should not call next', function (ctx) {
|
|
|
|
|
- ctx.next.callCount.should.equal(0)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ describe('when the sharing-updates variant is "default"', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ ctx.SplitTestHandler.promises.getAssignment.resolves({
|
|
|
|
|
+ variant: 'default',
|
|
|
|
|
+ })
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.ProjectGetter.promises.getProject.resolves(null)
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call CollaboratorsGetter.isUserInvitedMemberOfProject', function (ctx) {
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject.callCount.should.equal(
|
|
|
|
|
- 1
|
|
|
|
|
- )
|
|
|
|
|
- ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
- .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
- .should.equal(true)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ it('should render the not-valid-legacy view template', function (ctx) {
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledTimes(1)
|
|
|
|
|
+ expect(ctx.res.render).toHaveBeenCalledWith(
|
|
|
|
|
+ 'project/invite/not-valid-legacy',
|
|
|
|
|
+ expect.anything()
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call getInviteByToken', function (ctx) {
|
|
|
|
|
- ctx.CollaboratorsInviteGetter.promises.getInviteByToken.callCount.should.equal(
|
|
|
|
|
- 1
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ it('should not call next', function (ctx) {
|
|
|
|
|
+ ctx.next.callCount.should.equal(0)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- it('should call getUser', function (ctx) {
|
|
|
|
|
- ctx.UserGetter.promises.getUser.callCount.should.equal(1)
|
|
|
|
|
- ctx.UserGetter.promises.getUser
|
|
|
|
|
- .calledWith({ _id: ctx.fakeProject.owner_ref })
|
|
|
|
|
- .should.equal(true)
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ describe('common behaviour', function () {
|
|
|
|
|
+ beforeEach(async function (ctx) {
|
|
|
|
|
+ await new Promise(resolve => {
|
|
|
|
|
+ ctx.ProjectGetter.promises.getProject.resolves(null)
|
|
|
|
|
+ ctx.res.callback = () => resolve()
|
|
|
|
|
+ ctx.CollaboratorsInviteController.viewInvite(
|
|
|
|
|
+ ctx.req,
|
|
|
|
|
+ ctx.res,
|
|
|
|
|
+ ctx.next
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- it('should call ProjectGetter.getProject', function (ctx) {
|
|
|
|
|
- ctx.ProjectGetter.promises.getProject.callCount.should.equal(1)
|
|
|
|
|
|
|
+ it('should call CollaboratorsGetter.isUserInvitedMemberOfProject', function (ctx) {
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject.callCount.should.equal(
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
|
|
+ ctx.CollaboratorsGetter.promises.isUserInvitedMemberOfProject
|
|
|
|
|
+ .calledWith(ctx.currentUser._id, ctx.projectId)
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should call getInviteByToken', function (ctx) {
|
|
|
|
|
+ ctx.CollaboratorsInviteGetter.promises.getInviteByToken.callCount.should.equal(
|
|
|
|
|
+ 1
|
|
|
|
|
+ )
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should call getUser', function (ctx) {
|
|
|
|
|
+ ctx.UserGetter.promises.getUser.callCount.should.equal(1)
|
|
|
|
|
+ ctx.UserGetter.promises.getUser
|
|
|
|
|
+ .calledWith({ _id: ctx.fakeProject.owner_ref })
|
|
|
|
|
+ .should.equal(true)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ it('should call ProjectGetter.getProject', function (ctx) {
|
|
|
|
|
+ ctx.ProjectGetter.promises.getProject.callCount.should.equal(1)
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|