Skip to content
This repository
Browse code

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

…ude opts.
  • Loading branch information...
commit 294e2a8c2e3223caa9ccbde070509a9c0471fdaa 1 parent 5083d70
John Mileham authored May 26, 2011
9  activerecord/test/cases/json_serialization_test.rb
@@ -161,6 +161,15 @@ def test_includes_fetches_nth_level_associations
161 161
     assert_match %r{"tag":\{"name":"General"\}}, json
162 162
   end
163 163
 
  164
+  def test_includes_doesnt_merge_opts_from_base
  165
+    json = @david.to_json(
  166
+      :only => :id,
  167
+      :include => :posts
  168
+    )
  169
+
  170
+    assert_match %{"title":"Welcome to the weblog"}, json
  171
+  end
  172
+
164 173
   def test_should_not_call_methods_on_associations_that_dont_respond
165 174
     def @david.favorite_quote; "Constraints are liberating"; end
166 175
     json = @david.to_json(:include => :posts, :methods => :favorite_quote)

0 notes on commit 294e2a8

Please sign in to comment.
Something went wrong with that request. Please try again.