Sha256: f1090071ce70736fae37e81648de01a6702da7331e73d586d01c33c8bb24ff35
Contents?: true
Size: 909 Bytes
Versions: 13
Compression:
Stored size: 909 Bytes
Contents
require 'spec_helper' require 'models/active_record_schema' require 'models/active_record_models' describe 'ActiveRecordSchemaSpec' do it 'should load in the activerecord sample schema.rb file' do expect { CreateActiveRecordSchema.up }.to_not raise_error end context 'from loaded activerecord data' do before(:all) do CreateActiveRecordSchema.up Topic.delete_all 1.upto(4) do |i| @topic = Topic.new @topic.title = "foo#{i}" @topic.author_name = "author#{i}" @topic.author_email_address = "email#{i}@localhost" @topic.approved = true @topic.save end end it 'should be able to group data' do topic = Topic.last topic.approved = false topic.save approved_topics_count = Topic.group(:approved).count(:author_name)[true] approved_topics_count.should == 3 end end end
Version data entries
13 entries across 13 versions & 1 rubygems