class TestActSiteBackup

Public Instance Methods

test_ext_tgz() click to toggle source
# File vendor/qwik/lib/qwik/act-sitebackup.rb, line 372
def test_ext_tgz
  t_add_user

  # Add a page
  page = @site.create_new
  page.store '* Test'

  # Wait to make time-lag between archive and site data
  sleep 1

  # Create backup
  res = session '/test/test.sitebackup'
  ok_title 'starting'

  res = session '/test/test.sitebackup'
  ok_title 'Download archive'

  res = session '/test/test.tgz'
  ok_eq 'application/gzip', res['Content-Type']

  # Compare with cache file
  content = (@site.cache_path + "test.tgz").read
  ok_eq(content, res.body)

  # Wait to make time-lag between archive and site data
  sleep 1

  # Attach a file
  res = session('POST /test/1.files') {|req|
    req.query.update('content'=>t_make_content('t.txt', 't'))
  }
  ok_title('File attachment completed')

  # Remake backup
  res = session '/test/test.sitebackup'
  ok_title 'starting'

  # Download again
  res = session '/test/test.tgz'
  ok_eq 'application/gzip', res['Content-Type']

  # Compare with cache file
  content = (@site.cache_path + "test.tgz").read
  ok_eq(content, res.body)
end
test_plg_tgz() click to toggle source
# File vendor/qwik/lib/qwik/act-sitebackup.rb, line 366
def test_plg_tgz
  ok_wi [:p, [:a, {:href=>'test.sitebackup'}, 'test.sitebackup']], '[[test.sitebackup]]'
  ok_wi [:span, {:class=>'attribute'},
         [:a, {:href=>'test.sitebackup'}, 'Site backup']], '{{sitebackup}}'
end