Sha256: e3e203ec51426471363ee8283f99d27f4692e43dc64ff9ac6ff1bde26e742491

Contents?: true

Size: 532 Bytes

Versions: 5

Compression:

Stored size: 532 Bytes

Contents

require 'rails_helper'

require 'active_support/time'

module BerkeleyLibrary
  module Logging
    describe SafeSerializer do
      describe :serialize do
        it 'handles ActiveSupport::TimeWithZone' do
          Time.zone = 'America/Los_Angeles'

          t = Time.current
          expect(t).to be_a(ActiveSupport::TimeWithZone) # just to be sure

          expect(SafeSerializer.serialize(t)).to be(t)

          h = { time: t }
          expect(SafeSerializer.serialize(h)).to eq(h)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
berkeley_library-logging-0.2.7 spec/rails/ucblit/logging/safe_serializer_spec.rb
berkeley_library-logging-0.2.6.2 spec/rails/ucblit/logging/safe_serializer_spec.rb
berkeley_library-logging-0.2.6.1 spec/rails/ucblit/logging/safe_serializer_spec.rb
berkeley_library-logging-0.2.6 spec/rails/ucblit/logging/safe_serializer_spec.rb
berkeley_library-logging-0.2.5 spec/rails/ucblit/logging/safe_serializer_spec.rb