Sha256: a5f90310d0e65746dd66eb72cecd88344909f652cdf21e6f2312274d94826a1b

Contents?: true

Size: 770 Bytes

Versions: 21

Compression:

Stored size: 770 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 {
        class Foo
          include Kuhsaft::Searchable
        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
        ActiveRecord::Base.connection.instance_values.should_not == 'postgresql'
        SearchableDemo.should_receive :scope
        SearchableDemo.class_eval do
          include Kuhsaft::Searchable
        end
      end
    end
  end 
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
kuhsaft-2.2.6 spec/lib/searchable_spec.rb
kuhsaft-2.2.5 spec/lib/searchable_spec.rb
kuhsaft-2.2.4 spec/lib/searchable_spec.rb
kuhsaft-2.2.3 spec/lib/searchable_spec.rb
kuhsaft-2.2.2 spec/lib/searchable_spec.rb
kuhsaft-2.2.1 spec/lib/searchable_spec.rb
kuhsaft-2.2.0 spec/lib/searchable_spec.rb
kuhsaft-2.1.2 spec/lib/searchable_spec.rb
kuhsaft-2.1.1 spec/lib/searchable_spec.rb
kuhsaft-2.1.0 spec/lib/searchable_spec.rb
kuhsaft-1.8.6 spec/lib/searchable_spec.rb
kuhsaft-1.8.5 spec/lib/searchable_spec.rb
kuhsaft-2.0.3 spec/lib/searchable_spec.rb
kuhsaft-2.0.2 spec/lib/searchable_spec.rb
kuhsaft-1.8.4 spec/lib/searchable_spec.rb
kuhsaft-1.8.1 spec/lib/searchable_spec.rb
kuhsaft-2.0.1 spec/lib/searchable_spec.rb
kuhsaft-2.0.0 spec/lib/searchable_spec.rb
kuhsaft-1.8.0 spec/lib/searchable_spec.rb
kuhsaft-1.7.1 spec/lib/searchable_spec.rb