mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
chore: Ability to filter conversations with priority (#10967)
- Ability to filter conversation with priority --------- Co-authored-by: Shivam Mishra <scm.mymail@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
@@ -89,6 +89,30 @@ RSpec.describe 'Custom Attribute Definitions API', type: :request do
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['attribute_key']).to eq 'developer_id'
|
||||
end
|
||||
|
||||
context 'when creating with a conflicting attribute_key' do
|
||||
let(:standard_key) { CustomAttributeDefinition::STANDARD_ATTRIBUTES[:conversation].first }
|
||||
let(:conflicting_payload) do
|
||||
{
|
||||
custom_attribute_definition: {
|
||||
attribute_display_name: 'Conflicting Key',
|
||||
attribute_key: standard_key,
|
||||
attribute_model: 'conversation_attribute',
|
||||
attribute_display_type: 'text'
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'returns error for conflicting key' do
|
||||
post "/api/v1/accounts/#{account.id}/custom_attribute_definitions",
|
||||
headers: user.create_new_auth_token,
|
||||
params: conflicting_payload
|
||||
|
||||
expect(response).to have_http_status(:unprocessable_entity)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['message']).to include('The provided key is not allowed as it might conflict with default attributes.')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user