Sha256: c8f7a3d34266c3f75a7e5762e6de4675af866b080cb23837cbf81a8c0e41f13f

Contents?: true

Size: 777 Bytes

Versions: 12

Compression:

Stored size: 777 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::Searchable do

  context 'with missing includes' do
    it 'raises exteption when class does not include Kuhsaft::Bricklist' do
      expect do
        class Foo
          include Kuhsaft::Searchable
        end
      end.to raise_error(/needs Kuhsaft::BrickList to be included/)
    end
  end

  context 'with Bricklist included' do
    class SearchableDemo < ActiveRecord::Base
      include Kuhsaft::BrickList
    end

    context 'without postgresql' do
      it 'initializes scope' do
        expect(ActiveRecord::Base.connection.instance_values).not_to eq('postgresql')
        SearchableDemo.should_receive :scope
        SearchableDemo.class_eval do
          include Kuhsaft::Searchable
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
qbrick-2.5.0.pre spec/lib/searchable_spec.rb
kuhsaft-2.4.3 spec/lib/searchable_spec.rb
kuhsaft-2.4.2 spec/lib/searchable_spec.rb
kuhsaft-2.4.1 spec/lib/searchable_spec.rb
kuhsaft-2.4.0 spec/lib/searchable_spec.rb
kuhsaft-2.3.6 spec/lib/searchable_spec.rb
kuhsaft-2.3.5 spec/lib/searchable_spec.rb
kuhsaft-2.3.4 spec/lib/searchable_spec.rb
kuhsaft-2.3.3 spec/lib/searchable_spec.rb
kuhsaft-2.3.2 spec/lib/searchable_spec.rb
kuhsaft-2.3.1 spec/lib/searchable_spec.rb
kuhsaft-2.3.0 spec/lib/searchable_spec.rb