2010-04-12 23:33:25 +00:00
|
|
|
Locomotive.configure do |config|
|
|
|
|
config.default_domain = 'example.com'
|
2010-06-14 13:04:01 +00:00
|
|
|
config.enable_logs = true
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
module Locomotive
|
2010-07-09 10:38:50 +00:00
|
|
|
class TestController < ApplicationController
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
include Locomotive::Render
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2011-01-09 02:08:32 +00:00
|
|
|
attr_accessor :output, :status, :current_site, :current_admin
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
def render(options = {})
|
|
|
|
self.output = options[:text]
|
2011-01-09 02:08:32 +00:00
|
|
|
self.status = options[:status]
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
def response
|
2010-07-09 10:38:50 +00:00
|
|
|
@_response ||= TestResponse.new
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
def request
|
2010-07-09 10:38:50 +00:00
|
|
|
@_request ||= TestRequest.new
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2010-06-01 00:06:46 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-09 10:38:50 +00:00
|
|
|
class TestResponse < ActionDispatch::TestResponse
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-07-09 10:38:50 +00:00
|
|
|
class TestRequest < ActionDispatch::TestRequest
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
attr_accessor :fullpath
|
2010-07-23 20:09:54 +00:00
|
|
|
|
2010-05-30 23:57:33 +00:00
|
|
|
end
|
2010-07-23 20:09:54 +00:00
|
|
|
end
|