aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* test case for #limit added - picking latest value from limitAkshay Vishnoi2013-12-171-0/+4
|
* Don't skip tests if we don't need to.Rafael Mendonça França2013-11-081-31/+29
| | | | | | | We can conditional define the tests depending on the adapter or connection. Lets keep the skip for fail tests that need to be fixed.
* Remove private API testRafael Mendonça França2013-11-051-10/+0
|
* Add test verifying that you can only sort ARs of the same typeDavid Heinemeier Hansson2013-11-021-1/+7
|
* Revert "ActiveRecord::Base#<=> has been removed. Primary keys may not be in ↵David Heinemeier Hansson2013-11-021-0/+7
| | | | | | | | | order," -- will be replaced with a check to ensure that the keys used for comparison are integers, and only fail if they are not. This reverts commit 6256734e2d0bdd89f4b5d11da259d40afa0c95c7. Conflicts: activerecord/CHANGELOG.md
* fix code typo in `MysqlAdapter` .Closes #12647.Yves Senn2013-10-301-0/+15
|
* prevent global timezone state from leaking out of test cases.Yves Senn2013-10-251-50/+47
|
* fix `test_sqlite3_mem` test run.Yves Senn2013-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | marshalling between processes does not work with an in-memory db. This breaks the `test_sqlite3_mem` run (see stacktrace below). After that failure most tests start to fail randomly. ``` /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:512:in `table_structure': Could not find table 'posts' (ActiveRecord::StatementInvalid) from /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:399:in `columns' from /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/schema_cache.rb:93:in `block in prepare_default_proc' from /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/schema_cache.rb:44:in `yield' from /Users/senny/Projects/rails/activerecord/lib/active_record/connection_adapters/schema_cache.rb:44:in `columns' from /Users/senny/Projects/rails/activerecord/lib/active_record/model_schema.rb:208:in `columns' from /Users/senny/Projects/rails/activerecord/lib/active_record/model_schema.rb:249:in `column_defaults' from /Users/senny/Projects/rails/activerecord/lib/active_record/locking/optimistic.rb:171:in `column_defaults' from /Users/senny/Projects/rails/activerecord/lib/active_record/core.rb:167:in `initialize' from /Users/senny/Projects/rails/activerecord/lib/active_record/inheritance.rb:27:in `new' from /Users/senny/Projects/rails/activerecord/lib/active_record/inheritance.rb:27:in `new' from /Users/senny/Projects/rails/activerecord/test/cases/base_test.rb:1368:in `block in test_marshal_between_processes' from /Users/senny/Projects/rails/activerecord/test/cases/base_test.rb:1366:in `fork' from /Users/senny/Projects/rails/activerecord/test/cases/base_test.rb:1366:in `test_marshal_between_processes' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:110:in `block (3 levels) in run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:208:in `capture_exceptions' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:107:in `block (2 levels) in run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:260:in `time_it' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:106:in `block in run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:296:in `on_signal' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:280:in `with_info_handler' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest/test.rb:105:in `run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:268:in `block (2 levels) in run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:267:in `each' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:267:in `block in run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:296:in `on_signal' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:285:in `with_info_handler' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:266:in `run' from /Users/senny/Projects/rails/activesupport/lib/active_support/test_case.rb:31:in `block in __run' from /Users/senny/Projects/rails/activesupport/lib/active_support/test_case.rb:31:in `map' from /Users/senny/Projects/rails/activesupport/lib/active_support/test_case.rb:31:in `__run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:115:in `run' from /Users/senny/Projects/rails/.bundle/gems/minitest-5.0.8/lib/minitest.rb:46:in `block in autorun' ``` /cc @tenderlove
* Fixed issue #12327Marc Lennox2013-09-271-0/+9
|
* remove unused variableAaron Patterson2013-09-181-1/+0
|
* support objects with blank string primary keysAaron Patterson2013-09-181-0/+6
|
* ActiveRecord::Base#<=> has been removed. Primary keys may not be in order,Aaron Patterson2013-09-181-7/+0
| | | | | | | | | | | or even be numbers, so sorting by id doesn't make sense. Please use `sort_by` and specify the attribute you wish to sort with. For example, change: Post.all.to_a.sort to: Post.all.to_a.sort_by(&:id)
* do what the superclass does in the case that objects do not matchAaron Patterson2013-09-181-0/+8
|
* Check if the SQL is not a prepared statementRafael Mendonça França2013-09-111-0/+8
| | | | | | | | | When the adapter is with prepared statement disabled and the binds array is not empty the connection adapter will try to set the binds values and will fail. Now we are checking if the adapter has the prepared statement disabled. Fixes #12023
* clear all connections before forkingAaron Patterson2013-08-311-0/+3
|
* Revert "Do not dup the binds when visiting the AST"Rafael Mendonça França + Kassio Borges2013-08-311-8/+0
| | | | | | This reverts commit 71ff7d9c6592b93e2c810a1f464943dd7bd02c7f. Reason: I need to check with @jeremy if we can do this.
* Revert "reconnect after the fork returns"Rafael Mendonça França2013-08-311-2/+0
| | | | | | | | | This reverts commit baf5f47b8768c7ec0164ed5ab60e369cdd936d71. Reason: This is breaking the sqlite3 tests with a missing transacion. Could not investigate right now. cc @tenderlove
* Do not dup the binds when visiting the ASTRafael Mendonça França2013-08-311-0/+8
| | | | | | | The visitor have to consume the bind parameters to make the statements work when the prepared statement option is disabled. Fixes #12023
* reconnect after the fork returnsAaron Patterson2013-08-301-0/+2
|
* remove unused variableAaron Patterson2013-08-301-1/+1
|
* add a failing test for marshal + cache problemsAaron Patterson2013-08-301-0/+26
|
* chmod -xAkira Matsuda2013-08-121-0/+0
|
* Set field encoding to client_encoding for mysql adapter.Koichi Sasada2013-08-081-2/+0
|
* use `skip` so we can see what tests are not runAaron Patterson2013-08-081-6/+5
|
* skip `test_unicode_column_name` for `MysqlAdapter`.Yves Senn2013-08-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the build but we need to further investigate the root cause, to see if it can be fixed. The test fails under `MysqlAdapter` with: ``` ActiveRecord::UnknownAttributeError: unknown attribute: なまえ ``` The root cause is that the returned column names from the adapter have the wrong encoding: ```ruby columns = Weird.columns_hash.keys columns # => ["id", "a$b", "\xE3\x81\xAA\xE3\x81\xBE\xE3\x81\x88", "from"] columns.map(&:encoding) # => [#<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>] columns.map {|c| c.dup.force_encoding "utf-8"} # => ["id", "a$b", "なまえ", "from"] ``` From what I can tell the MySQL variables are fine: ``` ActiveRecord::Base.connection.execute("show variables") ... character_set_client utf8 character_set_connection utf8 character_set_database utf8 character_set_filesystem binary character_set_results utf8 character_set_server utf8 character_set_system utf8 character_sets_dir /usr/local/Cellar/mysql/5.5.29/share/mysql/charsets/ collation_connection utf8_general_ci collation_database utf8_unicode_ci collation_server utf8_general_ci ... ```
* adding a weird test caseAaron Patterson2013-08-061-0/+7
|
* use latches rather than mucking with the schedulerAaron Patterson2013-07-081-7/+7
|
* Remove instance level attr_readonly setting was deprecated.kennyj2013-06-021-6/+0
|
* Remove ActiveSupport::Benchmarkable#silence was deprecated.kennyj2013-06-011-32/+0
|
* Extract AR::Persistence#becomes's test code out from base_test.rbTakehiro Adachi2013-05-221-13/+0
| | | | | The method got extracted out from AR::Base in commit d916c62cfc7c59ab6411407a05b946d3dd7535e9, but the tests never did.
* Extract AR::AttributeMethods#attribute_for_inspect's test code out from ↵Takehiro Adachi2013-05-221-8/+0
| | | | | | | base_test.rb The method itself got extracted out from ActiveRecored::Base in commit ceb33f84933639d3b61aac62e5e71fd087ab65ed, but the test code never did.
* Extract AR::Core#inspect and AR::Core.inspect's test code from base_test.rbTakehiro Adachi2013-05-221-24/+0
| | | | | The methods got moved to core.rb in commit b2c9ce341a1c907041f55461aefebb0321280cb5, but the tests never did.
* Fix tests which started to fail due to commit ↵Takehiro Adachi2013-05-181-1/+1
| | | | | | | | 0123c39f41e2062311b2197e6e230ef8ad67e20e Due to commit 0123c39f41e2062311b2197e6e230ef8ad67e20e, column topic.unique_replies_count has been added, and these test started to fail since the tests depends on the topic tables column info.
* Extract tests code out from AR's base_test.rb to integration_test.rbTakehiro Adachi2013-05-021-73/+0
| | | | | | `AR::Base#to_param` and `AR::Base#cache_key` is defined at active_record/integration.rb, so tests for those methods should be at integration_test.rb
* hides the per thread registry instance, and caches singleton methodsXavier Noria2013-04-131-2/+2
| | | | | | | | | | | | Existing code was delegating to the instance with delegate macro calls, or invoking the instance method to reach the object and call its instance methods. But the point is to have a clean class-level interface where the thread local instance is hidden in the implementation. References #11c6973. References #10198.
* Changed the ScopeRegistry and the InstrumentationRegistry to use thewangjohn2013-04-091-2/+2
| | | | PerThreadRegistry module.
* Grouping thread locals in the ActiveRecord scopes so that thewangjohn2013-04-081-2/+2
| | | | | current_scope and ignore_default_scope locals are brought together under a registry object.
* Remove duplicated require from AR base testCarlos Antonio da Silva2013-04-031-1/+0
|
* Fix typo: overriden => overriDDenAlexander Balashov2013-03-281-1/+1
|
* Make connection_handler overridable per threadSam Saffron2013-03-271-0/+57
|
* Make Postgres point type correspond to ruby array with two floats insideMartin Schürrer2013-03-251-2/+25
|
* Add Error#full_message test; Fix typosVipul A M2013-03-221-1/+1
| | | | | Introduce test on Error#full_message for attribute with underscores; Fix some typos
* Commas aren't comas.Josh Adams2013-03-191-2/+2
| | | | Type a fixo.
* move tests out from base_test.rbTakehiro Adachi2013-03-181-14/+0
| | | | | These tests should be in inheritance_test.rb since its testing a feature which is implemented in inheritance.rb
* Deprecate the `:distinct` option for `Relation#count`.Yves Senn2013-03-151-1/+1
| | | | | | | We moved more and more away from passing options to finder / calculation methods. The `:distinct` option in `#count` was one of the remaining places. Since we can now combine `Relation#distinct` with `Relation#count` the option is no longer necessary and can be deprecated.
* rename `Relation#uniq` to `Relation#distinct`. `#uniq` still works.Yves Senn2013-03-151-0/+6
| | | | | | | | The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our Relation API is close to SQL terms I renamed `#uniq` to `#distinct`. There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue to work. I also updated the documentation to promote the use of `#distinct`.
* hide more data in the schema cacheAaron Patterson2013-03-141-2/+2
|
* Address ActiveRecord::StatementInvalid: OCIError: ORA-00979Yasuo Honda2013-03-111-2/+2
|
* Merge pull request #9105 from bemurphy/cache_key_updated_onRafael Mendonça França2013-03-071-2/+20
|\ | | | | | | | | | | | | cache_key consults updated_on timestamp if present Conflicts: activerecord/CHANGELOG.md
| * cache_key consults updated_on timestamp if presentBrendon Murphy2013-02-261-2/+20
| | | | | | | | | | - Extract max timestamp retrieval for cache_key - Update changelog for cache_key changes