Sha256: cb07da162882ec31fb1aeb2ce84ff90a25a1a264f09b06235585b0443501150d

Contents?: true

Size: 599 Bytes

Versions: 4

Compression:

Stored size: 599 Bytes

Contents

require 'spec_helper'

describe Storey, "dealing with excluded_models" do
  before do
    Storey.configuration.excluded_models = %w(Company)
    # In practice, `excluded_models` is not set on the fly, but since we do so
    # in the tests, we must call `init` to set the models to the right tables:
    Storey.init
  end

  it "should always reference these models in the public schema" do
    Storey.create("foo") { Company.create :name => "company_1" }
    Company.create :name => "company_2"

    expect(Company.count).to eq 2
    Storey.switch("foo") { expect(Company.count).to eq 2 }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
storey-2.2.0 spec/storey/excluded_models_spec.rb
storey-2.1.2 spec/storey/excluded_models_spec.rb
storey-2.1.1 spec/storey/excluded_models_spec.rb
storey-2.1.0 spec/storey/excluded_models_spec.rb