Skip to content

Commit

Permalink
add a similar test that many documents and many embedded documents pr…
Browse files Browse the repository at this point in the history
…oxies have
  • Loading branch information
danp authored and jnunemaker committed Apr 18, 2010
1 parent 59927cd commit 18ec788
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/functional/associations/test_one_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ def setup

post.author.object_id.should == post.author.target.object_id
end

should "allow assignment of associated document using a hash" do
@post_class.one :author, :class => @author_class

post = @post_class.new('author' => { 'name' => 'Frank' })
post.author.name.should == 'Frank'

post.save.should be_true
post.reload

post.author.name.should == 'Frank'
end

context "replacing the association" do
context "with an object of the class" do
Expand Down

0 comments on commit 18ec788

Please sign in to comment.