Sha256: 20ef67d30820b66933abed89248f0eeba2def57932d0062782b0e8cfe3406e05

Contents?: true

Size: 828 Bytes

Versions: 3

Compression:

Stored size: 828 Bytes

Contents

require 'spec_helper'

describe AjaxDatatablesRails do
  describe 'configurations' do
    context 'configurable from outside' do
      before(:each) do
        AjaxDatatablesRails.configure do |config|
          config.db_adapter = :mysql
        end
      end

      it 'should have custom value' do
        expect(AjaxDatatablesRails.config.db_adapter).to eq(:mysql)
      end
    end
  end
end

describe AjaxDatatablesRails::Configuration do
  let(:config) { AjaxDatatablesRails::Configuration.new }

  describe 'default config' do
    it 'default db_adapter should :postgresql' do
      expect(config.db_adapter).to eq(:postgresql)
    end
  end

  describe 'custom config' do
    it 'should accept db_adapter custom value' do
      config.db_adapter = :mysql
      expect(config.db_adapter).to eq(:mysql)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ajax-datatables-rails-1.2.0 spec/ajax-datatables-rails/configuration_spec.rb
ajax-datatables-rails-1.1.0 spec/ajax-datatables-rails/configuration_spec.rb
ajax-datatables-rails-1.0.0 spec/ajax-datatables-rails/configuration_spec.rb