feat(captain): enable v2 for all paid plans

This commit is contained in:
aakashb95
2026-07-20 13:27:59 +05:30
parent a752e56765
commit 723501f147
4 changed files with 4 additions and 34 deletions
+1 -3
View File
@@ -284,13 +284,11 @@ RSpec.describe Account, type: :model do
expect(account.captain_models).to be_nil
end
it 'marks new cloud accounts as eligible for the Captain V2 paid-plan default' do
it 'does not enable Captain for new cloud accounts before plan reconciliation' do
allow(ChatwootApp).to receive(:self_hosted_enterprise?).and_return(false)
allow(ChatwootApp).to receive(:chatwoot_cloud?).and_return(true)
account = create(:account)
expect(account.internal_attributes[Enterprise::Account::CAPTAIN_V2_DEFAULT_ELIGIBLE]).to be true
expect(account).not_to be_feature_enabled('captain_integration')
expect(account).not_to be_feature_enabled('captain_integration_v2')
end
@@ -221,21 +221,7 @@ describe Enterprise::Billing::HandleStripeEventService do
end
end
it 'does not enable Captain V2 for existing paid accounts during reconciliation' do
allow(subscription).to receive(:[]).with('plan')
.and_return({ 'id' => 'test', 'product' => 'plan_id_startups', 'name' => 'Startups' })
stripe_event_service.new.perform(event: event)
expect(account.reload).not_to be_feature_enabled('captain_integration_v2')
end
it 'enables Captain V2 for new cloud accounts marked as default eligible' do
account.update!(
internal_attributes: account.internal_attributes.merge(
Enterprise::Account::CAPTAIN_V2_DEFAULT_ELIGIBLE => true
)
)
it 'enables Captain V2 for paid accounts during reconciliation' do
allow(subscription).to receive(:[]).with('plan')
.and_return({ 'id' => 'test', 'product' => 'plan_id_startups', 'name' => 'Startups' })