Sha256: 6728583fcb29a86e6f25fc6e14536fc67f8a73954e3872ad52b1326bb89ae1ee

Contents?: true

Size: 1010 Bytes

Versions: 2

Compression:

Stored size: 1010 Bytes

Contents

require 'spec_helper'

module SandthornDriverSequel2
	describe Migration do
		def check_tables context = nil
			events = :events
			snapshots = :snapshots
			if context
				events = "#{context}_#{events}".to_sym
				snapshots = "#{context}_#{snapshots}".to_sym
			end
			migration.driver.execute do |db|
				expect(db.table_exists? events).to be_truthy, "expected table :#{events} to exist, but it didn't"
				expect(db.table_exists? snapshots).to be_truthy, "expected table :#{snapshots} to exist, but it didn't"
			end
		end
		let(:migration) { Migration.new url: event_store_url, context: context  }
		before(:each) { migration.migrate! }
		context "when default (nil) eventstore contex" do
			let(:context) { nil }
			it "should create the tables events, aggregates and snapshots" do
				check_tables
			end
		end
		context "when specifying context" do
			let(:context) { :another_domain }
			it "should create the tables events, aggregates and snapshots" do
				check_tables context
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sandthorn_driver_sequel_2-0.0.2 spec/migration_specifying_domain_spec.rb
sandthorn_driver_sequel_2-0.0.1 spec/migration_specifying_domain_spec.rb