Sha256: 832ba02902bcfce39699bc839e3bea6776468ee18bcfd533483cd47e0c4b494f

Contents?: true

Size: 1.79 KB

Versions: 3

Compression:

Stored size: 1.79 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../../../example_helper")

describe Micronaut::Rails::Configuration do

  example "loading micronaut rails include it in the micronaut configuration class" do
    Micronaut::Configuration.included_modules.should include(Micronaut::Rails::Configuration)
  end
  
  it "should add a #rails method" do
    Micronaut.configuration.should respond_to(:rails)
  end
  
  it "should add an #enable_active_record_transactional_support method" do
    Micronaut.configuration.should respond_to(:enable_active_record_transactional_support)
  end
  
  describe "helpers for standard Rails testing support" do
    
    method_to_modules = { :enable_helper_support => Micronaut::Rails::Helpers,
                          :enable_active_record_transactional_support => Micronaut::Rails::TransactionalDatabaseSupport,
                          :enable_controller_support => Micronaut::Rails::Controllers
                        }
    method_to_modules.each do |method, mod| 
      example "##{method} with no filter options" do
        Micronaut.configuration.send(method)
        Micronaut.configuration.extra_modules.should include([:extend, mod, {}])
      end
      
      example "##{method} with filter options" do
        filter_options = {:options => { "foo" => "bar" } }
        Micronaut.configuration.send(method, filter_options)
        Micronaut.configuration.extra_modules.should include([:extend, mod, filter_options])
      end
    end
    
    example "#enable_rails_specific_mocking_extensions for mocha with no filter options" do
      Micronaut.configuration.mock_with :mocha
      Micronaut.configuration.enable_rails_specific_mocking_extensions
      Micronaut.configuration.extra_modules.should include([:include, Micronaut::Rails::Mocking::WithMocha, {}])
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spicycode-micronaut-rails-0.0.6.2 examples/lib/micronaut/rails/configuration_example.rb
spicycode-micronaut-rails-0.1.7.0 examples/lib/micronaut/rails/configuration_example.rb
spicycode-micronaut-rails-0.1.7.1 examples/lib/micronaut/rails/configuration_example.rb