2017-07-23 11:36:41 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-06 12:50:17 -04:00
|
|
|
require "active_record_unit"
|
|
|
|
require "nokogiri"
|
2013-03-05 17:20:02 -05:00
|
|
|
|
2013-03-05 20:00:10 -05:00
|
|
|
class DebugHelperTest < ActionView::TestCase
|
2013-03-05 17:20:02 -05:00
|
|
|
def test_debug
|
|
|
|
company = Company.new(name: "firebase")
|
2016-06-01 19:19:21 -04:00
|
|
|
output = debug(company)
|
|
|
|
assert_match "name: name", output
|
|
|
|
assert_match "value_before_type_cast: firebase", output
|
|
|
|
assert_match "active_record_yaml_version: 2", output
|
2013-03-05 17:20:02 -05:00
|
|
|
end
|
2015-03-05 18:19:44 -05:00
|
|
|
|
|
|
|
def test_debug_with_marshal_error
|
2016-08-16 03:30:11 -04:00
|
|
|
obj = -> {}
|
2015-03-05 18:19:44 -05:00
|
|
|
assert_match obj.inspect, Nokogiri.XML(debug(obj)).content
|
|
|
|
end
|
2013-03-05 17:20:02 -05:00
|
|
|
end
|