Sha256: 22fcd77d71bb184e6c742788984960b0c9473cb71930840f5cac4096dc7dc3c9
Contents?: true
Size: 764 Bytes
Versions: 24
Compression:
Stored size: 764 Bytes
Contents
require 'spec_helper' require 'couch_potato/rspec' class Contract include CouchPotato::Persistence property :date property :terms view :by_date, :type => :properties, :key => :_id, :properties => [:date] end describe CouchPotato::View::PropertiesViewSpec do it "should map the given properties" do Contract.by_date.should map( Contract.new(:date => '2010-01-01', :_id => '1') ).to(['1', {"date" => "2010-01-01"}]) end it "should reduce to the number of documents" do Contract.by_date.should reduce( ['1', {"date" => "2010-01-01"}], ['2', {"date" => "2010-01-02"}] ).to(2) end it "should rereduce the number of documents" do Contract.by_date.should rereduce( nil, [12, 13] ).to(25) end end
Version data entries
24 entries across 24 versions & 3 rubygems