Created
May 18, 2012 00:31
-
-
Save cookrn/2722446 to your computer and use it in GitHub Desktop.
Changes that allow the Draper MiniTest/Integration tests to pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/unit' | |
require 'minitest/spec' | |
module MiniTest | |
class DecoratorSpec < Spec | |
before do | |
ApplicationController.new.set_current_view_context | |
Draper::ViewContext.current.controller.request ||= ActionController::TestRequest.new | |
Draper::ViewContext.current.request ||= Draper::ViewContext.current.controller.request | |
Draper::ViewContext.current.params ||= {} | |
end | |
end | |
end | |
class MiniTest::Unit::DecoratorTestCase < MiniTest::Unit::TestCase | |
add_setup_hook do | |
ApplicationController.new.set_current_view_context | |
Draper::ViewContext.current.controller.request ||= ActionController::TestRequest.new | |
Draper::ViewContext.current.request ||= Draper::ViewContext.current.controller.request | |
Draper::ViewContext.current.params ||= {} | |
end | |
end | |
MiniTest::Spec.register_spec_type(MiniTest::DecoratorSpec) do |desc| | |
desc.superclass == Draper::Base | |
end |
Are the requires actually required?
Oh, duh, minitest is always included in 1.9.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated to change
MiniTest::Spec::Decorator
toMiniTest::DecoratorSpec