diff options
author | Jorge Bejar <jorge@wyeworks.com> | 2015-12-04 18:05:45 -0300 |
---|---|---|
committer | Jorge Bejar <jorge@wyeworks.com> | 2015-12-09 10:53:46 -0300 |
commit | a0343d11f1bf80a79e273c1d0cf9934ef2601e98 (patch) | |
tree | b93dee360852a4b645485e00f5ea39c862cc1a3e /railties/test | |
parent | 2430268f187332c2054c781be1d165dc8c269318 (diff) | |
download | rails-a0343d11f1bf80a79e273c1d0cf9934ef2601e98.tar.gz rails-a0343d11f1bf80a79e273c1d0cf9934ef2601e98.tar.bz2 rails-a0343d11f1bf80a79e273c1d0cf9934ef2601e98.zip |
Make debug_exception_response_format config depends on api_only when is not set
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index bb45018a86..49f63d5d31 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -1408,5 +1408,30 @@ module ApplicationTests Rails.application.load_generators assert Rails.configuration.api_only end + + test "debug_exception_response_format is :api by default if only_api is enabled" do + add_to_config <<-RUBY + config.api_only = true + RUBY + app 'development' + + assert_equal :api, Rails.configuration.debug_exception_response_format + end + + test "debug_exception_response_format can be override" do + add_to_config <<-RUBY + config.api_only = true + RUBY + + app_file 'config/environments/development.rb', <<-RUBY + Rails.application.configure do + config.debug_exception_response_format = :default + end + RUBY + + app 'development' + + assert_equal :default, Rails.configuration.debug_exception_response_format + end end end |