Sha256: f6d8cc8e5edecfaa6f4ae784aea9cc7017fc3328acf3142e804d2d54a2cafe66

Contents?: true

Size: 797 Bytes

Versions: 10

Compression:

Stored size: 797 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('page(params[:page])')
    end
  end

  describe '.pagination_helper_code' do
    it 'should fall through options successfully' do
      expect(subject.pagination_helper_code).to eql('paginate(@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

10 entries across 10 versions & 1 rubygems

Version Path
datagrid-1.4.2 spec/datagrid/scaffold_spec.rb
datagrid-1.4.1 spec/datagrid/scaffold_spec.rb
datagrid-1.4.0 spec/datagrid/scaffold_spec.rb
datagrid-1.3.9 spec/datagrid/scaffold_spec.rb
datagrid-1.3.7 spec/datagrid/scaffold_spec.rb
datagrid-1.3.6 spec/datagrid/scaffold_spec.rb
datagrid-1.3.5 spec/datagrid/scaffold_spec.rb
datagrid-1.3.4 spec/datagrid/scaffold_spec.rb
datagrid-1.3.3 spec/datagrid/scaffold_spec.rb
datagrid-1.3.2 spec/datagrid/scaffold_spec.rb