chore: Allow super admin to suspend an account (#5174)
This commit is contained in:
parent
4152883f38
commit
e0cebfaa1a
20 changed files with 259 additions and 23 deletions
|
@ -2,7 +2,7 @@ require 'rails_helper'
|
|||
|
||||
describe '/widget', type: :request do
|
||||
let(:account) { create(:account) }
|
||||
let(:web_widget) { create(:channel_widget) }
|
||||
let(:web_widget) { create(:channel_widget, account: account) }
|
||||
let(:contact) { create(:contact, account: account) }
|
||||
let(:contact_inbox) { create(:contact_inbox, contact: contact, inbox: web_widget.inbox) }
|
||||
let(:payload) { { source_id: contact_inbox.source_id, inbox_id: web_widget.inbox.id } }
|
||||
|
@ -25,5 +25,13 @@ describe '/widget', type: :request do
|
|||
get widget_url
|
||||
expect(response).to have_http_status(:not_found)
|
||||
end
|
||||
|
||||
it 'returns 401 if the account is suspended' do
|
||||
account.update!(status: :suspended)
|
||||
|
||||
get widget_url(website_token: web_widget.website_token)
|
||||
expect(response).to have_http_status(:unauthorized)
|
||||
expect(response.body).to include('Account is suspended')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue