Adding tests to some expected behaviors

This commit is contained in:
Marcos Tapajós 2010-08-03 22:55:17 -03:00
parent e3386a45f4
commit 1a551b54eb
5 changed files with 44 additions and 32 deletions

View file

@ -2,7 +2,7 @@ module CouchRest
module Model
module Associations
# Basic support for relationships between ExtendedDocuments
# Basic support for relationships between CouchRest::Model::Base
def self.included(base)
base.extend(ClassMethods)
@ -175,14 +175,17 @@ module CouchRest
end
super(array)
end
def << obj
casted_by[property.to_s] << obj.id
super(obj)
end
def push(obj)
casted_by[property.to_s].push obj.id
super(obj)
end
def unshift(obj)
casted_by[property.to_s].unshift obj.id
super(obj)
@ -197,6 +200,7 @@ module CouchRest
casted_by[property.to_s].pop
super
end
def shift
casted_by[property.to_s].shift
super