Chore: Added tests for subscriptions_controller (#483)
Added tests for subscriptions_controller ref: #37
This commit is contained in:
parent
c32d391261
commit
a2316d4d09
6 changed files with 62 additions and 17 deletions
|
@ -67,7 +67,7 @@ class ApplicationController < ActionController::Base
|
|||
def check_subscription
|
||||
# This block is left over from the initial version of chatwoot
|
||||
# We might reuse this later in the hosted version of chatwoot.
|
||||
return unless ENV['BILLING_ENABLED']
|
||||
return if !ENV['BILLING_ENABLED'] || !current_user
|
||||
|
||||
if current_subscription.trial? && current_subscription.expiry < Date.current
|
||||
render json: { error: 'Trial Expired' }, status: :trial_expired
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue