From 12c09085dfff9f7ce80161833a81fbff5b99321c Mon Sep 17 00:00:00 2001 From: Chris Anderson Date: Wed, 3 Dec 2008 12:09:13 -0800 Subject: [PATCH] justin_dz spec for save bug --- spec/couchrest/core/model_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/spec/couchrest/core/model_spec.rb b/spec/couchrest/core/model_spec.rb index 0257f89..466b850 100644 --- a/spec/couchrest/core/model_spec.rb +++ b/spec/couchrest/core/model_spec.rb @@ -77,6 +77,27 @@ class Article < CouchRest::Model end end +class Player < CouchRest::Model + unique_id :email + + key_accessor :email, :name, :str, :coord, :int, :con, :spirit, :level, :xp, :points, :coins, :date, :items, :loc + + view_by :name, :descending => true + view_by :loc + + timestamps! +end + +describe "save bug" do + it "should fix" do + @db = reset_test_db! + @p = Player.new + @p.email = 'insane@fakestreet.com' + @p.save + end +end + + describe CouchRest::Model do before(:all) do @cr = CouchRest.new(COUCHHOST)