aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #18100 from chancancode/serve_static_filesGodfrey Chan2014-12-194-5/+61
| | | | | | Allow static asset serving from env variable (enhanced!) Conflicts: railties/CHANGELOG.md
* `db:structure:load` and `db:schema:load` no longer purge the database.Yves Senn2014-12-181-0/+25
| | | | | | | | | | | | | | | | | Closes #17945 `db:test:prepare` still purges the database to always keep the test database in a consistent state. This patch introduces new problems with `db:schema:load`. Prior to the introduction of foreign-keys, we could run this file against a non-empty database. Since every `create_table` containted the `force: true` option, this would recreate tables when loading the schema. However with foreign-keys in place, `force: true` wont work anymore and the task will crash. /cc @schneems
* fixing mailer previews for apps with globbing routeOleg2014-12-031-0/+11
|
* Fix "nonexistent" typo in testsMelissa Xie2014-12-021-1/+1
|
* Merge pull request #17866 from bogdan/default-form-builderSantiago Pastorino2014-12-011-0/+39
|\ | | | | Bugfix config.action_view.default_form_builder option
| * Bugfix config.action_view.default_form_builder optionBogdan Gusiev2014-12-011-0/+39
| |
* | Pure rack apps can be mounted with a nameJean Boussier2014-11-291-0/+20
|/ | | | See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
* 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-251-0/+25
| | | | This removes the unwanted deprecation warnings in the tests
* :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-041-0/+13
| |
* | Revert "Replace String index juggling with Pathname goodness in ↵yuuji.yaginuma2014-11-021-0/+10
|/ | | | | | | | db:fixtures:load" This reverts commit 482fdad5ef8a73688b50bba3991dd4ef6f286edd. Fixes #17237.
* UrlGenerationError are not catched as 404 anymoreJean Boussier2014-10-271-0/+15
|
* 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 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
* 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.
* Add `test:jobs` taskyuuji.yaginuma2014-09-151-3/+14
|
* 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
| |
* | 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.
* Add test to assert the right sanitizer vendor is being usedRafael Mendonça França2014-09-011-0/+41
|
* Expectations firstAkira Matsuda2014-08-283-4/+4
|
* Refactor ActionDispatch::RemoteIpSam Aarons2014-08-211-1/+15
| | | | | | | | | | | | | Refactored IP address checking in ActionDispatch::RemoteIp to rely on the IPAddr class instead of the unwieldly regular expression to match IP addresses. This commit keeps the same api but allows users to pass IPAddr objects to config.action_dispatch.trusted_proxies in addition to passing strings and regular expressions. Example: # config/environments/production.rb config.action_dispatch.trusted_proxies = IPAddr.new('4.8.15.0/16')
* Fix setting simple values to the new config.xCarlos Antonio da Silva2014-08-191-5/+12
| | | | | | | | | | Previously setting simple values to the config.x object resulted in the following: config.x.super_debugger = true config.x.super_debugger #=> {} Which was against the examples showed in the changelog/release notes.
* Revert "Improve custom configuration"Rafael Mendonça França2014-08-192-79/+8
| | | | | | | | | This reverts commit de4891344ccc074f6d5693f4fac6ad610584e336. Conflicts: railties/lib/rails/railtie/configuration.rb It added regression. Will be back after the beta
* Improve custom configurationRafael Mendonça França2014-08-192-8/+79
| | | | | | | | | | | | | | | | 1. Hashes can be assigned 2. We don't need a special level anymore The method chain only works in the top level. If users need a second level they need to assign a OrderedOptions to the key: config.resque.server = ActiveSupport::OrderedOptions.new config.resque.server.url = "http://localhost" config.resque.server.port = 3000 [Rafael Mendonça França + Carlos Antonio da Silva]
* add a new constructor that runs load hooksAaron Patterson2014-08-071-5/+5
|
* Revert "Revert "Merge pull request #15394 from ↵Yves Senn2014-08-061-1/+90
| | | | | | morgoth/fix-automatic-maintaining-test-schema-for-sql-format"" This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
* We don't need parenthesis for thisGuillermo Iguaran2014-08-051-1/+1
|
* Fix digest ETAG test.Arthur Neves2014-08-051-1/+1
| | | | | | After https://github.com/rack/rack/commit/12528d4567d8e6c1c7e9422fee6cd8b43c4389bf ETag will include a `W/` before the digest.
* Pull in the custom configuration concept from dhh/custom_configurationDavid Heinemeier Hansson2014-08-032-0/+52
|
* Remove some more globals from testsCarlos Antonio da Silva2014-07-301-26/+26
| | | | | We are using blocks here so we have access to the environment around them, no need for globals.
* Fix / improve some assertionsCarlos Antonio da Silva2014-07-301-6/+4
|
* Remove some globals from configuration testsCarlos Antonio da Silva2014-07-301-20/+20
|
* Deprecate `*_path` methods in mailers@schneems and @sgrif2014-07-302-2/+54
| | | | | | | | | | | Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead. Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR. Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead. The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`. Paired @sgrif & @schneems
* Do not set enforce_available_locales to i18n 0.7Rafael Mendonça França2014-07-231-18/+2
| | | | | | Now the default is always true. Users still can set it using config.i18n.enforce_available_locales.
* Merge branch 'rm-remove-mocha'Rafael Mendonça França2014-07-192-10/+28
|\ | | | | | | | | Conflicts: actionpack/test/abstract_unit.rb
| * Set the application logger using configurationRafael Mendonça França2014-07-071-3/+5
| |
| * Stop using mocha on configuration_testRafael Mendonça França2014-07-071-7/+23
| |
* | Add Rails::Application#config_forRafael Mendonça França2014-07-151-0/+84
|/ | | | | This is a convenience for loading configuration for the current Rails environment.
* Revert "Merge pull request #15394 from ↵Rafael Mendonça França2014-07-021-90/+1
| | | | | | | | | | morgoth/fix-automatic-maintaining-test-schema-for-sql-format" This reverts commit 46139d33c06715e74ad450428ece3ee84da98579, reversing changes made to 8f247871bb18b2e3036a05df5f62cbfe3b402586. Conflicts: activerecord/CHANGELOG.md
* Rename preview_enabled option to show_previewsRafael Mendonça França2014-07-012-10/+10
|