Sha256: 16dffe4f50619cf337c03425deb7f0b5df662b26682b80c2274eac53d80c51c8

Contents?: true

Size: 527 Bytes

Versions: 15

Compression:

Stored size: 527 Bytes

Contents

require 'spec_helper'

describe Datagrid::Drivers::ActiveRecord do

  describe ".match?" do
    subject { described_class }

    it {should be_match(Entry)}
    it {should be_match(Entry.scoped)}
    it {should_not be_match(MongoidEntry)}
  end

  it "should convert any scope to AR::Relation" do
    subject.to_scope(Entry).should be_a(ActiveRecord::Relation)
    subject.to_scope(Entry.limit(5)).should be_a(ActiveRecord::Relation)
    subject.to_scope(Group.create!.entries).should be_a(ActiveRecord::Relation)
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
datagrid-1.0.5 spec/datagrid/drivers/active_record_spec.rb
datagrid-1.0.4 spec/datagrid/drivers/active_record_spec.rb
datagrid-1.0.3 spec/datagrid/drivers/active_record_spec.rb
datagrid-1.0.2 spec/datagrid/drivers/active_record_spec.rb
datagrid-1.0.1 spec/datagrid/drivers/active_record_spec.rb
datagrid-1.0.0 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.9.3 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.9.2 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.9.0 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.8.4 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.8.3 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.8.2 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.8.1 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.8.0 spec/datagrid/drivers/active_record_spec.rb
datagrid-0.7.1 spec/datagrid/drivers/active_record_spec.rb