Commit Graph

77 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
a8dd21d8b4 Remove IdentityMap 2012-03-13 20:08:54 -03:00
Jeremy Kemper
33514a173c Get ActiveRecord::TestCase back on its feet, despite deprecation. It requires SQLCounter which was moved to AR internal tests only. 2012-02-05 23:09:09 -07:00
Vijay Dev
5850ea0560 fix a typo [ci skip] 2012-02-01 23:31:43 +05:30
Rafael Mendonça França
f944d528c4 Remove deprecation warnings from tests 2012-01-31 14:22:58 -02:00
Aaron Patterson
dcf0558ae5 Moving AR::TestCase in to the AR tests directory 2012-01-24 12:01:52 -08:00
Aaron Patterson
9342492e14 require test/unit and sort test order 2012-01-06 15:50:47 -08:00
Carlos Antonio da Silva
a6a2670243 Revert "Regexp.union seems to have different results in 1.8"
This reverts commit d80e4ee20e690dfc0f4ec31c41b873d607462872.

No need to care about 1.8 anymore, so reverting :)
2012-01-06 04:14:03 -02:00
Aaron Patterson
d2a69080f9 do not require a file that is not used 2012-01-05 11:10:52 -08:00
Aaron Patterson
bb106e9aa2 remove more uses of deprecated logger methods 2011-12-19 21:05:28 -08:00
Aaron Patterson
d80e4ee20e Regexp.union seems to have different results in 1.8 2011-12-08 10:20:14 -08:00
Aaron Patterson
a505b13774 moving ignored regexp to the instance 2011-12-07 17:42:05 -08:00
Aaron Patterson
38a8f7f8ba speeding up ignored sql testing 2011-12-07 17:32:01 -08:00
Jon Leighton
232c66a1ba If we're going to use a global variable, let's at least namespace it 2011-06-12 18:38:39 +01:00
Jon Leighton
14e6bbb149 Refactor tests to be less brittle 2011-06-12 18:19:21 +01:00
Jon Leighton
de01a64102 Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a special case in assert_queries 2011-06-12 18:19:21 +01:00
Jon Leighton
4b371b602b Print out information about whether the identity map is on or off when running unit tests 2011-06-09 20:20:51 +01:00
Aaron Patterson
517ca8771c do not muck with the load path, that is the test task responsibility 2011-06-06 15:47:26 -07:00
Jon Leighton
253bb6b926 Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. 2011-06-04 23:47:03 +01:00
Akira Matsuda
9fb51e76fd Disable IdentityMap by default for ActiveRecord testing
because enabling IM by default will possibly hide some bugs on 3.1 default behavior
2011-05-28 09:08:13 +09:00
Jason Noble
7db2ef47a1 Namespace Fixtures in ActiveRecord
[Fixes #439]
2011-05-07 14:20:51 -06:00
Emilio Tagua
f1778eb44a Run tests without IdentityMap when IM=false is given. 2011-02-15 12:40:41 -03:00
Emilio Tagua
8ee0b44148 Merge remote branch 'rails/master' into identity_map
Conflicts:
	activerecord/examples/performance.rb
	activerecord/lib/active_record/association_preload.rb
	activerecord/lib/active_record/associations.rb
	activerecord/lib/active_record/associations/association_proxy.rb
	activerecord/lib/active_record/autosave_association.rb
	activerecord/lib/active_record/base.rb
	activerecord/lib/active_record/nested_attributes.rb
	activerecord/test/cases/relations_test.rb
2011-02-15 12:01:04 -03:00
Aaron Patterson
fb09d02542 refactor fixtures to do less work in the constructor 2011-02-11 14:33:03 -08:00
Aaron Patterson
8ce57652b2 ignore max identifier length queries from pg 2011-02-08 13:38:05 -08:00
Aaron Patterson
5f1ea2a26b we do not use this method, so delete 2011-02-07 15:28:49 -08:00
Aaron Patterson
30bba95a04 update ignored SQL for oracle 2011-02-07 15:12:21 -08:00
Aaron Patterson
1193709cd6 removing some freedom patches. use notification system to count sql queries 2011-02-07 14:35:11 -08:00
Aaron Patterson
59f7780a34 adjust query counts to be consistent across databases, make sure database log the same things 2011-02-04 18:14:59 -08:00
Jon Leighton
4e19ec566c In a number of places in the tests, we only need to turn off transactional fixtures when the DB does not support savepoints. This speeds the test run up by about 8-9% on my computer, when running rake test_sqlite3_mem :) 2011-01-11 13:45:07 -08:00
Jon Leighton
80df74bf51 Enable the sqlite3 in-memory test connection to work 2011-01-11 13:45:06 -08:00
Emilio Tagua
02fc6fbccd Merge remote branch 'rails/master' into identity_map
Conflicts:
	activerecord/lib/active_record/associations/association_proxy.rb
	activerecord/lib/active_record/autosave_association.rb
	activerecord/lib/active_record/base.rb
	activerecord/lib/active_record/persistence.rb
