Commit Graph

35 Commits

Author SHA1 Message Date
Aaron Patterson
7837574e5b namespace the adapter test 2011-11-29 14:02:58 -08:00
Aaron Patterson
bd2f5c062d pushing caching and visitors down to the connection 2011-11-19 20:19:53 -08:00
Jon Leighton
7db90aa7c7 Make it the responsibility of the connection to hold onto an ARel visitor for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now. 2011-08-08 23:28:23 +01:00
Raimonds Simanovskis
58af0d46cf Fixed test_disable_referential_integrity on Oracle
On Oracle disable_referential_integrity before execution of block will disable foreign key constraints and after block will enable them but when constraints are enabled then they are validated. Therefore created record with invalid foreign key should be deleted before enabling foreign key constraints.
2011-08-08 22:32:26 +03:00
Aaron Patterson
f4ed975125 move around tests 2011-07-21 11:54:29 -07:00
Terence Lee
16921437a1 fix postgres connection url test 2011-07-20 16:23:31 -07:00
Glenn Gillen
16249feaab Added test for postgres connections as URL. Fixed query param parsing. 2011-07-20 16:23:31 -07:00
Glenn Gillen
89357c8f83 Provide database connection settings as a URL. 2011-07-20 16:23:31 -07:00
Gabriel Sobrinho
5399471820 Create a test case for disable_referential_integrity 2011-07-01 10:04:10 -03:00
Aaron Patterson
61774e0d49 please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
Jon Leighton
523c7c2330 Fix adapter_test.rb to make no assumptions about the database name 2011-06-05 11:28:17 +01: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
Aaron Patterson
60cf65def8 herp derpricating add_limit_offset! 2011-01-03 15:59:13 -08:00
Master Lambaster
a7cae64104 Fix test which prevents connection reset on failing and remove hardcoded connection
[#4689 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 15:28:14 -07:00
Emilio Tagua
ab2877cbe8 Add parentheses to avoid warnings when running AR tests.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 21:16:19 +02:00
Raimonds Simanovskis
05ef038bb9 Fixed adapter tests not to assert LIMIT and OFFSET in SQL strings
Fixed adapter test cases that were failing in oracle because the asserts were looking for the presence of offset and limit which are not available in oracle. Changed the tests to check that the sql injection is not present in the output so that the tests are database adapter agnostic.
2010-06-04 22:44:03 +03:00
Michael Koziarski
1e3dce08e1 Revert "When creating database with rake, create schemas in schema_search_path if it doesn't exist."
This reverts commit 6c2a0675f11a9b5b8e88ed7dbccd65cb51be8029.

Reverting because it breaks the ability to run tests using a non-superuser.

Conflicts:

	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
	activerecord/lib/active_record/railties/databases.rake
2010-04-09 11:30:40 +12:00
Rizwan Reza
6c2a0675f1 When creating database with rake, create schemas in schema_search_path if it doesn't exist. 2010-03-28 11:01:15 +04:30
Emilio Tagua
e3a2fae05d Add add_limit_offset! to adapters. 2010-03-25 12:37:38 -03:00
Emilio Tagua
0e2fbd80e2 Merge commit 'rails/master'
Conflicts:
	activerecord/lib/active_record/calculations.rb
	activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
2009-08-10 18:07:33 -03:00
Tristan Dunn
1af9bd58a0 No longer require database name for MySQL to allow cross database selects.
[#1122 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:35:57 -07:00
Emilio Tagua
9520143159 Merge commit 'rails/master'
Conflicts:
	activerecord/test/cases/adapter_test.rb
	activerecord/test/cases/method_scoping_test.rb
2009-08-08 19:14:35 -03:00
Raimonds Simanovskis
53be10c5e6 fixed test_foreign_key_violations_are_translated_to_specific_exception to work with Oracle 2009-08-06 23:41:00 +03:00
Rob Christie
7e560d0b0d Fixed adapter test cases that were failing in oracle because the asserts were looking for the presence of offset and limit which are not available in oracle. Changed the tests to check that the sql injection is not present in the output so that the tests are database adapter agnostic. 2009-08-06 23:40:58 +03:00
Emilio Tagua
9c70442534 Merge commit 'rails/master'
Conflicts:
	activerecord/test/cases/adapter_test.rb
2009-06-30 19:34:26 -03:00
Michael Schuerig
00a5fd3d18 Translate foreign key violations to ActiveRecord::InvalidForeignKey exceptions.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-06-26 16:52:55 +12:00
Michael Schuerig
53a3eaa860 Translate adapter errors that indicate a violated uniqueness constraint to ActiveRecord::RecordNotUnique exception derived from ActiveReecord::StatementInvalid.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-06-26 16:52:54 +12:00
Emilio Tagua
4864f92ee3 Removed unused methods. 2009-06-23 17:57:31 -03:00
Sebastian A. Espindola
0176e6adb3 Added db:charset support to PostgreSQL. [#556 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-07-14 04:11:52 +01:00
David Heinemeier Hansson
3282bf3b50 Added SQL escaping for :limit and :offset in MySQL [Jonathan Wiess] 2008-06-01 09:15:11 -07:00
David Heinemeier Hansson
ef0ea782b1 Added SQL escaping for :limit and :offset [#288 state:closed] (Aaron Bedra, Steven Bristol, Jonathan Wiess) 2008-05-31 16:57:46 -07:00
Tarmo Tänav
8877ab5852 Added AbstractAdapter#table_exists? and made AbstractAdapter#table implementation non-optional
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-05-07 13:01:46 +12:00
Jeremy Kemper
39814fcce0 Merge branch 'ar-test-cleanup' of git://git.geeksomnia.com/rails
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8681 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-21 17:20:51 +00:00
Jeremy Kemper
1e70928014 Fix paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8661 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:31:37 +00:00
Jeremy Kemper
42b39ae3f2 Move tests to cases
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:30:42 +00:00