Sha256: 3bc7765b266b868c7924b69dd9320ec294cfc7304e5196acb32c931b30366c44

Contents?: true

Size: 849 Bytes

Versions: 2

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Combustion::Database do
  it "creates dummy table from migration in base database" do
    expect(Model.connection.table_exists?("dummy_table")).to eq true
    expect(Model.connection.table_exists?("dummy_in_another_db")).to eq false
  end

  it "creates another dummy table from another database" do
    expect(ModelInAnotherDb.connection.table_exists?("dummy_table")).
      to eq false
    expect(ModelInAnotherDb.connection.table_exists?("dummy_in_another_db")).
      to eq true
  end

  it "returns test database for model with default connection" do
    expect(Model.connection_config[:database]).to match(/test/)
  end

  it "returns test_another for model with connection to second database" do
    expect(ModelInAnotherDb.connection_config[:database]).
      to match(/test_another/)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
combustion-1.3.0 spec/database_spec.rb
combustion-1.2.0 spec/database_spec.rb