Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add test for json object

  • Loading branch information...
commit 665e1b13995ec5733e05f091c9e08c625c3ee6f5 1 parent 4a0202b
Wesley Beary authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 adapters/dm-couchdb-adapter/spec/couchdb_adapter_spec.rb
View
10 adapters/dm-couchdb-adapter/spec/couchdb_adapter_spec.rb
@@ -19,6 +19,7 @@ class User
property :wealth, Float
property :created_at, DateTime
property :created_on, Date
+ property :location, JsonObject
# creates methods for accessing stored/indexed views in the CouchDB database
view :by_name, { "map" => "function(doc) { if (doc.type == 'user') { emit(doc.name, doc); } }" }
@@ -197,6 +198,15 @@ class Company
User.get!(user.id).created_on.should == date
end
+ it "should handle JsonObject" do
+ pending("No CouchDB connection.") if @no_connection
+ user = new_user
+ location = { 'city' => 'San Francisco', 'state' => 'California' }
+ user.location = location
+ user.save
+ User.get!(user.id).location.should == location
+ end
+
it "should be able to call stored views" do
pending("No CouchDB connection.") if @no_connection
User.by_name.first.should == User.all(:order => [:name]).first
Please sign in to comment.
Something went wrong with that request. Please try again.