Skip to content

Commit

Permalink
chore: Enable plan reconcile in self hosted (#9357)
Browse files Browse the repository at this point in the history
This PR will revert the premium config in self hosted instances to its original state if any unauthorised modifications are made.
  • Loading branch information
sojan-official committed May 8, 2024
1 parent 73f3739 commit 3a12995
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Expand Up @@ -5,8 +5,7 @@ def perform

create_premium_config_reset_warning if premium_config_reset_required?

# We will have this enabled in the future
# reconcile_premium_config
reconcile_premium_config
reconcile_premium_features
end

Expand Down
Expand Up @@ -34,15 +34,13 @@
expect(Redis::Alfred.get(Redis::Alfred::CHATWOOT_INSTALLATION_CONFIG_RESET_WARNING)).to be_nil
end

# To be enabled in the future when method is uncommented

# it 'updates the premium configs to default' do
# create(:installation_config, name: 'INSTALLATION_NAME', value: 'custom-name')
# create(:installation_config, name: 'LOGO', value: '/custom-path/logo.svg')
# service.perform
# expect(InstallationConfig.find_by(name: 'INSTALLATION_NAME').value).to eq('Chatwoot')
# expect(InstallationConfig.find_by(name: 'LOGO').value).to eq('/brand-assets/logo.svg')
# end
it 'updates the premium configs to default' do
create(:installation_config, name: 'INSTALLATION_NAME', value: 'custom-name')
create(:installation_config, name: 'LOGO', value: '/custom-path/logo.svg')
service.perform
expect(InstallationConfig.find_by(name: 'INSTALLATION_NAME').value).to eq('Chatwoot')
expect(InstallationConfig.find_by(name: 'LOGO').value).to eq('/brand-assets/logo.svg')
end
end

context 'when pricing plan is not community' do
Expand Down

0 comments on commit 3a12995

Please sign in to comment.