Sha256: b18d2fbc8ebd61b4e7a8d430eeee38439da69563eda74f5f750f5006081e6004
Contents?: true
Size: 967 Bytes
Versions: 2
Compression:
Stored size: 967 Bytes
Contents
require "hstore_accessor" require "database_cleaner" require "shoulda-matchers" DatabaseCleaner.strategy = :truncation RSpec.configure do |config| config.mock_with :rspec config.order = :random config.before :suite do create_database end config.before do DatabaseCleaner.clean end end def create_database ActiveRecord::Base.establish_connection( adapter: "postgresql", database: "hstore_accessor", username: "postgres" ) ActiveRecord::Base.connection.execute("CREATE EXTENSION hstore;") rescue ActiveRecord::StatementInvalid ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS products;") ActiveRecord::Base.connection.create_table(:products) do |t| t.hstore :options t.hstore :data t.string :string_type t.integer :integer_type t.boolean :boolean_type t.float :float_type t.time :time_type t.date :date_type t.datetime :datetime_type t.decimal :decimal_type end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
hstore_accessor-1.0.1 | spec/spec_helper.rb |
hstore_accessor-1.0.0 | spec/spec_helper.rb |