spec fixing

This commit is contained in:
2018-01-29 15:15:55 -03:00
parent 9fd3df3da9
commit c9df6464f0
4 changed files with 11 additions and 4 deletions
@@ -2,8 +2,9 @@
#= require jquery_ujs
#= require dunlop
#= require_directory .
# require foundation
# require select2
# test app is still foundation, until enough love from somebody to convert (or phase out foundation)
#= require foundation
#= require select2
$ ->
$(document).foundation()
$(document).find('select.smart-select').select2()
@@ -1,6 +1,10 @@
require 'rails_helper'
RSpec.describe Time do #epoch_week
it "has a proper bias for making the monday of the epoch time the base unit" do
('1969-12-29T00:00:00Z'.to_time.to_i + Time::EPOCH_BASE).should be_zero
end
expectations = {
'2017-01-01' => 2452, # year 2016, week 52
'2020-12-24' => 2660, # year 2020, week 52
@@ -12,7 +16,7 @@ RSpec.describe Time do #epoch_week
}
expectations.each do |time, expected_epoch_week|
it "has the proper epoch_week for #{time}" do
time.to_time.epoch_week.should eq expected_epoch_week
"#{time}T00:00:00Z".to_time.epoch_week.should eq expected_epoch_week
end
end
end