|
|
@@ -302,7 +302,7 @@ describe "LimitationsManager", ->
|
|
|
describe "hasGroupMembersLimitReached", ->
|
|
|
|
|
|
beforeEach ->
|
|
|
- @user_id = "12312"
|
|
|
+ @subscriptionId = "12312"
|
|
|
@subscription =
|
|
|
membersLimit: 3
|
|
|
member_ids: ["", ""]
|
|
|
@@ -312,21 +312,21 @@ describe "LimitationsManager", ->
|
|
|
|
|
|
it "should return true if the limit is hit (including members and invites)", (done)->
|
|
|
@SubscriptionLocator.getSubscription.callsArgWith(1, null, @subscription)
|
|
|
- @LimitationsManager.hasGroupMembersLimitReached @user_id, (err, limitReached)->
|
|
|
+ @LimitationsManager.hasGroupMembersLimitReached @subscriptionId, (err, limitReached)->
|
|
|
limitReached.should.equal true
|
|
|
done()
|
|
|
|
|
|
it "should return false if the limit is not hit (including members and invites)", (done)->
|
|
|
@subscription.membersLimit = 4
|
|
|
@SubscriptionLocator.getSubscription.callsArgWith(1, null, @subscription)
|
|
|
- @LimitationsManager.hasGroupMembersLimitReached @user_id, (err, limitReached)->
|
|
|
+ @LimitationsManager.hasGroupMembersLimitReached @subscriptionId, (err, limitReached)->
|
|
|
limitReached.should.equal false
|
|
|
done()
|
|
|
|
|
|
it "should return true if the limit has been exceded (including members and invites)", (done)->
|
|
|
@subscription.membersLimit = 2
|
|
|
@SubscriptionLocator.getSubscription.callsArgWith(1, null, @subscription)
|
|
|
- @LimitationsManager.hasGroupMembersLimitReached @user_id, (err, limitReached)->
|
|
|
+ @LimitationsManager.hasGroupMembersLimitReached @subscriptionId, (err, limitReached)->
|
|
|
limitReached.should.equal true
|
|
|
done()
|
|
|
|