Sha256: fa9974f9bbdcf1d75c999e00dfb2aab54784b08aae150aa0a7f2eb4721002a8b
Contents?: true
Size: 621 Bytes
Versions: 1
Compression:
Stored size: 621 Bytes
Contents
require 'spec_helper' describe Mongoid::Report do describe '.summary' do let(:klass) { Model } let(:yesterday) { Date.parse("19-12-2004") } let(:today) { Date.parse("20-12-2004") } it 'returns summary for all rows' do klass.create!(day: today , field1: 1) klass.create!(day: today , field1: 1) klass.create!(day: yesterday , field1: 1) example = Report3.new rows = example.aggregate_for(klass) rows = rows.all expect(rows.count).to eq(2) expect(rows.summary[:field1]).to eq(3) expect(rows.summary['field1']).to eq(3) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mongoid-report-0.1.3 | spec/mongoid/report/summary_spec.rb |