Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spec/relation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class EmailAccount
a_task.assignees.all.should.be.empty
end



it "supports creating related objects directly on parents" do
a_task = Task.create(:name => 'Walk the Dog')
a_task.assignees.create(:assignee_name => 'bob')
Expand Down Expand Up @@ -109,6 +111,16 @@ class EmailAccount
Task.find(3).assignees.count.should == assignee_count + 1
end

it "should not change the count of assignees" do
task = Task.first
1.upto(10){ |i| task.assignees.create(:assignee_name => "Assignee #{i}") }
assignees = task.assignees
puts assignees.inspect
count = assignees.count
assignees.where(:assignee_name).eq("Assignee 1")
assignees.count.should == count
end

end

it "supports creating blank (empty) scratchpad associated objects" do
Expand Down