Sha256: 834db2a5f6cdae9f0c928d19b264d66bc1e3c01d7acfa52cd214e54a8e4f8088
Contents?: true
Size: 888 Bytes
Versions: 83
Compression:
Stored size: 888 Bytes
Contents
require 'spec_helper' describe Tenon::EventDecorator do let(:ed) { Tenon::EventDecorator.new(event) } let!(:time) { Time.now.at_beginning_of_day } describe '#display_date' do context 'a single day event' do let(:event) { double(starts_at: time, ends_at: time + 1.hour) } it 'should show the day and the times' do str = "#{time.strftime('%B %d, %Y')} from #{time.strftime('%I:%M%p')} until #{(time + 1.hour).strftime('%I:%M%p')}" expect(ed.display_date).to eq str end end context 'a multi-day event' do let(:event) { double(starts_at: time, ends_at: time + 2.days) } it 'should show the start day and time and the end day and time' do str = "#{time.strftime("%B %d, %Y at %I:%M%p")} until #{(time + 2.days).strftime("%B %d, %Y at %I:%M%p")}" expect(ed.display_date).to eq str end end end end
Version data entries
83 entries across 83 versions & 1 rubygems