Sha256: 1e134d134cef7994adf337e35a477fed50fa3e901473e8d619137868e3c3d6c3

Contents?: true

Size: 861 Bytes

Versions: 5

Compression:

Stored size: 861 Bytes

Contents

require 'spec_helper'

describe Storey::Hstore do
  describe '.install' do
    it 'should install the extension into the hstore schema' do
      Storey.persistent_schemas = %w(hstore)
      described_class.install
      expect { ActiveRecord::Base.connection.execute "DROP EXTENSION hstore" }.
        to_not raise_error(ActiveRecord::StatementInvalid)
    end

    context 'when hstore is not one of the persistent schemas' do
      it 'should fail with an StoreyError' do
        Storey.persistent_schemas = []
        message = 'You are attempting to install hstore data type, but the hstore schema (where the data type will be installed) is not one of the persistent schemas. Please add hstore to the list of persistent schemas.'
        expect { described_class.install }.
          to raise_error(Storey::StoreyError, message)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
storey-0.4.1 spec/storey/hstore_spec.rb
storey-0.4.0 spec/storey/hstore_spec.rb
storey-0.3.6 spec/storey/hstore_spec.rb
storey-0.3.5 spec/storey/hstore_spec.rb
storey-0.3.4 spec/storey/hstore_spec.rb