chore(hub): clean up legacy Captain hub flow (#13640)
## Summary This PR cleans up legacy Hub/Captain integration paths and simplifies hub URL behavior coverage in tests. ## Changes - remove legacy Captain account endpoint flow from `ChatwootHub` - remove obsolete spec coverage tied to that retired flow - keep hub URL handling centralized in `base_url` with enterprise overlay precedence - simplify hub URL specs to assert explicit static URL expectations where applicable ## Reproduce Run the focused hub specs from this branch: - `bundle exec rspec spec/lib/chatwoot_hub_spec.rb spec/enterprise/lib/chatwoot_hub_spec.rb` ## Testing Validated locally with: - `bundle exec rspec spec/lib/chatwoot_hub_spec.rb spec/enterprise/lib/chatwoot_hub_spec.rb` - `bundle exec rubocop lib/chatwoot_hub.rb spec/lib/chatwoot_hub_spec.rb enterprise/lib/enterprise/chatwoot_hub.rb spec/enterprise/lib/chatwoot_hub_spec.rb`
This commit is contained in:
21
spec/enterprise/lib/chatwoot_hub_spec.rb
Normal file
21
spec/enterprise/lib/chatwoot_hub_spec.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ChatwootHub do
|
||||
describe '.base_url' do
|
||||
it 'uses the static hub url outside development for enterprise edition' do
|
||||
with_modified_env CHATWOOT_HUB_URL: 'https://custom.example.com' do
|
||||
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('production'))
|
||||
|
||||
expect(described_class.base_url).to eq('https://hub.2.chatwoot.com')
|
||||
end
|
||||
end
|
||||
|
||||
it 'uses CHATWOOT_HUB_URL in development for enterprise edition' do
|
||||
with_modified_env CHATWOOT_HUB_URL: 'https://custom.example.com' do
|
||||
allow(Rails).to receive(:env).and_return(ActiveSupport::StringInquirer.new('development'))
|
||||
|
||||
expect(described_class.base_url).to eq('https://custom.example.com')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user