Feat: Out of office autoresponder (#2992)

This change allows the user to enable autoresponder during the out-of-office time.

Fixes: #2035
This commit is contained in:
Aswin Dev P.S
2021-09-17 22:17:11 +05:30
committed by GitHub
parent 6ad5a7452c
commit 794a56d4cc
5 changed files with 68 additions and 26 deletions

View File

@@ -26,4 +26,28 @@ RSpec.describe WorkingHour do
expect(described_class.today.closed_now?).to be true
end
end
context 'when on friday 12:30pm' do
before do
Time.zone = 'UTC'
create(:working_hour)
travel_to '10.09.2021 12:30'.to_datetime
end
it 'is considered to be in business hours' do
expect(described_class.today.open_now?).to be true
end
end
context 'when on friday 17:30pm' do
before do
Time.zone = 'UTC'
create(:working_hour)
travel_to '10.09.2021 17:30'.to_datetime
end
it 'is considered out of office' do
expect(described_class.today.closed_now?).to be true
end
end
end