Sha256: 6c932b3019d9a890a2dfa0a04f14b2d7bcf453dcd5ad7c13bd6d301d1c007041
Contents?: true
Size: 993 Bytes
Versions: 23
Compression:
Stored size: 993 Bytes
Contents
require 'spec_helper' describe ActiveRecord::Turntable do before(:all) do ActiveRecord::Base.send(:include, ActiveRecord::Turntable) end context "#config_file" do it "should return Rails.root/config/turntable.yml default" do unless defined?(::Rails); class ::Rails; end; end allow(Rails).to receive(:root) { "/path/to/rails_root" } ActiveRecord::Base.turntable_config_file = nil expect(ActiveRecord::Base.turntable_config_file).to eq("/path/to/rails_root/config/turntable.yml") end end context "#config_file=" do it "should set config_file" do ActiveRecord::Base.send(:include, ActiveRecord::Turntable) filename = "hogefuga" ActiveRecord::Base.turntable_config_file = filename expect(ActiveRecord::Base.turntable_config_file).to eq(filename) end end context "#config" do subject { ActiveRecord::Base.turntable_config } it { is_expected.to be_instance_of(ActiveRecord::Turntable::Config) } end end
Version data entries
23 entries across 23 versions & 1 rubygems