updating to couchrest 1.1.2 and as_couch_json method

This commit is contained in:
Sam Lown 2011-07-19 21:28:44 +02:00
parent 9d724aee47
commit 3258ac22e9
4 changed files with 22 additions and 6 deletions

View file

@ -62,15 +62,23 @@ describe CouchRest::Model::Property do
@card.updated_at.should_not be_nil
end
describe "#as_json" do
describe "#as_couch_json" do
it "should provide a simple hash from model" do
@card.as_json.class.should eql(Hash)
@card.as_couch_json.class.should eql(Hash)
end
it "should remove properties from Hash if value is nil" do
@card.last_name = nil
@card.as_json.keys.include?('last_name').should be_false
@card.as_couch_json.keys.include?('last_name').should be_false
end
end
describe "#as_json" do
it "should provide a simple hash from model" do
@card.as_json.class.should eql(Hash)
end
it "should pass options to Active Support's as_json" do