aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
* Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-183-4/+7
|
* Allow irb options to be passed from `rails console` commandyuuji.yaginuma2017-05-081-4/+12
| | | | Fixes #28988
* Should escape meta characters in regexpRyuta Kamizono2017-05-0711-75/+75
|
* CLI arg `--port` has precedence over env `PORT`.koshigoe2017-05-011-0/+12
|
* Also raise error when VERSION is nilRafael Mendonça França2017-04-271-0/+6
| | | | Fix #28905
* Merge pull request #28896 from pschambacher/load_with_sharedRafael França2017-04-261-0/+34
|\ | | | | Added a shared section to config/database.yml that will be loaded for all envs
| * Added a shared section to config/database.yml that will be loaded for all ↵Pierre Schambacher2017-04-261-0/+34
| | | | | | | | environments
* | Merge pull request #28897 from rafaelfranca/fix-name-error-error-pageAaron Patterson2017-04-261-0/+14
|\ \ | | | | | | Do not try to encoding the parameters when the controller is not defined
| * | Do not try to encoding the parameters when the controller is not definedRafael Mendonça França2017-04-261-0/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have a route that points to an nonexistent controller we raise an exception. This exception was being caught by the DebugExceptions middleware in development, but when trying to render the error page, we are reading the request format[[1][]]. To determine the request format we are reading the format parameters[[2][]], and to be able to read the parameters we need to encode them[[3][]]. This was raising another exception that to encode the parameter we try to load the controller to determine if we need to encode the parameters are binary[[4][]]. This new exception inside the DebugExceptions middleware makes Rails to render a generic error page. To avoid this new exception now we only encode the parameters when the controller can be loaded. Fixes #28892 [1]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb#L80 [2]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/http/mime_negotiation.rb#L63 [3]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/http/parameters.rb#L58 [4]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/http/parameters.rb#L88
* | Merge pull request #28244 from ixti/improve/action-mailer-preview-paramsRafael França2017-04-261-0/+51
|\ \ | |/ |/| Pass request params to ActionMailer::Preview
| * Pass request params to ActionMailer::PreviewAlexey Zapparov2017-03-011-0/+51
| |
* | Replace \Z to \zRyuta Kamizono2017-04-241-3/+3
| | | | | | | | \Z was a mistake of \z. Replace \Z to \z to prevent newly \Z added.
* | 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
* | Merge pull request #28708 from y-yagi/dont_generate_system_test_filesRafael França2017-04-191-0/+11
|\ \ | | | | | | Don't generate system test files if `skip_system_test` option is specified
| * | Don't generate system test files if `skip_system_test` option is specifiedyuuji.yaginuma2017-04-121-0/+11
| | |
* | | Add additional raise UnknownMigrationVersionErrorbogdanvlviv2017-04-191-1/+31
| | | | | | | | | | | | | | | Raise error on the movement of migrations when the current migration does not exist.
* | | Fix `bin/rails db:forward` first migrationbogdanvlviv2017-04-191-0/+25
| | |
* | | Merge pull request #28685 from rails/smooth-form-with-upgradingKasper Timm Hansen2017-04-171-1/+0
|\ \ \ | | | | | | | | Smooth form with upgrading
| * | | Add `form_with_generates_remote_forms` config.Kasper Timm Hansen2017-04-161-1/+0
| |/ / | | | | | | | | | | | | | | | | | | Allows users to not have remote forms by default, since there's more JS harness, e.g. bundling rails-ujs, otherwise. Also don't skip creating defaults file anymore. Sprockets isn't the only new config.
* | | Let run_secrets_generator handle chdir.Kasper Timm Hansen2017-04-161-3/+1
| | |
* | | Use the config value directly when call `secrets`yuuji.yaginuma2017-04-161-8/+26
|/ / | | | | | | | | | | | | | | | | | | | | Currently, `read_encrypted_secrets` is set with initializer. Therefore if refer to `secrets` in config, `read_encrypted_secrets` is false, so can not get the value of `secrets.yml.enc`. In order to be able to refer to secrets in config, modified to refer to `config.read_encrypted_secrets` when calling `secrets`. Fixes #28618.
* | Remove duplicated "test" prefixRyuta Kamizono2017-04-072-4/+4
| |
* | Merge pull request #28057 from eugeneius/clear_active_connectionsMatthew Draper2017-04-041-0/+8
|\ \ | | | | | | Clear active connections after initialization
| * | Clear active connections after initializationEugene Kenny2017-02-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any connections that were checked out during initialization should be checked back in before the first request is processed, for two reasons: - Returning the connection to the pool allows it to be health checked before it's used again. If the connection dies before the first request arrives, the health check will replace it with a new one. - If the thread that initialized Rails is not the same thread that will be performing work, checking in the connection will allow it to be reused instead of being stuck to the initialization thread forever.
* | | Merge pull request #28417 from schneems/schneems/symlink-failuresAndrew White2017-03-301-0/+20
|\ \ \ | | | | | | | | Raise when using a bad symlink
| * | | Raise when using a bad symlinkschneems2017-03-141-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a case where a dev made a symlink that worked on some machines and not on others. The issue manifested itself on a machine with `RAILS_ENV=staging` as the had their `config/environments/staging.rb` symlinked to another config file. The behavior was very hard to track down. Current behavior: If you use a bad symlink in a file, you get no warnings or failures or anything. If you have a bad symlink it just ignores the file as if it didn't exist (`File.exist?` returns false for a bad symlink). Patch behavior: With this patch when a file is not present we check if a symlink exists. If it does, that indicates there is a bad symlink and we should raise ``` File "config/environments/staging.rb" is a symlink that does not point to a valid file ```
* | | | Fix the tests to test what they should be testingRafael Mendonça França2017-03-271-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | With Rack::Test the headers needs to match the `HTTP_` format. The tests were passing before because they are not asserting the response was a cache hit.
* | | | Merge pull request #28557 from ↵Rafael França2017-03-271-0/+22
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | y-yagi/remove_unnecessary_files_to_api_applications_when_app_task_task_executed Remove unnecessary files to API-only Applications when `app:task` task executed
| * | | | Remove unnecessary files to API-only Applications when `app:task` task executedyuuji.yaginuma2017-03-241-0/+22
| | | | |
* | | | | Merge pull request #28546 from claudiob/drop-j-optionRafael Mendonça França2017-03-271-8/+0
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove -j (--javascript) option from `rails new`
| * | | | | Remove -j (--javascript) option from `rails new`claudiob2017-03-231-8/+0
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "-j" option was added 5 years ago (https://github.com/rails/rails/commit/d9c39c3a) when we wanted to support prototype-rails and jquery-rails. Prototype is not as popular and jQuery is not a requirement anymore. Still the "-j" option can be used to install *any* gem that ends in "-rails". This "might" open security issues and does not bring great benefits anymore. If you know which "-rails"-ending gem you want to install, you can manually add it to the Gemfile just like any other gem.
* | | | | Merge pull request #28485 from quantumlicht/fix_migrate_with_empty_versionRafael França2017-03-271-0/+16
|\ \ \ \ \ | | | | | | | | | | | | fix migrate with empty version
| * | | | | Fixes #28359Philippe Guay2017-03-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add stronger assertions to rake migration tasks to make sure the user is providing a numeric VERSION An empty string was getting converted to version = 0. This would in turn pass the presence check. Address linting warning Add test for rake task and refactor code to meet expectations In particular passing VERSION=0 should not raise an error. Addressed Comments for PR #28485. Trimmed empty lines + change of wording for error message Adjust test for change of wording in error message Change condition to follow rails idioms
* | | | | | Merge pull request #28577 from ↵Rafael França2017-03-271-0/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | y-yagi/do_not_display_hidden_namespaces_in_destroy_command_help Do not show hidden namespaces in destroy commnad help
| * | | | | | Do not show hidden namespaces in destroy commnad helpyuuji.yaginuma2017-03-271-0/+3
| |/ / / / /
* | | | | | Merge pull request #28541 from ota42y/fix/gemfile_generator_fixEileen M. Uchitelle2017-03-271-0/+24
|\ \ \ \ \ \ | |/ / / / / |/| | | | | ignore system test gems on Gemfile when execute with --skip-test option
| * | | | | ignore system test gems on Gemfile when execute with --skip-test optionota42y2017-03-271-0/+24
| |/ / / /
* / / / / add field ids when generating a scaffold form.Yves Senn2017-03-261-4/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | This is a follow up to a6d065e. When using `form_with` you must supply field ids manually. Since the scaffold generator is using labels we need to make sure that they are linked up properly.
* | | | Merge pull request #28527 from rst/fix_runner_argv_28515Rafael França2017-03-221-0/+8
|\ \ \ \ | | | | | | | | | | Correctly reset ARGV for "rails runner `CODE' arg arg arg..."
| * | | | Fixup trailing whitespace, per complaints from CodeClimate.Robert Thau2017-03-221-1/+1
| | | | |
| * | | | Correctly reset ARGV for "rails runner `CODE' arg arg arg..."Robert Thau2017-03-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code itself should not be in the ARGV vector. Fixes #28515
* | | | | Merge pull request #28513 from maclover7/jm-fix-28500Rafael França2017-03-221-0/+8
|\ \ \ \ \ | | | | | | | | | | | | CLI arg "host" has precedence over ENV var "host"
| * | | | | CLI arg "host" has precedence over ENV var "host"Jon Moss2017-03-211-0/+8
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression from when the server command switched to its own argument parser, as opposed to Rack's. Rack's argument parser, when provided with a "host" argument, gives that value precedence over environment variables.
* / / / / Don't comment out config.file_watcher during Rails upgradeyuuji.yaginuma2017-03-221-14/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | This is necessary only when updating to Rails 5.0, it is not necessary for updating to 5.1. Related #24243
* | | | Default to yielding a `form` variable.Kasper Timm Hansen2017-03-201-4/+4
| | | | | | | | | | | | | | | | More intention revealing and means `f` can go F itself 😋
* | | | Add `app:update` task to enginesyuuji.yaginuma2017-03-201-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Occasionally we update the file generated by engine. Therefore, I think that there is a task for updating as well as application in the engine, it is convenient for updating.
* | | | Merge pull request #28481 from y-yagi/fix_warningKasper Timm Hansen2017-03-201-3/+3
|\ \ \ \ | | | | | | | | | | Fix `warning: character class has duplicated range`
| * | | | Fix `warning: character class has duplicated range`yuuji.yaginuma2017-03-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following warnings: ``` railties/test/generators/encrypted_secrets_generator_test.rb:15: warning: character class has duplicated range: /[\w\d]+/ railties/test/generators/encrypted_secrets_generator_test.rb:18: warning: character class has duplicated range: /production:\n# external_api_key: [\w\d]+/ railties/test/generators/encrypted_secrets_generator_test.rb:19: warning: character class has duplicated range: /production:\n# external_api_key: [\w\d]+/ ```
* | | | | Correctly check whether key is defined in configurationyuuji.yaginuma2017-03-192-1/+13
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can not check correctly with `defined?` ```ruby irb(main):001:0> Rails.application.config.active_record => {:maintain_test_schema=>true, :belongs_to_required_by_default=>true} irb(main):002:0> defined?(Rails.application.config.active_record) => nil ``` Follow up to #28469