Class: Rutema::ActiveRecord::Scenario

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

Overview

Extensions of Rutema::ActiveRecord::Scenario to accomodate specific view requirements for rutema_web

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).



65
66
67
68
69
70
71
72
# File 'lib/rutema_web/activerecord/model.rb', line 65

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

#fail?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/rutema_web/activerecord/model.rb', line 83

def fail?
  return self.status=="error"
end

#is_test?Boolean

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

Returns:

  • (Boolean)


74
75
76
# File 'lib/rutema_web/activerecord/model.rb', line 74

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

#not_executed?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'lib/rutema_web/activerecord/model.rb', line 80

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

#success?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/rutema_web/activerecord/model.rb', line 77

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