test/support/test_case_methods.rb in apotomo-1.0.1 vs test/support/test_case_methods.rb in apotomo-1.0.2
- old
+ new
@@ -69,26 +69,29 @@
end
# Creates a mock controller instance. Currently, each widget needs a parent controller instance due to some
# sucky dependency in cells.
def barn_controller!
- @controller = Class.new(ActionController::Base) do
- def initialize
- extend ActionController::UrlWriter
- self.params = {}
+ @controller = Class.new(ApotomoController) do
+ def initialize(*)
+ super
self.request = ActionController::TestRequest.new
end
def self.name; "BarnController"; end
def self.default_url_options; {:controller => :barn}; end
- include Apotomo::Rails::ControllerMethods
end.new
- ### FIXME: @controller.session = {}
end
def parent_controller
@controller
+ end
+
+ def namespaced_controller
+ controller = Farm::BarnController.new
+ controller.request = ActionController::TestRequest.new
+ controller
end
end
end
end