2010-12-20 11:23:07 -03:00
Aaron Patterson
938243feb9 do not require ruby-debug automatically. please require it if you have declared it as a dependency 2010-11-19 16:26:09 -08:00
Emilio Tagua
6d58b27422 Set Identity Map disabled by default. Enable it for testing. 2010-11-19 19:08:11 -03:00
Marcin Raczkowski
ce66bfdc54 IdentityMap - misc fixes
- Added IdentityMap to be included into AR::Base
- Fixed bug with Mysql namespace missing when running tests only for sqlite
- Added sqlite as default connection
2010-11-19 19:03:57 -03:00
Aaron Patterson
9a08517c8d converted exec to exec_query for sqlite 2010-11-05 10:08:38 -07:00
Aaron Patterson
fa4686243c ignoring certain SQL when using Oracle 2010-11-03 17:34:49 -07:00
Aaron Patterson
cc468d3ec8 exec returns an AR::Result 2010-10-26 13:44:07 -07:00
Aaron Patterson
b7e4a97ab5 fixing tests. woo 2010-09-21 14:42:28 -07:00
Aaron Patterson
96bd936b64 providing arel with column information when possible [#5392 state:resolved] 2010-09-21 13:53:47 -07:00
Emilio Tagua
ae24ce52ae Move helper methods to helper.rb. Make test not depend on local TZ to pass or fail.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 15:07:43 +02:00
Piotr Sarnacki
75f8ac6ea7 Implemented ActiveRecord::Migrations#copy based on James Adam's idea
ActiveRecord::Migration#copy allows to copy migrations from one place
to another, changing migrations versions and adding scope to filename.

For example:
ActiveRecord::Migration.copy("db/migrate",
        :blog_engine => "vendor/gems/blog/db/migrate")

will copy all migrations from vendor/gems/blog/db/migrate to db/migrate
with such format:

Versions of copied migrations will be reversioned to be appended after
migrations that already exists in db/migrate
2010-09-03 22:59:09 +02:00
Xavier Noria
c8f1aac761 restricts a test to < 1.9, and rewrites it using a proper expectation
Signed-off-by: wycats <wycats@gmail.com>
2010-03-13 17:04:08 -06:00
wycats
39d6f9e112 Make many parts of Rails lazy. In order to facilitate this,
add lazy_load_hooks.rb, which allows us to declare code that
should be run at some later time. For instance, this allows
us to defer requiring ActiveRecord::Base at boot time purely
to apply configuration. Instead, we register a hook that should
apply configuration once ActiveRecord::Base is loaded.

With these changes, brings down total boot time of a
new app to 300ms in production and 400ms in dev.

TODO: rename base_hook
2010-03-07 06:24:30 -08:00
Joshua Peek
5cc17da894 activerecord test load paths 2010-02-28 18:28:25 -06:00
Carlhuda
24ab5665b2 Revert "Fix test load paths for those not using bundler"
This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818.

This commit broke tests. You cannot have a file called "bundler" on the load path.
2010-02-23 17:31:17 -08:00
Joshua Peek
eec2d301d4 Fix test load paths for those not using bundler 2010-02-15 10:20:11 -06:00
Carl Lerche
9f01dff9c2 Get rails tests running on bundler 0.9 2010-01-31 19:13:43 -08:00
Joshua Peek
e5ed62deea Autoload AR test case 2010-01-04 16:50:01 -06:00
Jeremy Kemper
949c8c0d0e Don't publicize with_scope for tests since it may shadow public misuse 2009-12-28 14:07:23 -08:00
José Valim
74098e4cb6 No need to use ValidationsRepairHelper hack on ActiveModel anymore, Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there. 2009-12-23 13:30:58 +01:00