aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/configuration_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix RuboCop offensesKoichi ITO2017-08-161-2/+2
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* Add test case to make sure Parameters configuration are executed onceRafael Mendonça França2017-08-151-0/+10
| | | | Test case for #30045
* Adding frozen_string_literal pragma to Railties.Pat Allan2017-08-141-0/+2
|
* Merge pull request #29559 from kirs/eager-load-controller-actionsRafael França2017-08-111-0/+60
|\ | | | | Eager load controller actions to reduce response time of the first request
| * Eager load controller and mailer actionsKir Shatrov2017-07-291-0/+60
| | | | | | | | | | | | | | | | | | | | | | On the first request, ActionController::Base#action_methods computes and memoized the list of available actions [1]. With this PR we move this expensive operation into eager load step to reduce response time of the first request served in production. This also reduces the memory footprint when running on forking server like Unicorn. [1] https://github.com/rails/rails/blob/a3813dce9a0c950a4af7909111fa730a2622b1db/actionpack/lib/abstract_controller/base.rb#L66-L77
* | Check for `app.secrets.secret_key_base`, not `app.config.secret_key_base`George Claghorn2017-08-051-3/+1
| | | | | | | | By default, apps only have the former set.
* | Generating the app is where the exception is now raisedDavid Heinemeier Hansson2017-08-031-1/+1
|/
* Rename helper to force_lazy_load_hooks.Kasper Timm Hansen2017-07-171-14/+14
| | | | | | Clarifies the intent that aren't just loading the model but really caring about triggering the on_load callbacks.
* add helper method for explicit lazy loadyuuji.yaginuma2017-07-161-13/+18
|
* Set `represent_boolean_as_integer` via `configuration`yuuji.yaginuma2017-07-161-0/+18
|
* Change sqlite3 boolean serialization to use 1 and 0Lisa Ugray2017-07-111-0/+28
| | | | | | | | | | | | | | | | | | | | Abstract boolean serialization has been using 't' and 'f', with MySQL overriding that to use 1 and 0. This has the advantage that SQLite natively recognizes 1 and 0 as true and false, but does not natively recognize 't' and 'f'. This change in serialization requires a migration of stored boolean data for SQLite databases, so it's implemented behind a configuration flag whose default false value is deprecated. The flag itself can be deprecated in a future version of Rails. While loaded models will give the correct result for boolean columns without migrating old data, where() clauses will interact incorrectly with old data. While working in this area, also change the abstract adapter to use `"TRUE"` and `"FALSE"` as quoted values and `true` and `false` for unquoted. These are supported by PostreSQL, and MySQL remains overriden.
* Protect from forgery by defaultLisa Ugray2017-07-101-0/+7
| | | | | | | | Rather than protecting from forgery in the generated ApplicationController, add it to ActionController::Base by config. This configuration defaults to false to support older versions which have removed it from their ApplicationController, but is set to true for Rails 5.2.
* Merge pull request #29677 from eugeneius/parameters_configuration_testsRafael Mendonça França2017-07-051-0/+36
|\ | | | | | | Fix Parameters configuration integration tests
| * Fix Parameters configuration integration testsEugene Kenny2017-07-041-0/+41
| | | | | | | | | | | | | | | | | | These tests relied on `ActionController::Parameters` being configured as part of the boot process; since that now happens lazily we need to force `ActionController::Base` to load so that we can test the behaviour. The new tests added here ensure that `ActionController::Parameters` can be configured from an initializer, which was broken until recently.
* | Force ActionController::Base lazy laod hooks to runRafael Mendonça França2017-07-051-0/+12
|/ | | | | | | Now that the parameters configurations are only loaded when ActionController::Base is we need to foce them to load in our tests. In an application this is not needed since every request already load the controllers.
* Remove redundant `assert_respond_to`Ryuta Kamizono2017-07-031-3/+0
| | | | It is covered by following assertion.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Added a shared section to config/database.yml that will be loaded for all ↵Pierre Schambacher2017-04-261-0/+34
| | | | environments
* Set to `form_with_generates_remote_forms` only when config is explicitly ↵yuuji.yaginuma2017-04-221-0/+28
| | | | | | | | | specified Without this check, even if config is not specified, `ActionView::Helpers::FormHelper.form_with_generates_remote_forms` always be set to nil and remote form not be generated. Follow up to 128b804c6ce40fcbde744f294f8cb98654f6efec
* Configure form_with_generates_remote_forms in its own initializerRafael Mendonça França2017-04-211-0/+32
| | | | | | | | | This configuration is not present in ActionView::Base so we can't let the action_view.set_configs initializer set it. Also add tests to make sure this config works. Fixes #28824
* Correct spellingBenjamin Fleischer2017-02-051-2/+2
| | | | | | | ``` go get -u github.com/client9/misspell/cmd/misspell misspell -w -error -source=text . ```
* correctly check error messageyuuji.yaginuma2017-01-251-2/+4
| | | | | | | `assert_raise` does not check error message. However, in some tests, it seems like expecting error message checking with `assert_raise`. Instead of specifying an error message in `assert_raise`, modify to use another assert to check the error message.
* Merge pull request #27399 from sinogermany/rails-env-for-empty-string-env-varsRafael Mendonça França2017-01-031-0/+12
|\ | | | | | | Rails env for empty string env vars
| * Rails.env falls back to dev mode when env var is emptyDaniel Deng2017-01-041-0/+12
| |
* | Fix configuration test now that Metal#env was removedRafael Mendonça França2017-01-031-1/+1
| |
* | Remove deprecated config.serve_static_filesRafael Mendonça França2017-01-031-10/+0
| |
* | Remove deprecated `config.static_cache_control`Rafael Mendonça França2017-01-031-10/+0
| |
* | "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-251-3/+3
|/
* Remove aggressive unit test with mock. And add integration level test.Taishi Kasuga2016-11-241-0/+19
|
* deep symbolize keys on secrets.ymlIsaac Sloan2016-11-211-0/+14
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-3/+3
|
* Remove deprecated support to :text in renderRafael Mendonça França2016-10-101-9/+9
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-3/+3
|
* applies new string literal convention in railties/testXavier Noria2016-08-061-200/+200
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Merge pull request #25438 from prathamesh-sonpatki/rm-session-store-initializerRafael Mendonça França2016-07-201-0/+16
|\ | | | | | | Setup default session store internally, no longer through an initializer
| * Setup default session store internally, no longer through an application ↵Prathamesh Sonpatki2016-07-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | initializer - By default the session store will be set to cookie store with application name as session key. - Older apps are not affected as they will have the session store initializer generated by Rails in older versions, and Rails will not overwrite the session store if it is already set or disabled. - But new apps will not have the initializer, instead the session store will be set to cookie store by default. - Based on comment by DHH here - https://github.com/rails/rails/issues/25181#issuecomment-222312764.
* | remove unnecessary sendyuuji.yaginuma2016-07-101-5/+5
|/ | | | | `class_variable_get` is public from Ruby 1.9. Ref: http://ruby-doc.org/core-2.2.0/Module.html#method-i-class_variable_get
* Merge pull request #25652 from prathamesh-sonpatki/rm-boot-railsGuillermo Iguaran2016-07-081-2/+1
|\ | | | | Remove unused boot_rails method and it's usage
| * Remove unused boot_rails method and it's usagePrathamesh Sonpatki2016-07-041-2/+1
| | | | | | | | | | - The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b. - So let's remove it and its usage.
* | Fix typo in test caseAbhishek Jain2016-07-081-1/+1
|/
* Added a shared section to config/secrets.yml that will be loaded for all ↵David Heinemeier Hansson2016-05-211-0/+25
| | | | environments
* Fix some typos in comments.Joe Rafaniello2016-05-041-1/+1
| | | | [ci skip]
* Fix test nameVipul A M2016-04-231-1/+1
|
* Fixed couple of semantics in the configuration_test.rbAkshay2016-02-281-2/+2
|
* Show permitted flag in the output of AC::Parameters#inspectPrathamesh Sonpatki2016-02-241-1/+1
| | | | - Fixes #23822.
* Alternative to #23638 log to STDOUT via env varschneems2016-02-171-0/+11
| | | | | | People who deploy to containers or other places where they might have some sort of a log wrapping service use stdout. With this change new rails apps can be configured to output to STDOUT via setting `RAILS_LOG_TO_STDOUT` to any value. This allows container images or services to set the value for all apps without having to modify configuration for each application. If an app wants to opt out, they can either delete from the env hash, or remove that configuration. cc/ @rafaelfranca
* Implement ActionController::Parameters#inspectBenjamin Quorning2016-02-171-1/+1
| | | | Now that AC::Parameters is no longer a Hash, it shouldn't look like a hash.