1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test/activerecord/debug_helper_test.rb

20 lines
502 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require "active_record_unit"
require "nokogiri"
2013-03-05 17:20:02 -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
def test_debug_with_marshal_error
obj = -> { }
assert_match obj.inspect, Nokogiri.XML(debug(obj)).content
end
2013-03-05 17:20:02 -05:00
end