class TestSiteTimeLine

Public Instance Methods

test_all() click to toggle source
# File vendor/qwik/lib/qwik/site-timeline.rb, line 121
def test_all
  page = @site.create_new
  page.put_with_time('* t1', 0)     # store the first
  page.put_with_time('* t2', 1)     # store the second

  # test_last_modified
  eq(1, @site.last_modified.to_i)

  tl = @site.timeline

  # test_calc_history
  tl.calc_history
  #pp tl

  # test_times
  times = tl.times
  eq ['1'], times.keys
  eq 0, times['1'][0].to_i
  eq 1, times['1'][1].to_i

  # test_days
  days = tl.days
  day = days['19700101']
  eq [['1', Time.at(0)], ['1', Time.at(1)]], day

  # test_site_min, page_min, pages_history, site_duration
  eq Time.at(0), tl.site_min
  eq({'1'=>Time.at(0)}, tl.page_min)
  eq ['1'], tl.pages_history
  assert(0 < tl.site_duration)
end