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:
Sojan Jose
2026-02-24 20:29:53 -08:00
committed by GitHub
parent 76f129efaf
commit 55f6257313
4 changed files with 74 additions and 48 deletions

View File

@@ -0,0 +1,9 @@
module Enterprise::ChatwootHub
ENTERPRISE_BASE_URL = 'https://hub.2.chatwoot.com'.freeze
def base_url
return ENV.fetch('CHATWOOT_HUB_URL', ENTERPRISE_BASE_URL) if Rails.env.development?
ENTERPRISE_BASE_URL
end
end