Sha256: 3e67f863a923636ac5056cb4145d81ba13a0e7dd70bc09d437730b360e970856
Contents?: true
Size: 888 Bytes
Versions: 27
Compression:
Stored size: 888 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe 'Queries on Date fields' do let(:query) do Band.where(founded: arg) end let(:selector) { query.selector } shared_examples 'converts to beginning of day in UTC' do it 'converts to beginning of day in UTC' do selector['founded'].should == Time.utc(arg.year, arg.month, arg.day) end end context 'using Time' do let(:arg) do Time.now.freeze end it_behaves_like 'converts to beginning of day in UTC' end context 'using TimeWithZone' do let(:time_zone_name) { 'Pacific Time (US & Canada)' } let(:arg) { Time.now.in_time_zone(time_zone_name).freeze } it_behaves_like 'converts to beginning of day in UTC' end context 'using DateTime' do let(:arg) do DateTime.now.freeze end it_behaves_like 'converts to beginning of day in UTC' end end
Version data entries
27 entries across 27 versions & 1 rubygems