aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | 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
* | | | 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