1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test/application/configuration/custom_test.rb
Carlos Antonio da Silva 2f7ac9cdcc Fix setting simple values to the new config.x
Previously setting simple values to the config.x object resulted in the
following:

    config.x.super_debugger = true
    config.x.super_debugger #=> {}

Which was against the examples showed in the changelog/release notes.
2014-08-19 21:59:01 -03:00

22 lines
805 B
Ruby

require 'application/configuration/base_test'
class ApplicationTests::ConfigurationTests::CustomTest < ApplicationTests::ConfigurationTests::BaseTest
test 'access custom configuration point' do
add_to_config <<-RUBY
config.x.payment_processing.schedule = :daily
config.x.payment_processing.retries = 3
config.x.super_debugger = true
config.x.hyper_debugger = false
config.x.nil_debugger = nil
RUBY
require_environment
x = Rails.configuration.x
assert_equal :daily, x.payment_processing.schedule
assert_equal 3, x.payment_processing.retries
assert_equal true, x.super_debugger
assert_equal false, x.hyper_debugger
assert_equal nil, x.nil_debugger
assert_nil x.i_do_not_exist.zomg
end
end