Sha256: 044ef936acab76c39fa89a5cd7bc814f469befae8f25ff26ba18eb58de29af9d

Contents?: true

Size: 730 Bytes

Versions: 4

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

require "cases/helper"
require "models/topic"

module ActiveRecord
  module Type
    class TimeTest < ActiveRecord::TestCase
      def test_default_year_is_correct
        expected_time = ::Time.utc(2000, 1, 1, 10, 30, 0)
        topic = Topic.new(bonus_time: { 4 => 10, 5 => 30 })

        assert_equal expected_time, topic.bonus_time
        assert_instance_of ::Time, topic.bonus_time

        topic.save!

        assert_equal expected_time, topic.bonus_time
        assert_instance_of ::Time, topic.bonus_time

        topic.reload

        assert_equal expected_time, topic.bonus_time
        assert_instance_of ::Time, topic.bonus_time
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/cases/type/time_test.rb
ibm_db-5.4.1-x86-mingw32 test/cases/type/time_test.rb
ibm_db-5.4.0-x86-mingw32 test/cases/type/time_test.rb
ibm_db-5.3.2-x86-mingw32 test/cases/type/time_test.rb