Sha256: efd3b1627120df92c4aa882cefd1dc6d26b5c5eafadd29ab8db5442a1ded4895
Contents?: true
Size: 788 Bytes
Versions: 18
Compression:
Stored size: 788 Bytes
Contents
# frozen_string_literal: true require 'test_plugin_helper' class ApiParamsTest < ActiveSupport::TestCase describe '#format_datetime' do let(:params) { JobInvocationComposer::ApiParams.allocate } it 'leaves empty string as is' do assert_equal params.send(:format_datetime, ''), '' end it 'honors explicitly supplied time zone' do Time.use_zone(ActiveSupport::TimeZone['America/New_York']) do assert_equal '2022-07-08 08:53', params.send(:format_datetime, '2022-07-08 12:53:20 UTC') end end it 'implicitly honors current user\'s time zone' do Time.use_zone(ActiveSupport::TimeZone['America/New_York']) do assert_equal '2022-07-08 12:53', params.send(:format_datetime, '2022-07-08 12:53:20') end end end end
Version data entries
18 entries across 18 versions & 1 rubygems