aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Protect from forgery by defaultLisa Ugray2017-07-102-1/+8
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* / | | | * Don't eagerly require Rails' minitest plugin.Kasper Timm Hansen2017-07-102-5/+8
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making the Rails minitest behave like a standard minitest plugin we're much more likely to not break when people use other minitest plugins. Like minitest-focus and pride. To do this, we need to behave like minitest: require files up front and then perform the plugin behavior via the at_exit hook. This also saves us a fair bit of wrangling with test file loading. Finally, since the environment and warnings options have to be applied as early as possible, and since minitest loads plugins at_exit, they have to be moved to the test command. * Don't expect the root method. It's likely this worked because we eagerly loaded the Rails minitest plugin and that somehow defined a root method on `Rails`. * Assign a backtrace to failed exceptions. Otherwise Minitest pukes when attempting to filter the backtrace (which Rails' backtrace cleaner then removes). Means the exception message test has to be revised too. This is likely caused by the rails minitest plugin now being loaded for these tests and assigning a default backtrace cleaner.
* | | | Merge pull request #29721 from y-yagi/fix_29696Kasper Timm Hansen2017-07-091-0/+34
|\ \ \ \ | | | | | | | | | | Treat secrets as binary
| * | | | Treat secrets as binaryyuuji.yaginuma2017-07-091-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until Rails 5.1.1 secrets was treated as binary inside Rails. https://github.com/rails/rails/blob/v5.1.1/railties/lib/rails/secrets.rb#L59 https://github.com/rails/rails/blob/v5.1.1/railties/lib/rails/secrets.rb#L63 However, it is treated as String in Rails 5.1.2(changed by 157db872103429e8782b62d1cb5d1d91337177a7). https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/secrets.rb#L104 https://github.com/rails/rails/blob/v5.1.2/railties/lib/rails/secrets.rb#L108 As a result, when upgrading from Rails 5.1.1 to 5.1.2, to write the value treated as binary using `File.write`, causing an error. In order to avoid `UndefinedConversionError`, fixed it to treat it as binary like 5.1.1. Fixes #29696
* | | | | Load environment file in `dbconsole` commandyuuji.yaginuma2017-07-091-0/+66
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the environment file is not loaded in `dbconsole` command. Therefore, for example, if use encrypted secrets values in database.yml, `read_encrypted_secrets` will not be true, so the value can not be used correctly. Fixes #29717
* | | | Merge pull request #29695 from y-yagi/secrets_showMatthew Draper2017-07-092-1/+14
|\ \ \ \ | | | | | | | | | | Add `rails secrets:show` command
| * | | | Add `rails secrets:show` commandyuuji.yaginuma2017-07-072-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When secrets confirmed with the `secrets:edit` command, `secrets.yml.enc` will change without updating the secrets. Therefore, even if only want to check secrets, the difference will come out. This is a little inconvenient. In order to solve this problem, added the `secrets:show` command. If just want to check secrets, no difference will occur use this command.
* | | | | Merge pull request #29705 from y-yagi/do_not_update_secrets_yml_encMatthew Draper2017-07-091-0/+18
|\ \ \ \ \ | | | | | | | | | | | | Do not update `secrets.yml.enc` when secretes do not change
| * | | | | Do not update `secrets.yml.enc` when secretes do not changeyuuji.yaginuma2017-07-071-0/+18
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if open a file with `secrets:edit` command, `secrets.yml.enc` will be changed even if its contents do not change. Therefore, even if only want to check secrets, the difference will come out. This is a little inconvenient. As a fix to the above problem, when content does not change, `secrets.yml.ecn` is fixed so that it is not changed.
* / / / / Update default app files in app_generator_testKoichi ITO2017-07-061-2/+40
|/ / / /
* | | | Allow mounting same engine under several locationsDavid Rodríguez2017-07-051-0/+86
| | | |
* | | | 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.
* | | | Move test related to `tmp:clear` task to `tmp_test.rb`yuuji.yaginuma2017-07-022-7/+7
| | | |
* | | | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-02117-117/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* | | | Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-02117-0/+117
|\ \ \ \ | | | | | | | | | | | | | | | Enforce frozen string in Rubocop
| * | | | Enforce frozen string in RubocopKir Shatrov2017-07-01116-0/+116
| | | | |
* | | | | Merge pull request #29534 from y-yagi/clear_screenshots_in_tmp_clear_taskEileen M. Uchitelle2017-07-011-0/+36
|\ \ \ \ \ | | | | | | | | | | | | Clear screenshots files in `tmp:clear` task
| * | | | | Clear screenshots files in `tmp:clear` taskyuuji.yaginuma2017-06-271-0/+36
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If system test fails, it creates screenshot under `tmp/screenshots`. https://github.com/rails/rails/blob/34fe2a4fc778d18b7fe6bdf3629c1481bee789b9/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb#L45 But currently, screenshot files is not cleared by `tmp:clear` task. This patch make clears screenshot files with `tmp:clear` task as well as other tmp files.
* | | | | Merge pull request #29418 from dinahshi/scaffold_system_testsEileen M. Uchitelle2017-06-302-2/+36
|\ \ \ \ \ | |/ / / / |/| | | | Add system tests to generate scaffold
| * | | | Add system tests to generate scaffoldDinah Shi2017-06-302-2/+36
| | | | |
* | | | | Add `railtie.rb` to the plugin generatorTsukuru Tanimichi2017-06-261-0/+2
| | | | |
* | | | | Deprecate an `capify!` method in generators and templatesyuuji.yaginuma2017-06-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `capify` command has been removed by Capistrano 3 and became to `cap install`. Therefore, the `capify!` method has no meaning in Capistrano 3. I think that should deprecate. Ref: https://github.com/capistrano/capistrano/commit/492793916acf32ffe1604daec6fd4892c8935018
* | | | | Use `require_relative` instead of `require` with full pathbogdanvlviv2017-06-142-4/+4
|/ / / /
* | | / Make i18n test match the description of the testGuillermo Iguaran2017-06-091-1/+1
| |_|/ |/| |
* | | Replace therubyracer with mini_racerSam2017-05-301-1/+1
| | |
* | | Do not use UTF8 in test SecretsCommandTest#test_edit_secretsPavel Valena2017-05-301-1/+1
| |/ |/|
* | Merge pull request #29146 from y-yagi/fix_29138Kasper Timm Hansen2017-05-281-0/+6
|\ \ | | | | | | Correctly set user_supplied_options when there is no whitespace in option specification
| * | Correctly set user_supplied_options when there is no whitespace in option ↵yuuji.yaginuma2017-05-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specification Current `user_supplied_options` method can not set the value correctly if there is no space between option and value (e.g., `-p9000`). This makes it possible to set the value correctly in the case like the above. Fixes #29138
* | | Merge pull request #28132 from mikeycgto/aead-encrypted-cookiesKasper Timm Hansen2017-05-281-9/+84
|\ \ \ | | | | | | | | AEAD encrypted cookies and sessions
| * | | AEAD encrypted cookies and sessionsMichael Coyne2017-05-221-9/+84
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes encrypted cookies from AES in CBC HMAC mode to Authenticated Encryption using AES-GCM. It also provides a cookie jar to transparently upgrade encrypted cookies to this new scheme. Some other notable changes include: - There is a new application configuration value: +use_authenticated_cookie_encryption+. When enabled, AEAD encrypted cookies will be used. - +cookies.signed+ does not raise a +TypeError+ now if the name of an encrypted cookie is used. Encrypted cookies using the same key as signed cookies would be verified and serialization would then fail due the message still be encrypted.
* | | Make reset execution assertions easier to read.Kasper Timm Hansen2017-05-281-15/+11
| | | | | | | | | | | | | | | The app is booted by then, so there's no need to stash the code away in some other script.
* | | Includes namespace in system test skelton when namespace is specifiedyuuji.yaginuma2017-05-281-0/+5
| | | | | | | | | | | | Fixes #29247
* | | Use models to match the docs.Kasper Timm Hansen2017-05-271-1/+1
| | |
* | | ActiveSupport::CurrentAttributes provides a thread-isolated attributes ↵David Heinemeier Hansson2017-05-261-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | singleton (#29180) * Add ActiveSupport::CurrentAttributes to provide a thread-isolated attributes singleton * Need to require first * Move stubs into test namespace. Thus they won't conflict with other Current and Person stubs. * End of the line for you, whitespace! * Support super in attribute methods. Define instance level accessors in an included module such that `super` in an overriden accessor works, akin to Active Model. * Spare users the manual require. Follow the example of concerns, autoload in the top level Active Support file. * Add bidelegation support * Rename #expose to #set. Simpler, clearer * Automatically reset every instance. Skips the need for users to actively embed something that resets their CurrentAttributes instances. * Fix test name; add tangible name value when blank. * Try to ensure we run after a request as well. * Delegate all missing methods to the instance This allows regular `delegate` to serve, so we don't need bidelegate. * Properly test resetting after execution cycle. Also remove the stale puts debugging. * Update documentation to match new autoreset
* | | Merge pull request #29176 from bogdanvlviv/define-path-with__dir__Matthew Draper2017-05-2610-16/+16
|\ \ \ | | | | | | | | Define path with __dir__
| * | | Define path with __dir__bogdanvlviv2017-05-2310-16/+16
| |/ / | | | | | | | | | | | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
* | | Remove redundant test methodAndy Atkinson2017-05-251-7/+1
| | |
* | | Reorder first secrets edit flow.Kasper Timm Hansen2017-05-251-5/+2
|/ / | | | | | | | | | | Setup config/secrets.yml.enc with template contents for people to edit. Then generate encryption key and encrypt the initial secrets.
* | 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