0
doc.id.should == "fubar"
0
- it "should
should be new? if there's an id attribute" do
0
+ it "should
not be new? if there's an id attribute" do
0
doc = CouchObject::Document.new(@test_data)
0
doc.new?.should == false
0
- it "should
not be new if there's not original id" do
0
+ it "should
be new if there's not original id" do
0
doc = CouchObject::Document.new({"foo" => "bar"})
0
doc.new?.should == true
0
- it "should PUT to the database with
create" do
0
+ it "should PUT to the database with
update" do
0
doc = CouchObject::Document.new(@test_data)
0
doc.should_receive(:to_json).and_return("JSON")
0
@db.should_receive(:put).with(@test_data["_id"], "JSON").and_return(@response)
0
doc["foo"].should == "bar"
0
- it "should assign document attributes witih []=" do
0
+ it "should lookup document attributes with [] using a symbol" do
0
+ doc = CouchObject::Document.new({"foo" => "bar"})
0
+ doc[:foo].should == "bar"
0
+ it "should assign document attributes with []=" do
0
doc = CouchObject::Document.new
0
doc["foo"].should == nil
0
doc["foo"].should == "bar"
0
- it "should delegate missing methods to attributes" do
0
- doc = CouchObject::Document.new({"foo" => "bar", "stuff" => true })
0
- doc.foo.should == "bar"
0
- doc.stuff?.should == true
0
+ it "should assign document attributes with []= using a symbol" do
0
+ doc = CouchObject::Document.new
0
+ doc[:foo].should == nil
0
+ doc[:foo].should == "bar"
0
+ it "should delegate missing assignment methods to attributes" do
0
+ doc = CouchObject::Document.new({"foo" => "bar"})
0
proc{ doc.foo = "baz" }.should_not raise_error
0
doc.foo.should == "baz"
0
+ it "should delegate missing boolean methods to attributes" do
0
+ doc = CouchObject::Document.new({"foo" => true})
0
+ doc.foo?.should == true
0
+ doc.foo?.should == false
0
+ it "should delegate missing reader methods to attributes" do
0
+ doc = CouchObject::Document.new({"foo" => "bar"})
0
+ doc.foo.should == "bar"
0
it "should know if it has a given document key" do
0
doc = CouchObject::Document.new({"foo" => "bar"})
0
doc.has_key?("foo").should == true
0
doc.has_key?("bar").should == false
0
+ it "should know if it has a given document key using a symbol" do
0
+ doc = CouchObject::Document.new({"foo" => "bar"})
0
+ doc.has_key?(:foo).should == true
0
+ doc.has_key?(:bar).should == false
0
it "should know if it reponds to a key in the attributes" do
Comments
No one has commented yet.