lib/roar/rails/test_case.rb in roar-rails-0.0.15 vs lib/roar/rails/test_case.rb in roar-rails-0.1.0
- old
+ new
@@ -1,8 +1,16 @@
+if ::ActionPack::VERSION::MAJOR == 4
+ require 'test_xml/mini_test'
+else
+ require 'test_xml/test_unit'
+end
+
module Roar
module Rails
module TestCase
+ include TestXml::Assertions # FIXME: including from test_xml in MiniTest::Test doesn't work with rails 4.
+
def get(action, *args)
process(action, "GET", *args)
end
def post(action, *args)
@@ -27,15 +35,9 @@
super(action, params, nil, nil, http_method) # FIXME: for Rails <=3.1, only.
end
module Assertions
- if ::ActionPack::VERSION::MAJOR == 4
- require 'test_xml/mini_test'
- else
- require 'test_xml/test_unit'
- end
-
def assert_body(body, options={})
return assert_xml_equal body, response.body if options[:xml]
assert_equal body, response.body
end
end