mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test for inspecting a Relation with a virtual field
This commit is contained in:
parent
9ff8a9fa49
commit
3c02ef95e9
1 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,11 @@ class CoreTest < ActiveRecord::TestCase
|
|||
assert_equal "NonExistentTable(Table doesn't exist)", NonExistentTable.inspect
|
||||
end
|
||||
|
||||
def test_inspect_relation_with_virtual_field
|
||||
relation = Topic.limit(1).select("1 as virtual_field")
|
||||
assert_match(/virtual_field: 1/, relation.inspect)
|
||||
end
|
||||
|
||||
def test_pretty_print_new
|
||||
topic = Topic.new
|
||||
actual = +""
|
||||
|
|
Loading…
Reference in a new issue