feat: Add an action on automation to change the priority (#6925)

This commit is contained in:
Muhsin Keloth
2023-04-20 11:31:33 +05:30
committed by GitHub
parent 527042afd1
commit d1584eea72
5 changed files with 50 additions and 1 deletions

View File

@@ -11,5 +11,21 @@ describe ::ActionService do
expect(conversation.reload.status).to eq('resolved')
end
end
describe '#change_priority' do
let(:conversation) { create(:conversation) }
let(:action_service) { described_class.new(conversation) }
it 'changes the priority of the conversation to medium' do
action_service.change_priority(['medium'])
expect(conversation.reload.priority).to eq('medium')
end
it 'changes the priority of the conversation to nil' do
action_service.change_priority(['nil'])
expect(conversation.reload.priority).to be_nil
end
end
# TODO: Expand this test suite
end