aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
Commit message (Collapse)AuthorAgeFilesLines
* Generators add foreign keys on referencesDerek Prior2014-11-252-1/+46
| | | | | | | | | | | If you run a generator such as: ``` rails generate model accounts supplier:references ``` The resulting migration will now add the corresponding foreign key constraint unless the reference was specified to be polymorphic.
* bring back `db:test:prepare`.Yves Senn2014-11-252-9/+92
| | | | | | | | | | | | | | | This reverts deprecations added in #13528. The task is brought back for two reasons: 1. Give plugins a way to hook into the test database initialization process 2. Give the user a way to force a test database synchronization While `test:prepare` is still a dependency of every test task, `db:test:prepare` no longer hooks into it. This means that `test:prepare` runs before the schema is synchronized. Plugins, which insert data can now hook into `db:test:prepare`. The automatic schema maintenance can't detect when a migration is rolled-back, modified and reapplied. In this case the user has to fall back to `db:test:prepare` to force the synchronization to happen.
* tests, run `test_test.rb` with `RAILS_ENV=test`.Yves Senn2014-11-251-1/+1
| | | | | | The tests to verify our testing setup used `RAILS_ENV=development` to execute the tests. Let's keep it as close to a real-world setup as possible.
* Added tests for log_level deprecationGodfrey Chan2014-11-251-13/+18
| | | | | | Closes #17756 [Godfrey Chan, Zachary Scott]
* Set the test_order in the basic app as well, see 58e8b48Godfrey Chan2014-11-252-0/+26
| | | | This removes the unwanted deprecation warnings in the tests
* Set the default log_level to info in all testsGodfrey Chan2014-11-251-0/+1
| | | | | | | | | This is a follow-up to 116de07. That change was for two reasons: 1) speed up the tests by reducing the amount of log lines 2) avoid a deprecation warning from a6de6f5. This setting need to be on the basic app too, otherwise the deprecation warning will show up on other unrelated test cases.
* Merge pull request #17757 from zzak/railties-default-to-debug-log_levelGodfrey Chan2014-11-251-0/+1
|\ | | | | Always default the log_level to :info for Railties
| * Always default the log_level to :info for RailtiesZachary Scott2014-11-241-0/+1
| |
* | Generate mailer layouts even if no action is given.Guo Xiang Tan2014-11-251-0/+2
| |
* | Add tests which were incorrectly removed.Guo Xiang Tan2014-11-252-0/+6
| |
* | Creates an ApplicationMailer and layout by default, including html and body ↵Andy Jeffries2014-11-212-10/+22
|/ | | | tags to reduce spam score
* :scissors:Rafael Mendonça França2014-11-101-1/+1
|
* No need to sync config.secret_token and secrets.secret_tokenRafael Mendonça França2014-11-101-34/+2
| | | | Just prefer secrets over config
* Merge pull request #16535 from bf4/patch-1Rafael Mendonça França2014-11-104-11/+150
|\ | | | | | | Allow fallback to LegacyKeyGenerator when secret_key_base is not set but secrets.secret_token is
| * `secret_token` is now saved in `Rails.application.secrets.secret_token`Benjamin Fleischer2014-11-024-11/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `secrets.secret_token` is now used in all places `config.secret_token` was - `secrets.secret_token`, when not present in `config/secrets.yml`, now falls back to the value of `config.secret_token` - when `secrets.secret_token` is set, it over-writes `config.secret_token` so they are the same (for backwards-compatibility) - Update docs to reference app.secrets in all places - Remove references to `config.secret_token`, `config.secret_key_base` - Warn that missing secret_key_base is deprecated - Add tests for secret_token, key_generator, and message_verifier - the legacy key generator is used with the message verifier when secrets.secret_key_base is blank and secret_token is set - app.key_generator raises when neither secrets.secret_key_base nor secret_token are set - app.env_config raises when neither secrets.secret_key_base nor secret_token are set - Add changelog Run focused tests via ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
* | add lib to $LOAD_PATH on application inhertence. fixes #17106Aaron Patterson2014-11-041-1/+2
| |
* | add a test for #17106Aaron Patterson2014-11-042-0/+22
| |
* | Revert "Replace String index juggling with Pathname goodness in ↵yuuji.yaginuma2014-11-021-0/+10
|/ | | | | | | | db:fixtures:load" This reverts commit 482fdad5ef8a73688b50bba3991dd4ef6f286edd. Fixes #17237.
* Merge pull request #17408 from bf4/fix_rbx_testYves Senn2014-10-281-1/+1
|\ | | | | Fix rbx generated Gemfile regex
| * Fix rbx generated Gemfile regexBenjamin Fleischer2014-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | https://travis-ci.org/rails/rails/jobs/39190983#L460 1) Failure: AppGeneratorTest#test_psych_gem [test/generators/app_generator_test.rb:495]: Expected /gem 'psych',\s+'~> 2.0', \s+platforms: :rbx/ to match <snip> http://git.io/uuLVag)\ngem 'psych', '~> 2.0', platforms: :rbx\n\n
* | Merge pull request #16229 from byroot/stop-swallowing-url-generation-errorsAndrew White2014-10-271-0/+15
|\ \ | |/ |/| UrlGenerationError are not catched as 404 anymore
| * UrlGenerationError are not catched as 404 anymoreJean Boussier2014-10-271-0/+15
| |
* | Add back --skip-turbolinks and remove --skip-gemsRafael Mendonça França2014-10-261-3/+2
|/ | | | | | | For the most part of cases --skip-gems option just remove one line in the Gemfile. This is not worth for the complexity it adds. Closes #17196
* :nail_care: it's -> its (see comments on 9a586ac)Godfrey Chan2014-10-181-1/+1
|
* [ci skip] A Rails engine is not a man :ok_woman:Zachary Scott2014-10-181-1/+1
|
* test, `Generators::GeneratedAttribute` with references, required, index.Yves Senn2014-10-161-0/+8
| | | | | | | | | | | | | Closes #17197. Closes #17207. `{required}` is a type modifier so it should be: user:references{required}:index and not: user:references:index{required}
* Don't need to account turbolinks cookies in get request.Rafael Mendonça França2014-10-131-6/+6
| | | | | | | It was changed to not set the cookie in get requests at https://github.com/rails/turbolinks/commit/62cc3db457ad9745ccda047dd43ab84fb3d89707. Related with dcb05f26.
* fix test_helper for mountable pluginmasarakki2014-10-131-0/+4
|
* Remove unused codeRafael Mendonça França2014-09-251-12/+1
|
* Remove --skip-action-view option from application generatorDan Olson2014-09-241-5/+0
|
* Fix another false assertionsYuki Nishijima2014-09-211-1/+1
| | | | | | | | | | | | * The assertions in AS::Duration don't actually assert. * The assertion in Railtie will pass even when `eager_load_namespaces` doesn't include `AppTemplate::Application` if `Rails.application` is truthy. For more details, see here: * https://github.com/rails/rails/pull/16998 * https://github.com/rails/rails/pull/17000
* Merge pull request #16936 from untidy-hair/plugin_test_db_migrate_pathRafael Mendonça França2014-09-181-3/+12
|\ | | | | | | | | | | | | Specify dummy app's db migrate path in plugin's test_helper.rb Conflicts: railties/CHANGELOG.md
| * Specify dummy app's db migrate path in plugin's test_helper.rbYukio Mizuta2014-09-161-3/+12
| |
* | inject Rack::Lock if config.eager_load is falseXavier Noria2014-09-181-2/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | If code is not eager loaded constants are loaded on demand. Constant autoloading is not thread-safe, so if eager loading is not enabled multi-threading should not be allowed. This showed up in certain Capybara scenarios: Most Capybara drivers other than Rack::Test need a web server. In particular, drivers for JavaScript support. Capybara launches WEBrick in its own thread for those but that per se is fine, because the spec thread and the server thread are coordinated. Problem comes if the page being served in the spec makes Ajax calls. Those may hit WEBrick in parallel, and since WEBrick is multi-threaded and allow_concurrency? returns true in the test environment before this patch, threads are spawned to serve those parallel requests. On the other hand, since eager_load is false by default in the test environment, constants are not preloaded. So the suite is autoloading constants in a multi-threaded set. That's a receipt for paracetamol. The symptom is random obscure errors whose messages point somehow to constant autoloading. As a consequence of this fix for allow_concurrency? WEBrick in Capybara scenarios no longer runs in multi-threaded mode. Fixes #15089.
* Merge pull request #16914 from untidy-hair/fix_plugin_dummy_path_errorRafael Mendonça França2014-09-161-1/+4
|\ | | | | Use dynamic path for dummy app location in plugin's test_helper.rb
| * Use dynamic path for dummy app location in plugin's test_helper.rbYukio Mizuta2014-09-141-1/+4
| |
* | Add `test:jobs` taskyuuji.yaginuma2014-09-151-3/+14
|/
* Always define capture to remove the deprecation messageRafael Mendonça França2014-09-111-17/+15
|
* Define the configuration at Active SupportRafael Mendonça França2014-09-112-0/+2
|
* Set test order in ActiveSupport::TestCase of isolation/abstract_unitRafael Mendonça França2014-09-101-0/+2
|
* Set the test order to be random in the generated appRafael Mendonça França2014-09-101-0/+1
| | | | | | This will avoid the warning in our tests. We delete all the config/environments/ files in the test app so our default code will not work.
* Merge pull request #16839 from chancancode/default_test_orderRafael Mendonça França2014-09-101-1/+1
|\ | | | | | | Default to sorting user's test cases for now
| * Default to sorting user's test cases for nowGodfrey Chan2014-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | Goals: 1. Default to :random for newly generated applications 2. Default to :sorted for existing applications with a warning 3. Only show the warning once 4. Only show the warning if the app actually uses AS::TestCase Fixes #16769
* | Tell the user which file is missing when config/database.yml was not foundAkira Matsuda2014-09-101-0/+9
|/ | | | | | Since cc03675d30b58e28f585720dad14e947a57ff5b the error message became like "Could not load database configuration. No such file -" which doesn't really tell what's actually missing.
* build fix, we have to reset the RACK_ENV as well.Yves Senn2014-09-041-2/+5
| | | | | This is a follow-up to ded17a4 to get the build passing on Travis. As Travis has `ENV["RACK_ENV"]` set to `test` we need to reset that as well.
* Merge pull request #16775 from kaspth/ship-secure-sanitizerRafael Mendonça França2014-09-031-41/+0
|\ | | | | Ship with rails-html-sanitizer instead.
| * Ship with rails-html-sanitizer instead.Kasper Timm Hansen2014-09-031-41/+0
| |
* | Merge pull request #16756 from huoxito/dont-mess-railties-default-orderRafael Mendonça França2014-09-031-0/+36
|\ \ | | | | | | Dont mess with default order engines load (4.1.6.rc1 regression)
| * | Dont mess with default order engines loadWashington Luiz2014-09-021-0/+36
| | | | | | | | | | | | | | | | | | | | | When copying migrations some engines might depend on schema from other engine so we can't blindly reverse all railties collection as that would affect the order they were originally loaded. This patch helps to only apply the order from engines specified in `railties_order`
* | | schema loading rake tasks maintain database connection for current env.Yves Senn2014-09-031-0/+26
| |/ |/| | | | | | | | | | | | | | | | | [Joshua Cody & Yves Senn] Closes #16757. Prior to this patch schema loading rake tasks had the potential to leak a connection to a different database. This had side-effects when rake tasks operating on the current connection (like `db:seed`) were chained.