chore: ability to run Chatwoot as API only server (#2344)

- Ability to run chatwoot as an API only server
- Removes action cable testing gem since it is merged to rails 6
This commit is contained in:
Sojan Jose
2021-05-27 20:07:21 +05:30
committed by GitHub
parent 9c555e70c9
commit 3b39eb3e33
8 changed files with 44 additions and 11 deletions

View File

@@ -17,4 +17,18 @@ describe '/app/login', type: :request do
ENV['DEFAULT_LOCALE'] = 'en'
end
end
# Routes are loaded once on app start
# hence Rails.application.reload_routes! is used in this spec
# ref : https://stackoverflow.com/a/63584877/939299
context 'with CW_API_ONLY_SERVER true' do
it 'returns 404' do
ENV['CW_API_ONLY_SERVER'] = 'true'
Rails.application.reload_routes!
get '/app/login'
expect(response).to have_http_status(:not_found)
ENV['CW_API_ONLY_SERVER'] = nil
Rails.application.reload_routes!
end
end
end