Sha256: d9f8a6a95dc9662ecf42c199936d0b7c9b0282598e2172cf5c2e925e056a47a7
Contents?: true
Size: 1.32 KB
Versions: 2
Compression:
Stored size: 1.32 KB
Contents
require 'spec_helper' require 'yaml' require 'spec/mocks' RAILS_ENV = 'test' module Rails class Railtie def self.initializer(*args) end end def self.root Spec::Mocks::Mock.new :join => '' end end require 'couch_potato/railtie' describe "railtie" do context 'yaml file contains only database names' do it "should set the database name from the yaml file" do File.stub(:read => "test: test_db") CouchPotato::Config.should_receive(:database_name=).with('test_db') CouchPotato.rails_init end end context 'yaml file contains more configuration' do before(:each) do File.stub(:read => "test: \n database: test_db\n validation_framework: :active_model") end it "should set the database name from the yaml file" do CouchPotato::Config.should_receive(:database_name=).with('test_db') CouchPotato.rails_init end it "should set the validation framework from the yaml file" do CouchPotato::Config.should_receive(:validation_framework=).with(:active_model) CouchPotato.rails_init end end it "should process the yml file with erb" do File.stub(:read => "test: \n database: <%= 'db' %>") CouchPotato::Config.should_receive(:database_name=).with('db') CouchPotato.rails_init end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
couch_potato-0.3.2 | spec/railtie_spec.rb |
couch_potato-0.3.1 | spec/railtie_spec.rb |