Permalink
Browse files

Failing test - JSON serialization shouldn't merge base opts into incl…

…ude opts.
  • Loading branch information...
1 parent 5083d70 commit 294e2a8c2e3223caa9ccbde070509a9c0471fdaa @jmileham jmileham committed May 26, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 activerecord/test/cases/json_serialization_test.rb
@@ -161,6 +161,15 @@ def test_includes_fetches_nth_level_associations
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)

0 comments on commit 294e2a8

Please sign in to comment.