Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Changes that allow the Draper MiniTest/Integration tests to pass
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
@cookrn

This comment has been minimized.

Copy link
Owner Author

@cookrn cookrn commented May 18, 2012

Updated to change MiniTest::Spec::Decorator to MiniTest::DecoratorSpec

@cookrn

This comment has been minimized.

@steveklabnik

This comment has been minimized.

Copy link

@steveklabnik steveklabnik commented May 18, 2012

Are the requires actually required?

@steveklabnik

This comment has been minimized.

@steveklabnik

This comment has been minimized.

Copy link

@steveklabnik steveklabnik commented May 18, 2012

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