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::DecoratortoMiniTest::DecoratorSpec