Sha256: 338e8cd68b39ee03b2b77f23fec6294a2b42c7cac44f6c9e657248ff18455fb0
Contents?: true
Size: 949 Bytes
Versions: 1
Compression:
Stored size: 949 Bytes
Contents
require 'spec_helper' shared_examples_for "a db based apartment adapter" do include Apartment::Spec::AdapterRequirements let(:default_database){ subject.process{ ActiveRecord::Base.connection.current_database } } describe "#init" do it "should process model exclusions" do Apartment.configure do |config| config.excluded_models = ["Company"] end Apartment::Database.init Company.connection.object_id.should_not == ActiveRecord::Base.connection.object_id end end describe "#drop" do it "should raise an error for unknown database" do expect { subject.drop 'unknown_database' }.to raise_error(Apartment::DatabaseNotFound) end end describe "#switch" do it "should raise an error if database is invalid" do expect { subject.switch 'unknown_database' }.to raise_error(Apartment::DatabaseNotFound) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
apartment-0.15.0 | spec/examples/db_adapter_examples.rb |