class TestActUrl

Public Instance Methods

test_anomaly() click to toggle source
# File vendor/qwik/lib/qwik/common-url.rb, line 77
def test_anomaly
  res = session
  eq '/.theme', @action.c_relative_to_root('/.theme')
  eq 'http://example.gov/',
    @action.c_relative_to_absolute('http://example.gov/')
end
test_external_site() click to toggle source
# File vendor/qwik/lib/qwik/common-url.rb, line 60
def test_external_site
  res = session
  page = @site['_SiteConfig']
  page.store(':siteurl:http://example.org/')
  eq '/1.html', @action.c_relative_to_root('1.html')
  eq 'http://example.org/1.html', @action.c_relative_to_absolute('1.html')
end
test_is_valid_url?() click to toggle source
# File vendor/qwik/lib/qwik/common-url.rb, line 84
def test_is_valid_url?
  res = session
  eq true, !!@action.is_valid_url?('http://e.com/')
  eq true, !!@action.is_valid_url?("http://e.com/?")
end
test_normal_site() click to toggle source
# File vendor/qwik/lib/qwik/common-url.rb, line 44
def test_normal_site
  res = session
  eq '/test/1.html', @action.c_relative_to_root('1.html')
  eq 'http://example.com/test/1.html',
    @action.c_relative_to_absolute('1.html')
end
test_top_site() click to toggle source
# File vendor/qwik/lib/qwik/common-url.rb, line 51
def test_top_site
  res = session
  @action.instance_eval {
    @site = @memory.farm.get_top_site
  }
  eq '/1.html', @action.c_relative_to_root('1.html')
  eq 'http://example.com/1.html', @action.c_relative_to_absolute('1.html')
end
test_with_path() click to toggle source
# File vendor/qwik/lib/qwik/common-url.rb, line 68
def test_with_path
  t_with_path {
    res = session
    eq '/qwik/test/1.html', @action.c_relative_to_root('1.html')
    eq 'http://www.example.org/qwik/test/1.html',
      @action.c_relative_to_absolute('1.html')
  }
end