spec/unit/assocations_spec.rb in couchrest_model-2.0.0.beta2 vs spec/unit/assocations_spec.rb in couchrest_model-2.0.0
- old
+ new
@@ -73,9 +73,16 @@
it "should ignore blank ids" do
@invoice.client_id = ""
@invoice.client_id.should be_nil
end
+ it "should allow replacement of object after updating key" do
+ @invoice.client = @client
+ @invoice.client.should eql(@client)
+ @invoice.client_id = nil
+ @invoice.client.should be_nil
+ end
+
it "should allow override of foreign key" do
@invoice.respond_to?(:alternate_client).should be_true
@invoice.respond_to?("alternate_client=").should be_true
@invoice.properties.find{|p| p.name == 'alt_client_id'}.should_not be_nil
end