Class: Stratagem::Scan::Checks::ErrorPages

Inherits:
Base
  • Object
show all
Includes:
ViewBase
Defined in:
lib/stratagem/scan/checks/error_pages.rb

Constant Summary collapse

Strings =
{
  404 => ['The page you were looking for doesn\'t exist.', 'You may have mistyped the address or the page may have moved.'],
  500 => ['We\'re sorry, but something went wrong.', 'We\'ve been notified about this issue and we\'ll take a look at it shortly.']
}

Instance Method Summary collapse

Instance Method Details

#scan(view) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/stratagem/scan/checks/error_pages.rb', line 12

def scan(view)
  Strings.each {|type, set|
    matched = true
    set.each {|s|
      unless view.include?(s)
        matched = false
        break
      end
    }
    result(:concern_type => :best_practice, :unique => type, :payload => type) if (matched)
  }
end