aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
* | | | Track the version-compatible config settings inside railtiesMatthew Draper2017-03-182-22/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of forcing new applications to carry an initializer that just switches things to what their default "should" be, we can handle it internally. The initializer is then only used by upgraders: it shows what the new default would be (commented out), while their upgraded application continues to operate as it did before. Under this model, a multiply-upgraded application could accumulate several new_framework_defaults_*.rb files, for each release series it has traversed. A given release series only needs to generate the latest, though, because we don't support `rails app:upgrade` while skipping releases.
* | | | Merge pull request #28368 from y-yagi/add_test_for_secrets_commandKasper Timm Hansen2017-03-151-0/+13
|\ \ \ \ | | | | | | | | | | Add secrets edit test
| * | | | Add secrets edit testyuuji.yaginuma2017-03-121-0/+13
| | | | |
* | | | | Merge pull request #28409 from y-yagi/make_destroy_command_work_within_enginesEileen M. Uchitelle2017-03-151-0/+55
|\ \ \ \ \ | | | | | | | | | | | | Make destroy command work within engines
| * | | | | Make destroy command work within enginesyuuji.yaginuma2017-03-141-0/+55
| |/ / / / | | | | | | | | | | | | | | | | | | | | Instead of calling methods of Rails.application directly, we need to use a method that is considered for the rails engine.
* / / / / Rename test of `app:update` to more appropriate nameyuuji.yaginuma2017-03-151-7/+7
|/ / / / | | | | | | | | | | | | | | | | `rails:update` was changed to `app:update` in 6fb31638c8b61731103d4963272755b217a2df87. Therefore, I think that it is better that the test name is also `app_update`.
* | | | Merge pull request #28182 from y-yagi/show_correct_rails_commandsKasper Timm Hansen2017-03-091-0/+11
|\ \ \ \ | | | | | | | | | | Show correct commands in help
| * | | | Show correct commands in helpyuuji.yaginuma2017-03-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Currently rails' help shows only namespace. However, the secrets command needs to specify command. Therefore, I fixed the command to display in help.
* | | | | Use appropriate type in generators testyuuji.yaginuma2017-03-081-1/+1
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following thor's warning. ``` Expected string default value for '--generate'; got false (boolean) ```
* | | | Avoid running system tests by defaultRobin Dupret2017-03-051-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests may be expansive so let's only allow users to run them through `bin/rails test:system` or by passing a path to the `test` command. The same applies for `bin/rake test`. Refs #28109.
* | | | Fix random failure on system test with ajaxFumiaki MATSUSHIMA2017-03-031-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If application has ajax, browser may begin request after rollback. `teardown_fixtures` will be called after `super` on `after_teardown` so we must call `Capybara.reset_sessions!` before `super` https://github.com/rails/rails/blob/b61a56541aecd7ac685d4f19d943177a3f1b465a/activerecord/lib/active_record/fixtures.rb#L857
* | | | Move key packing into encryptor.Kasper Timm Hansen2017-03-021-3/+2
| | | |
* | | | Merge pull request #28139 from stouset/update-secrets-to-use-modern-cryptoKasper Timm Hansen2017-03-021-2/+3
|\ \ \ \ | | | | | | | | | | Update secrets to use modern crypto
| * | | | Default Secrets to AES-128-GCM, using ActiveSupport::MessageEncryptorStephen Touset2017-03-011-2/+3
| | | | | | | | | | | | | | | | | | | | Fixes #28135.
* | | | | Tell users how to assign a $EDITOR.Kasper Timm Hansen2017-03-011-0/+24
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case there's no $EDITOR assigned users would see a cryptic: ``` % EDITOR= bin/rails secrets:edit Waiting for secrets file to be saved. Abort with Ctrl-C. sh: /var/folders/wd/xnncwqp96rj0v1y2nms64mq80000gn/T/secrets.yml.enc: Permission denied New secrets encrypted and saved. ``` That error is misleading, so give a hint in this easily detectable case. Fixes #28143.
* | | | Set correct host except development environmentyuuji.yaginuma2017-02-271-0/+18
| |/ / |/| | | | | | | | | | | | | | | | | | | | Currently `localhost` is used for the default host in all environments. But up to Rails 5.0, `0.0.0.0` is used except for development. So fixed to use the same value as 5.0. Fixes #28184
* | | Merge pull request #28137 from schneems/schneems/fix-default-puma-portRichard Schneeman2017-02-241-0/+8
|\ \ \ | | | | | | | | [close #24435] Send user_supplied_options to server
| * | | [close #24435] Send user_supplied_options to serverschneems2017-02-241-0/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when Puma gets a `:Port` it doesn't know if it is Rails' default port or if it is one that is specified by a user. Because of this it assumes that the port passed in is always a user defined port and therefor 3000 always "wins" even if you specify `port` inside of the `config/puma.rb` file when booting your server with `rails s`. The fix is to record the options that are explicitly passed in from the user and pass those to the Puma server (or all servers really). Puma then has enough information to know when `:Port` is the default and when it is user defined. I went ahead and did this for all values rails server exposes as server side options for completeness. The hardest thing was converting the input say `-p` or `--port` into the appropriate "name", in this case `Port`. There may be a more straightforward way to do this with Thor, but I'm not an expert here. Move logic for parsing user options to method Better variable name for iteration Explicitly test `--port` user input ✂️ Update array if environment variables are used
* | | Merge pull request #28150 from ↵Rafael França2017-02-241-0/+7
|\ \ \ | | | | | | | | | | | | | | | | y-yagi/do_not_display_hidden_namespaces_in_generators_help does not show hidden namespaces in generator's help
| * | | does not show hidden namespaces in generator's helpyuuji.yaginuma2017-02-241-0/+7
| | | |
* | | | Merge pull request #28062 from ↵Rafael França2017-02-241-0/+15
|\ \ \ \ | |/ / / |/| | | | | | | | | | | y-yagi/make_adding_gemfile_entry_work_even_if_specify_only_the_plugin_name Make adding gemfile entry work even if specify only the plugin name
| * | | Make adding gemfile entry work even if specify only the plugin nameyuuji.yaginuma2017-02-241-0/+15
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whether the command was executed within the rails application is checked by whether or not the application's path matches `app_path`. https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/generators/rails/plugin/plugin_generator.rb#L439..L441 Therefore, if only plugin name is specified in `app_path`, addition to Gemfile is not done. However, in the rails guide an example of specifying only plugin name is given, and it is considered that there are many cases where only plugin name is specified. For that reason, made it work even if only plugin name was specified.