Sha256: affd8270eb0532901c56447d53e5d0b66ff140c6e72c24dd4280160356d2213a

Contents?: true

Size: 999 Bytes

Versions: 25

Compression:

Stored size: 999 Bytes

Contents

require 'spec_helper'

describe CassandraObject::Schema::Migration do
  context "create_column_family" do
    it "should create a new standard column family" do
      expect(Issue.connection.column_families['Foobars'].present?).to be false
      CassandraObject::Schema::Migration.create_column_family("Foobars") do |cf|
        cf.column_type = 'Standard'
        cf.comparator_type = 'UTF8Type'
        cf.default_validation_class = 'UTF8Type'
      end
      expect(Issue.connection.column_families['Foobars'].present?).to be true
    end

    it "should create a new counter column family" do
      expect(Issue.connection.column_families['FooCounters'].present?).to be false
      CassandraObject::Schema::Migration.create_column_family("FooCounters") do |cf|
        cf.column_type = 'Counter'
        cf.comparator_type = 'UTF8Type'
        cf.default_validation_class = 'UTF8Type'
      end
      expect(Issue.connection.column_families['FooCounters'].present?).to be true
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
sessionm-cassandra_object-4.0.32 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.31 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.30 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.29 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.28 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.27 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.26 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.25 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.24 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.23 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.22 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.21 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.20 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.18 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.17 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.16 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.15 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.14 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.13 spec/cassandra_object/schema/migration_spec.rb
sessionm-cassandra_object-4.0.12 spec/cassandra_object/schema/migration_spec.rb