chore: Update deleteCustomAttribute
method in SDK (#3334)
This commit is contained in:
parent
c2db8a1fd7
commit
a2764e5c1d
12 changed files with 138 additions and 30 deletions
|
@ -87,4 +87,25 @@ RSpec.describe '/api/v1/widget/contacts', type: :request do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'POST /api/v1/widget/destroy_custom_attributes' do
|
||||
let(:params) { { website_token: web_widget.website_token, identifier: 'test', custom_attributes: ['test'] } }
|
||||
|
||||
context 'with invalid website token' do
|
||||
it 'returns unauthorized' do
|
||||
post '/api/v1/widget/destroy_custom_attributes', params: { website_token: '' }
|
||||
expect(response).to have_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with correct website token' do
|
||||
it 'calls destroy custom attributes' do
|
||||
post '/api/v1/widget/destroy_custom_attributes',
|
||||
params: params,
|
||||
headers: { 'X-Auth-Token' => token },
|
||||
as: :json
|
||||
expect(contact.reload.custom_attributes).to eq({})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue