Class: Litmus::PageTest

Inherits:
Test show all
Defined in:
lib/litmus/page_test.rb

Class Method Summary collapse

Methods inherited from Test

destroy, find_by_name, rename, show

Methods inherited from Base

configure, #initialize

Constructor Details

This class inherits a constructor from Litmus::Base

Class Method Details

.create(url, name = nil, sandbox = false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/litmus/page_test.rb', line 7

def self.create(url, name = nil, sandbox = false)
  builder = Builder::XmlMarkup.new
  builder.instruct! :xml, :version=>"1.0"
  builder.test_set do |test_set|
    test_set.use_defaults true
    test_set.url url
    test_set.name name if name
    test_set.sandbox true if sandbox
  end
  post('/pages.xml', :body => builder.target!, :headers => {"Content-type" => "application/xml"})["test_set"]
end

.listObject



3
4
5
# File 'lib/litmus/page_test.rb', line 3

def self.list
  super.reject{|test| test["service"] != 'page'}
end