fix: Update account limit selection logic (#6149)
This commit is contained in:
@@ -38,5 +38,27 @@ RSpec.describe Account do
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it 'returns max limits from global config if account limit is absent' do
|
||||
account.update(limits: { agents: '' })
|
||||
expect(account.usage_limits).to eq(
|
||||
{
|
||||
agents: 20,
|
||||
inboxes: ChatwootApp.max_limit
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it 'returns max limits from app limit if account limit and installation config is absent' do
|
||||
account.update(limits: { agents: '' })
|
||||
InstallationConfig.where(name: 'ACCOUNT_AGENTS_LIMIT').update(value: '')
|
||||
|
||||
expect(account.usage_limits).to eq(
|
||||
{
|
||||
agents: ChatwootApp.max_limit,
|
||||
inboxes: ChatwootApp.max_limit
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user