Class: Rutema::Model::Scenario
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Rutema::Model::Scenario
- Defined in:
- lib/rutema_web/model.rb
Overview
Extensions of Rutema::Model::Scenario to accomodate specific view requirements for rutema_web
Class Method Summary collapse
-
.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.
Instance Method Summary collapse
- #fail? ⇒ Boolean
-
#is_test? ⇒ Boolean
returns true if the scenario does not belong to a setup or teardown script.
- #not_executed? ⇒ Boolean
- #success? ⇒ Boolean
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).
64 65 66 67 68 69 70 71 |
# File 'lib/rutema_web/model.rb', line 64 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
82 83 84 |
# File 'lib/rutema_web/model.rb', line 82 def fail? return self.status=="error" end |
#is_test? ⇒ Boolean
returns true if the scenario does not belong to a setup or teardown script
73 74 75 |
# File 'lib/rutema_web/model.rb', line 73 def is_test? return !(self.name=~/_setup$/ || self.name=~/_teardown$/) end |
#not_executed? ⇒ Boolean
79 80 81 |
# File 'lib/rutema_web/model.rb', line 79 def not_executed? return self.status=="not_executed" end |
#success? ⇒ Boolean
76 77 78 |
# File 'lib/rutema_web/model.rb', line 76 def success? return self.status=="success" end |