require 'spec_helper'

describe Date do
  describe '#day_name' do
    it 'returns the proper day name' do
      travel_to Date.parse('2015-01-22') do
        Date.today.day_name.should eq 'thursday'
      end
    end
  end
end

describe Time do
  describe '#minute_of_day' do
    it 'returns the proper minute' do
      Time.parse('2015-01-22T16:48:12Z').minute_of_day.should eq 1008
    end

    it 'works for relative time' do
      travel_to Time.parse('2015-01-22T16:48:12Z') do
        12.minutes.from_now.minute_of_day.should eq 1020
      end
    end
  end
end
