fix: Update timezone to get wday from working_hours (#5605)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Tejaswini Chile
2022-10-13 03:02:54 +05:30
committed by GitHub
parent 1b5a335f93
commit fca629a32a
4 changed files with 20 additions and 1 deletions

View File

@@ -88,4 +88,18 @@ RSpec.describe WorkingHour do
'Validation failed: open_all_day and closed_all_day cannot be true at the same time')
end
end
context 'when on monday 9am in Sydney timezone' do
let(:inbox) { create(:inbox) }
before do
Time.zone = 'Australia/Sydney'
inbox.update(timezone: 'Australia/Sydney')
travel_to '10.10.2022 9:00 AEDT'
end
it 'is considered working hour' do
expect(described_class.today.open_now?).to be true
end
end
end