Class: Rutema::Model::Scenario

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/rutemaweb/model.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_on_page(page_num, page_size, conditions = nil) ⇒ Object

The view wants to display scenarios grouped into pages, where each page shows page_size scenarios at a time. This method returns the scenarios grouped by name on page page_num (starting at zero).



57
58
59
60
61
62
63
64
# File 'lib/rutemaweb/model.rb', line 57

def self.find_on_page(page_num, page_size,conditions=nil) 
  find(:all, 
  :order => "name ASC",
  :group=>"name", 
  :limit => page_size, 
  :conditions=>conditions,
  :offset => page_num*page_size) 
end

Instance Method Details

#is_test?Boolean

returns true if the scenario does not belong to a setup or teardown script

Returns:

  • (Boolean)


66
67
68
# File 'lib/rutemaweb/model.rb', line 66

def is_test?
  return !(self.name=~/_setup$/ || self.name=~/_teardown$/)
end

#success?Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/rutemaweb/model.rb', line 69

def success?
  return self.status=="success"
end