class TestActPlan

Public Instance Methods

create_plan_pages(site) click to toggle source
# File vendor/qwik/lib/qwik/act-plan.rb, line 150
def create_plan_pages(site)
  page = site.create 'plan_19700101'
  page.store("* t")
  page = site.create 'plan_19700115'
  page.store("* t")
  page = site.create 'plan_19700201'
  page.store("* t")
  page = site.create 'plan_19710101'
  page.store("* t")
end
ok_date(num, date) click to toggle source
# File vendor/qwik/lib/qwik/act-plan.rb, line 182
def ok_date(num, date)
  assert_equal(num, Time.parse(date).to_i + Time::now.utc_offset)
end
test_parsedate() click to toggle source
# File vendor/qwik/lib/qwik/act-plan.rb, line 186
def test_parsedate
  ok_date 0, '1970-01-01'
  ok_date 0, '19700101'
  ok_date 0, '1970/01/01'
  ok_date 0, '1970/1/1'
end
test_plan() click to toggle source
# File vendor/qwik/lib/qwik/act-plan.rb, line 193
def test_plan
  t_add_user

  ok_wi [:div, [:h2, "Plan"], [:p, [:a, {:href=>".plan"},
        "Create a new plan"]]], '{{side_plan}}'

  # Go create a new plan page.
  res = session '/test/.plan'
  ok_in ["New plan"], '//h1'
  ok_attr({:action=>".plan", :method=>"POST"}, '//form')
  ok_attr({:value=>"19700101", :class=>"focus", :name=>"date"}, '//input')
  ok_attr({:value=>"Plan", :name=>"title"}, '//input[2]')

  page = @site.create_new
  page.store('t1')
end
test_plg_plan() click to toggle source
# File vendor/qwik/lib/qwik/act-plan.rb, line 161
def test_plg_plan
  ok_wi([], '{{plan}}')

  create_plan_pages(@site)

  ok_wi [:div,
    [:h2, "Plan"],
    [:ul,
      [:li, "01-01 ", [:a, {:href=>"plan_19700101.html"}, [:strong, "t"]]],
      [:li, "01-15 ", [:a, {:href=>"plan_19700115.html"}, [:em, "t"]]],
      [:li, "02-01 ", [:a, {:href=>"plan_19700201.html"},
          [:span, {:class=>"future"}, "t"]]],
      [:li, "1971-01-01 ", [:a, {:href=>"plan_19710101.html"},
          [:span, {:class=>"future"}, "t"]]]],
    [:p, [:a, {:href=>".plan"}, "Create a new plan"]]],
    '{{plan}}'

  # $KCODE = 'n'
  eq "\227\\\222\350", '予定'
end