aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/rake_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #22967 from schneems/schneems/generic-metadataSean Griffin2016-01-081-0/+20
|\ | | | | Prevent destructive action on production database
| * Prevent destructive action on production databaseschneems2016-01-071-0/+20
| | | | | | | | | | | | | | This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd. It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large. To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
* | ApplicationMailer should be generated by default just like every other ↵David Heinemeier Hansson2015-12-171-1/+1
| | | | | | | | Application* parent
* | Merge pull request #22567 from gsamokovarov/introduce-application-recordRafael França2015-12-161-1/+1
|\ \ | |/ |/| Introduce ApplicationRecord, an Active Record layer supertype
| * Introduce ApplicationRecord, an Active Record layer supertypeGenadi Samokovarov2015-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's pretty common for folks to monkey patch `ActiveRecord::Base` to work around an issue or introduce extra functionality. Instead of shoving even more stuff in `ActiveRecord::Base`, `ApplicationRecord` can hold all those custom work the apps may need. Now, we don't wanna encourage all of the application models to inherit from `ActiveRecord::Base`, but we can encourage all the models that do, to inherit from `ApplicationRecord`. Newly generated applications have `app/models/application_record.rb` present by default. The model generators are smart enough to recognize that newly generated models have to inherit from `ApplicationRecord`, but only if it's present.
* | Run railties generated app tests in test enveileencodes2015-12-151-3/+3
|/ | | | | | | | | | | | | | | | | | Running railties generated app tests in development env can cause unintended consequences. The environments are different and tests aren't meant to be run in development mode. The changes to the generator exposed this issue where the random test order in the generated apps could cause problems when those tests are run in development mode. Particularly we saw failures in `railties/test/application/rake_test.rb` generated apps that used the scaffold to create applications and then run the migration and immediately run the tests. The error we saw was `ActiveRecord::RecordNotFound: Couldn't find User with 'id'=980190962` and seemed to only occur if the destroy test ran first. I'm not entirely sure _why_ this causes that error to be thrown but I believe it is related to the environments being different.
* File encoding is defaulted to utf-8 in Ruby >= 2.1Akira Matsuda2015-09-181-1/+0
|
* tests, railties tests should use `bin/` executables when possible.Yves Senn2015-06-301-37/+37
| | | | | We recommend using the `bin/` executables in our docs and guides. Let's make sure that our tests execute the same code path.
* Fix failing tests for Rails-APISean Griffin2015-06-111-1/+1
| | | | This looks to be just out of sync tests
* config.api_only = true implies config.generators.api_only = trueSantiago Pastorino2015-06-111-1/+0
|
* API apps scaffold generator generates an apropriate controllerSantiago Pastorino2015-06-111-0/+20
|
* Add test to ensure tmp:clear works when tmp is missingYoong Kang Lim2015-05-301-0/+7
| | | | See #20299.
* Removed `assigns` from functional_test templatesPrathamesh Sonpatki2015-05-021-2/+2
| | | | | - Based on DHH's suggestion about deprecating `assigns` in https://github.com/rails/rails/pull/18305#issuecomment-68605166.
* Add explicit base class for ActiveJob jobsJeroen van Baarsen2015-03-231-1/+1
| | | | | | | | * Jobs generated now inherent from ApplicationJob * ApplicationJob inherents from ActiveJob::Base * Added entry to changelog Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* Require `belongs_to` by default.Josef Šimánek2015-02-211-1/+4
| | | | Deprecate `required` option in favor of `optional` for belongs_to.
* Use `SCHEMA` instead of `DB_STRUCTURE` for specifiying structure file.Dieter Komendera2015-01-081-1/+1
| | | | | `rake test:load_structure` already uses `SCHEMA` and there's no need to maintain two different env vars.
* Make the rails:template rake task load initializersRobin Dupret2014-03-081-0/+11
| | | | | | | | | | | Templates could rely on irregular inflections or external libraries for instance so we should load the application's initializers when running the rails:template task. The introducing commit of this feature is f7f11361 ; the initializers have never been loaded invoking this task. Fixes #12133.
* Automatically maintain test database schemaJon Leighton2014-01-021-2/+2
| | | | | | | | | | | | | | * Move check from generated helper to test_help.rb, so that all applications can benefit * Rather than just raising when the test schema has pending migrations, try to load in the schema and only raise if there are pending migrations afterwards * Opt out of the check by setting config.active_record.maintain_test_schema = false * Deprecate db:test:* tasks. The test helper is now fully responsible for maintaining the test schema, so we don't need rake tasks for this. This is also a speed improvement since we're no longer reloading the test database on every call to "rake test".
* Regression test for load_structure and clone_structureArthur Neves2013-12-141-2/+4
|
* Build fix for new routing inspector changesArun Agrawal2013-11-221-2/+2
| | | | | | Broken by 6701b4cf41f6f3d9cfc6a93715acbf852d1e468e
* Fix for routes taskSıtkı Bağdat2013-11-211-2/+2
| | | | This commit fixes formatting issue for `rake routes` task, when a section is shorter than a header.
* More Warnings removed for ruby trunkArun Agrawal2013-11-011-5/+5
| | | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* #11381: Ignore config.eager_load=true for rakePaul Nikitochkin2013-07-101-17/+19
| | | | Closes #11381
* Removing deprecated rake tasks.wangjohn2013-06-241-39/+0
| | | | | The `rake test:recent` and `rake test:uncommitted` tasks were deprecated and are now being removed.
* Calls to the application constant have been refactored to usewangjohn2013-06-101-4/+4
| | | | | Rails.application when drawing routes and creating other configurations on the application.
* Removing use of subclassed application constant and instead using thewangjohn2013-06-031-1/+1
| | | | | more agnostic Rails.application syntax. This means tests will be more portable, and won't rely on the existence of a particular subclass.
* Fixing a failing railtie test by using the ENV variable to specify awangjohn2013-05-311-1/+2
| | | | particular controller to search for in rake routes.
* Adding a test to make sure that using rake routes with the CONTROLLERwangjohn2013-05-291-0/+12
| | | | environment works correctly.
* Updates to make rails 4 happy with minitest 5:Ryan Davis2013-05-061-2/+2
| | | | | | | | | | + Namespace changes, overhaul of runners. + Internal ivar name changes - Removed a logger globally applied to tests that spew everywhere?!? + Override Minitest#__run to sort tests by name. + Reworked testing isolation to work with the new cleaner architecture. - Removed a bunch of tests that just test minitest straight up. I think these changes were all merged to minitest 4 a long time ago. - Minor report output differences.
* Added tests for `eager_load` config option to do not eager load for rake ↵Paul Nikitochkin2013-04-121-0/+17
| | | | tasks if `eager_load` is `true`
* Merge branch 'master' into railstestAaron Patterson2013-04-051-0/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (44 commits) Improve the changelog entry [ci skip] Fix explicit names on multiple file fields Correctly parse bigint defaults in PostgreSQL Move changelog to the top [ci skip] Fix indent and remove extra white spaces Fix scope chaining + STI failing test for #9869 Improve `belongs_to touch: true` timestamp test Sort modules in alphabetical order. Avoid an attempt to fetch old record when id was not present in touch callback Use the correct pk field from the reflected class to find the old record Refactor mail_to to not generate intermediate hashes when adding href Ensure mail_to helper does not modify the given html options hash Use inspect when writing the foreign key from the reflection Use a space after the comment sign when showing the result of commands Exclude template files for rdoc API [ci skip] template should have generic name use | to have more intent revealing code Revert "Merge pull request #10034 from benofsky/fix_skipping_object_callback_filters" stop depending on callbacks ... Conflicts: railties/test/application/rake_test.rb
| * fix warnings in railties testVipul A M2013-04-041-3/+3
| |
* | test no longer makes sense after requiring all test filesAaron Patterson2013-04-031-23/+1
| |
* | Revert "Update Rake tasks to call `rails test` instead"Aaron Patterson2013-04-031-13/+10
|/ | | | This reverts commit b51673fbd9563bd3ffa22e22255ca1cef80cfb6d.
* Update Rake tasks to call `rails test` insteadPrem Sichanugrist2013-03-091-10/+13
| | | | | Also, print out deprecation warning for other rake tasks except `rake test` and `rake` (default)
* Fix rake routes output in railties testCarlos Antonio da Silva2013-02-191-2/+4
|
* editorial tweaksXavier Noria2013-02-191-1/+1
|
* Use strip_heredoc in the tests as well.Steve Klabnik2013-02-181-5/+6
| | | | Thanks @sikachu. :sweat_smile:
* Add message when you have no routes defined.Steve Klabnik2013-02-181-0/+15
| | | | | | Print a message in both `rake routes` and at GET "/rails/info/routes" that lets you know you have no routes defined, as well as linking to the Rails Guide on the topic.
* Ensure the scaffold tests will pass when using references attributesRafael Mendonça França2012-12-101-0/+10
|
* Remove observers and sweepersRafael Mendonça França2012-11-281-22/+0
| | | | | | | | They was extracted from a plugin. See https://github.com/rails/rails-observers [Rafael Mendonça França + Steve Klabnik]
* Unused variable warning removedRashmi Yadav2012-11-271-1/+0
|
* Rake test:uncommitted finds git directory in ancestors.Nicolas Despres2012-11-101-0/+29
| | | | | | | | | | | | | Sometimes your git directory is an ancestor of your application root directory. For example: ./repo/.git/ ./repo/app/Rakefile In this case rake test:uncommitted will be unable to detect your SCM. This patch fixes this and add a test.
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-5/+5
|
* Update test locationsMike Moore2012-10-091-6/+6
| | | | | | | | | | | | | | Change the default test locations to avoid confusion around the common testing terms "unit" and "functional". Add new rake tasks for the new locations, while maintaining backwards compatibility with the old rake tasks. New testing locations are as follows: app/models -> test/models (was test/units) app/helpers -> test/helpers (was test/units/helpers) app/controllers -> test/controllers (was test/functional) app/mailers -> test/mailers (was test/functional)
* Get rid of config.preload_frameworks in favor of config.eager_load_namespacesJosé Valim2012-08-211-1/+0
| | | | | | | The new option allows any Ruby namespace to be registered and set up for eager load. We are effectively exposing the structure existing in Rails since v3.0 for all developers in order to make their applications thread-safe and CoW friendly.
* Allow users to choose when to eager_load the application or not.José Valim2012-08-211-0/+24
| | | | | | | | | | | | | | | | | Previously, the eager load behavior was mostly coupled to config.cache_classes, however this was suboptimal since in some environments a developer may want to cache classes but not necessarily load them all on boot (for example, test env). This pull request also promotes the use of config.eager_load set to true by default in production. In the majority of the cases, this is the behavior you want since it will copy most of your app into memory on boot (which was also the previous behavior). Finally, this fix a long standing Rails bug where it was impossible to access a model in a rake task when Rails was set as thread safe.
* Fix wrong testcase. This is a testcase for db:test:prepare.kennyj2012-06-281-1/+1
|
* Change the behavior of db:test:prepare task when schema_format is sql for ↵kennyj2012-06-261-0/+9
| | | | consistency.
* Change the behavior of db:test:clone task when schema_format is sql for ↵kennyj2012-06-261-0/+9
| | | | consistency.