Skip to content

Commit

Permalink
adds coverage for the issue addressed in fe43bbd
Browse files Browse the repository at this point in the history
[#4166 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
fxn authored and jeremy committed Mar 12, 2010
1 parent 94a60a5 commit 89eae2d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions activerecord/test/cases/associations_test.rb
Expand Up @@ -180,6 +180,20 @@ def test_reload_returns_assocition
end
end

def test_splat_does_not_invoke_to_a_on_singular_targets
Kernel.module_eval do
alias original_to_a to_a
def to_a
[:_]
end
end
assert_not_equal [:_], [*posts(:welcome).author]
ensure
Kernel.module_eval do
alias to_a original_to_a
end
end

def setup_dangling_association
josh = Author.create(:name => "Josh")
p = Post.create(:title => "New on Edge", :body => "More cool stuff!", :author => josh)
Expand Down

0 comments on commit 89eae2d

Please sign in to comment.