aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
|
* Add configuration to enable mail previewsLeonard Garvey2014-07-012-0/+38
| | | | | | | | | | | | | | | | | | Adds `config.action_mailer.preview_enabled` This allows mail previewing to be enabled easily in non-development environments such as staging. The default is set to true for development so no changes should be required to existing Rails applications. The mail preview path can still be configured using the existing `config.action_mailer.preview_path` configuration option. Adding this avoids devs from having to do stuff like: https://gist.github.com/lengarvey/fa2c9bd6cdbeba96526a Update actionmailer/CHANGELOG with new configuration. Update configuring guide with new configuratation. Add `config.action_mailer.preview_path` to configuring guide.
* Merge pull request #15933 from rafael/masterRafael Mendonça França2014-06-271-0/+38
|\ | | | | | | | | | | Add always permitted parameters as a configurable option. [Rafael Mendonça França + Gary S. Weaver]
| * Improvements per code review.Rafael Chacón2014-06-271-0/+25
| | | | | | | | | | | | * General style fixes. * Add changes to configuration guide. * Add missing tests.
| * Add always_permitted_parameters as an option.Rafael Chacón2014-06-261-0/+13
| | | | | | | | | | | | | | | | | | * This commit adds back the always_permitted_parameters configuration option to strong paramaters. * The initial pull requests where this feature was added are the following: - https://github.com/rails/rails/pull/12682 - https://github.com/rails/strong_parameters/pull/174
* | Add a test for db:migrate:status to check missing file scenarioViktar Basharymau2014-06-271-0/+15
| |
* | allow preview interceptors to be registered through `config.action_mailer`.Yves Senn2014-06-151-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was partially broken because `preview_interceptors=` just assigned the raw values, whithout going through `register_preview_interceptor`. Now the Action Mailer railtie takes care of the `preview_interceptors` option. This commit is a partial revert of: Revert "Merge pull request #15739 from y-yagi/correct_doc_for_action_mailer_base" This reverts commit a15704d7f35f17d34d0118546799141d6f853656, reversing changes made to 1bd12a8609d275ad75fcc4b622ca4f5b32dc76be. /cc @kuldeepaggarwal @y-yagi
* | Fixed automatic maintaining test schema to properly handle sql structure ↵Wojciech Wnętrzak2014-06-121-2/+52
| | | | | | | | | | | | | | | | | | schema format. Additionally: * It changes `purge` task on `sqlite3` adapter to recreate database file, to be consistent with other adapters. * Adds `purge` step when loading from `schema.rb`
* | Added missing test case for migrations when using sql structureWojciech Wnętrzak2014-06-011-1/+40
| |
* | Default config.assets.digests to true in developmentDan Kang2014-05-171-14/+11
| |
* | This is also a modelRafael Mendonça França2014-05-121-1/+1
| |
* | Merge pull request #15015 from pothibo/database-configurationRafael Mendonça França2014-05-071-0/+16
|\ \ | | | | | | Use Rails::Paths::Path#existent in database_configuration
| * | Use Rails::Paths::Path#existent in database_configurationPier-Olivier Thibault2014-05-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Database configuration was trying to load the first path that config.paths['config/database'] was returning even if the path didn't exist in the filesystem. Because Rails::Paths::Path has the possibility to return more than 1 path (as an array), database_configuration should filter down the paths to the existing one and then load the first one. This would make it possible to move the database.yml file and add the new path to paths['config/database'] and still load the configurations.
* | | Return a non zero code when db has never been setup on statusPaul B2014-05-071-1/+1
|/ /
* | Precompile the image we're referencing, too.Matthew Draper2014-04-241-2/+2
| | | | | | | | | | | | | | | | | | | | You can't compile a file that references a non-compiled asset's path. .. unless you turn off asset runtime errors. Outside of a test case like this, `config.assets.precompile` would normally retain its default entry, which precompiles all images (and other non-JS/CSS files) that are in `app/assets`.
* | Make console and generators blocks works at Application instance levelRafael Mendonça França2014-04-142-0/+96
| | | | | | | | | | | | | | Like rake tasks and runner blocks these blocks should also being shared between applications since they are stored at the classes. Fixes #14748