Sha256: 4651b162d86032ca2fb6677d4a614de40a778aee0fde362a8edaadf4d9099652

Contents?: true

Size: 514 Bytes

Versions: 3

Compression:

Stored size: 514 Bytes

Contents

require "spec_helper"

describe UsesOtherYml do
  before do
    ActiveRecord::Base.send(:include, MultiConfig::ORMs::ActiveRecord)
    UsesOtherYml.config_file = 'other'
  end

  it "should be connected to the default database" do
    UsesOtherYml.connection.instance_variable_get(:@config)[:database].split('/').last.should == "other_db"
  end

  it "the @@db_configs should have entry for this class" do
    UsesOtherYml.send(:class_variable_get,:'@@db_configs').should == {"other" => ["UsesOtherYml"]}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
multi_config-0.1.6 spec/models/uses_other_yml_spec.rb
multi_config-0.1.1 spec/models/uses_other_yml_spec.rb
multi_config-0.1.0 spec/models/uses_other_yml_spec.rb