aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/configuration_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Correct config option from only_api to api_only in testAkshay2016-02-121-1/+1
|
* Default new apps to tag logs with `request_id`schneems2016-01-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In high volume applications it can be very difficult to figure out what is happening in logs because each request is not easily identified. For example 3 requests could look something like this: ``` Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000 Rendered welcome/index.html.erb within layouts/application (0.1ms) Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000 Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000 Rendered welcome/index.html.erb within layouts/application (0.1ms) Processing by WelcomeController#index as HTML Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) Processing by WelcomeController#index as HTML Rendered welcome/index.html.erb within layouts/application (0.1ms) Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) Processing by WelcomeController#index as HTML Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) ``` The `:request_id` log tag ensures that each request is tagged with a unique identifier. While they are still interleaved it is possible to figure out which lines belong to which requests. Like: ``` [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000 [c6034478-4026-4ded-9e3c-088c76d056f1] Rendered welcome/index.html.erb within layouts/application (0.1ms) [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000 [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000 [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Rendered welcome/index.html.erb within layouts/application (0.1ms) [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Processing by WelcomeController#index as HTML [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Rendered welcome/index.html.erb within layouts/application (0.1ms) [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Processing by WelcomeController#index as HTML [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) ``` Now if you have the logs and you find this unique ID you can filter to only look at information from that request. So a filtered log output would be very clear: ``` [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000 [c6034478-4026-4ded-9e3c-088c76d056f1] Rendered welcome/index.html.erb within layouts/application (0.1ms) [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms) ``` In addition to this benefit the `:request_id` can be set via the `X-Request-ID` header so that the same request could be traced between multiple components. For example a request comes in Nginx (or another load balancer) could assign a request id. As the load balancer processes the request I can log using that id, then when the request is passed on to Rails, the same id is used. That way if a problem is determined to be not caused in Rails it could be traced back to other components with the same ID. You can set a value in nginx for example using something like this: ``` location / { proxy_pass http://upstream; proxy_set_header X-Request-Id $pid-$msec-$remote_addr-$request_length; } # http://stackoverflow.com/questions/17748735/setting-a-trace-id-in-nginx-load-balancer ``` Heroku sets this header value so problems like timeouts that are logged by like router can be traced back to specific request within the application. Whether you are using components that are setting request ID or not, all production applications can benefit from the additional debugging information of having a unique identifier for all requests. This change will only affect new applications, anyone can opt out by commenting or removing the line in `config/production.rb`.
* add option for per-form CSRF tokensBen Toews2016-01-041-1/+1
|
* ApplicationMailer should be generated by default just like every other ↵David Heinemeier Hansson2015-12-171-0/+1
| | | | Application* parent
* Merge branch 'master' into merge-action-cableRafael Mendonça França2015-12-161-0/+1
|\
| * Introduce ApplicationRecord, an Active Record layer supertypeGenadi Samokovarov2015-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's pretty common for folks to monkey patch `ActiveRecord::Base` to work around an issue or introduce extra functionality. Instead of shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can hold all those custom work the apps may need. Now, we don't wanna encourage all of the application models to inherit from `ActiveRecord::Base`, but we can encourage all the models that do, to inherit from `ApplicationRecord`. Newly generated applications have `app/models/application_record.rb` present by default. The model generators are smart enough to recognize that newly generated models have to inherit from `ApplicationRecord`, but only if it's present.
* | Accept a Pathname in Application#config_forRafael Mendonça França2015-12-151-0/+15
|/ | | | That would make possible to use it with action cable configuration.
* Internal test migrations use the private 'Current' versionMatthew Draper2015-12-151-1/+1
| | | | | | | | Apart from specific versioning support, our tests should focus on the behaviour of whatever version they're accompanying, regardless of when they were written. Application code should *not* do this.
* Make debug_exception_response_format config depends on api_only when is not setJorge Bejar2015-12-091-0/+25
|
* Add tests for api_only configuration settingJorge Bejar2015-12-091-0/+15
|
* Add enabled flag to the public file server.Kasper Timm Hansen2015-11-031-6/+16
| | | | | | | | As discussed in https://github.com/rails/rails/pull/19135#issuecomment-153385986. Replaces `serve_static_files` to unify the static options under the `public_file_server` wing. Deprecates `serve_static_files` accessors, but make them use the newer config internally.
* rails/application: allow passing an env to config_forSimon Eskildsen2015-10-301-0/+16
|
* raise `ArgumentError` when `SECRET_KEY_BASE` is an integerArun Agrawal2015-10-271-0/+13
| | | | | | | If `SECRET_KEY_BASE` or other `secret` gets passed as other then string we need to raise `ArgumentError` to know that it's a wrong argument. Closes #22072
* Merge pull request #19135 from yuki24/access-control-supportJeremy Daer2015-10-131-0/+10
|\ | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ActionDispatch::Static can accept HTTP headers so that developers will have control of returning arbitrary headers like 'Access-Control-Allow-Origin' when a response is delivered. They can be configured through `#config.public_file_server.headers`: config.public_file_server.headers = { "Cache-Control" => "public, max-age=60", "Access-Control-Allow-Origin" => "http://rubyonrails.org" } Also deprecate `config.static_cache_control` in favor of `config.public_file_server.headers`.
* | Eliminate overlapping `app/assets` load pathJeremy Daer2015-09-291-104/+128
| | | | | | | | | | | | | | | | | | | | * Move `app/assets/manifest.js` to `app/assets/config/manifest.js`. Avoid the suggestion that you can/should deep-link `stylesheets/foo`. * Pull in all toplevel stylesheets and JavaScripts, not just `application.js` and `.css`. Demonstrate how to use `link_directory` with a specified `.js`/`.css` type. * Fix RAILS_ENV handling in assets tests. * Shush warnings spam from third-party libs that distract from tests.
* | Fix typo in configuration test descritive > descriptive [ci skip]amitkumarsuroliya2015-09-261-1/+1
|/
* Merge pull request #18587 from ↵Rafael Mendonça França2015-06-031-0/+13
|\ | | | | | | | | | | chrismcg/allow_deliver_later_queue_name_to_be_configured Allow configuration of ActionMailer queue name
| * Allow configuration of ActionMailer queue nameChris McGrath2015-06-021-0/+13
| |
* | Document inline image mailer preview interceptorAndrew White2015-05-041-2/+15
| | | | | | | | Explain what the interceptor is used for and how to remove it.
* | Fix railties configuration testAndrew White2015-05-041-2/+2
|/