Sha256: abe7ba35f63ca1f076cfc882cd72a12002fb02467f7002344bc1a5252802f045

Contents?: true

Size: 808 Bytes

Versions: 3

Compression:

Stored size: 808 Bytes

Contents

require 'spec_helper'

describe Datagrid::Scaffold do
  subject { Datagrid::Scaffold.new([""]) }

  describe '.paginate_code' do
    it 'should fall through options successfully' do
      expect(subject.paginate_code).to eql('paginate_somehow')
    end
  end

  describe '.pagination_helper_code' do
    it 'should fall through options successfully' do
      expect(subject.pagination_helper_code).to eql('some_pagination_helper(@grid.assets)')
    end

    context "when Kaminari exists" do
      before(:each) do
        Object.const_set("Kaminari", 1)
      end
      it 'should fall through options successfully' do
        expect(subject.pagination_helper_code).to eql('paginate(@grid.assets)')
      end

      after(:each) do
        Object.send(:remove_const, "Kaminari")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datagrid-1.3.1 spec/datagrid/scaffold_spec.rb
datagrid-1.3.0 spec/datagrid/scaffold_spec.rb
datagrid-1.2.3 spec/datagrid/scaffold_spec.rb