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
Joshua Peek
7ee5843c3c
Fully expand relative rails framework paths and make sure we aren't
...
adding any to the load path more than once.
2009-12-16 11:56:51 -06:00
Joshua Peek
11e798ae0f
Avoid adding component lib/ to load path multiple times
2009-11-09 23:28:36 -06:00
Yehuda Katz + Carl Lerche
4f6d6f7031
Have all the tests running off a single Gemfile
2009-10-20 16:34:44 -07:00
Jeremy Kemper
2767036392
Use bundled env for tests only
2009-10-19 19:00:48 -07:00
José Valim
4f37b97033
Changed ActiveRecord to use new callbacks and speed up observers by only notifying events that are actually being consumed.
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
Yehuda Katz + Carl Lerche
7583a24ee0
Move mocha down below initial T::U require and bump version to 0.9.7 [ #2858 state:resolved]
2009-07-01 11:53:17 -07:00
Joshua Peek
69742ca8fa
Merge branch 'master' into active_model
...
Conflicts:
activemodel/lib/active_model/core.rb
activemodel/test/cases/state_machine/event_test.rb
activemodel/test/cases/state_machine/state_transition_test.rb
activerecord/lib/active_record/validations.rb
activerecord/test/cases/validations/i18n_validation_test.rb
activeresource/lib/active_resource.rb
activeresource/test/abstract_unit.rb
2009-05-29 16:06:21 -05:00
Mislav Marohnić
b33c0d9832
replace the aaa_create_tables_test hack with loading test database schema in the test helper [ #2663 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-17 13:51:35 -05:00
Jeremy Kemper
e8550ee032
Cherry-pick core extensions
2009-05-13 12:00:15 -07:00
Pratik Naik
5b1a1bf5bf
Make Active Model test suite similar to Active Record
2009-03-20 10:32:24 +00:00
Jeremy Kemper
278186534c
Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha.
2009-02-03 18:40:22 -08:00
Pratik Naik
3b1cd9e525
Fix has_and_belongs_to_many_associations tests. #1738
2009-01-18 00:34:57 +00:00