Restructure omni services and add Chatwoot research snapshot
This commit is contained in:
28
research/chatwoot/spec/enterprise/models/sla_policy_spec.rb
Normal file
28
research/chatwoot/spec/enterprise/models/sla_policy_spec.rb
Normal file
@@ -0,0 +1,28 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SlaPolicy, type: :model do
|
||||
include ActiveJob::TestHelper
|
||||
let(:account) { create(:account) }
|
||||
let(:admin) { create(:user, account: account, role: :administrator) }
|
||||
|
||||
describe 'validations' do
|
||||
it { is_expected.to validate_presence_of(:name) }
|
||||
end
|
||||
|
||||
describe 'associations' do
|
||||
it { is_expected.to belong_to(:account) }
|
||||
it { is_expected.to have_many(:conversations).dependent(:nullify) }
|
||||
end
|
||||
|
||||
describe 'validates_factory' do
|
||||
it 'creates valid sla policy object' do
|
||||
sla_policy = create(:sla_policy)
|
||||
expect(sla_policy.name).to eq 'sla_1'
|
||||
expect(sla_policy.first_response_time_threshold).to eq 2000
|
||||
expect(sla_policy.description).to eq 'SLA policy for enterprise customers'
|
||||
expect(sla_policy.next_response_time_threshold).to eq 1000
|
||||
expect(sla_policy.resolution_time_threshold).to eq 3000
|
||||
expect(sla_policy.only_during_business_hours).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user