Sha256: 7bb9c76f2528d6bc6c391cae69c3fc19905953b38100ff1a017b9e5cd6bbb5cc

Contents?: true

Size: 814 Bytes

Versions: 4

Compression:

Stored size: 814 Bytes

Contents

require 'spec_helper'

describe Storey::Hstore do
  describe '.install' do
    it 'installs 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
    end

    context 'hstore is not one of the persistent schemas' do
      it 'fails 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

4 entries across 4 versions & 1 rubygems

Version Path
storey-2.0.2 spec/storey/hstore_spec.rb
storey-2.0.1 spec/storey/hstore_spec.rb
storey-2.0.0 spec/storey/hstore_spec.rb
storey-1.0.0 spec/storey/hstore_spec.rb