Skip to content

Instantly share code, notes, and snippets.

@tjtuom
Created March 28, 2010 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjtuom/346882 to your computer and use it in GitHub Desktop.
Save tjtuom/346882 to your computer and use it in GitHub Desktop.
context "build" do
should "update collection without save" do
project = Project.create
project.statuses.build(:name => 'Foo')
project.statuses.size.should == 1
end
should "save built document when saving parent" do
project = Project.create
status = project.statuses.build(:name => 'Foo')
project.save!
status.should_not be_new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment