From cc075fb69b5a116828352857b0abbf80d2ae6efc Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Tue, 24 Aug 2010 19:30:41 +0200 Subject: [PATCH] Moving test to saner location --- spec/couchrest/casted_model_spec.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/couchrest/casted_model_spec.rb b/spec/couchrest/casted_model_spec.rb index b9f26e1..60fb3e0 100644 --- a/spec/couchrest/casted_model_spec.rb +++ b/spec/couchrest/casted_model_spec.rb @@ -134,6 +134,11 @@ describe CouchRest::Model::CastedModel do it "should cast its own attributes" do @casted_obj.casted_attribute.should be_instance_of(WithCastedModelMixin) end + + it "should raise an error if save or update_attributes called" do + expect { @casted_obj.casted_attribute.save }.to raise_error(NoMethodError) + expect { @casted_obj.casted_attribute.update_attributes(:name => "Fubar") }.to raise_error(NoMethodError) + end end describe "casted as an array of a different type" do @@ -180,10 +185,6 @@ describe CouchRest::Model::CastedModel do @question.a.should == "To seek the Holy Grail" end - it "should raise an error if save or update_attributes called" do - expect { @question.save }.to raise_error - expect { @question.update_attributes(:q => "Fubar?") }.to raise_error - end end describe "saved document with casted models" do