diff options
author | John Mileham <jmileham@gmail.com> | 2011-05-26 10:44:49 -0400 |
---|---|---|
committer | John Mileham <jmileham@gmail.com> | 2011-05-26 11:24:25 -0400 |
commit | 294e2a8c2e3223caa9ccbde070509a9c0471fdaa (patch) | |
tree | 467a716cd43bc8ca5e8e47f4234e3af0da4c1eef /activerecord | |
parent | 5083d70f6f0041fe7ee8b662ecc58db2c15580e3 (diff) | |
download | rails-294e2a8c2e3223caa9ccbde070509a9c0471fdaa.tar.gz rails-294e2a8c2e3223caa9ccbde070509a9c0471fdaa.tar.bz2 rails-294e2a8c2e3223caa9ccbde070509a9c0471fdaa.zip |
Failing test - JSON serialization shouldn't merge base opts into include opts.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/json_serialization_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/json_serialization_test.rb b/activerecord/test/cases/json_serialization_test.rb index 8664d63e8f..d9e350abc0 100644 --- a/activerecord/test/cases/json_serialization_test.rb +++ b/activerecord/test/cases/json_serialization_test.rb @@ -161,6 +161,15 @@ class DatabaseConnectedJsonEncodingTest < ActiveRecord::TestCase assert_match %r{"tag":\{"name":"General"\}}, json end + def test_includes_doesnt_merge_opts_from_base + json = @david.to_json( + :only => :id, + :include => :posts + ) + + assert_match %{"title":"Welcome to the weblog"}, json + end + def test_should_not_call_methods_on_associations_that_dont_respond def @david.favorite_quote; "Constraints are liberating"; end json = @david.to_json(:include => :posts, :methods => :favorite_quote) |