Class: JsTestCore::Resources::WebRoot

Inherits:
ThinRest::Resource
  • Object
show all
Defined in:
lib/js_test_core/resources/web_root.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.dispatch_strategyObject

Returns the value of attribute dispatch_strategy.



52
53
54
# File 'lib/js_test_core/resources/web_root.rb', line 52

def dispatch_strategy
  @dispatch_strategy
end

Class Method Details

.dispatch_specsObject



53
54
55
# File 'lib/js_test_core/resources/web_root.rb', line 53

def dispatch_specs
  self.dispatch_strategy = :specs
end

Instance Method Details

#getObject



60
61
62
63
# File 'lib/js_test_core/resources/web_root.rb', line 60

def get
  connection.send_head(200, :Location => "/#{self.class.dispatch_strategy}")
  connection.send_body("<html><head></head><body>Welcome to the Js Test Server. Click the following link to run you <a href=/specs>spec suite</a>.</body></html>")
end