aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/test_case.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #29732 from kirs/frozen-activerecordRafael França2017-07-211-0/+2
|\ | | | | Use frozen-string-literal in ActiveRecord
| * Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
| |
* | Revert "Extract `bind_param` and `bind_attribute` into `ActiveRecord::TestCase`"Sean Griffin2017-07-211-8/+0
|/ | | | | | | | This reverts commit b6ad4052d18e4b29b8a092526c2beef013e2bf4f. This is not something that the majority of Active Record should be testing or care about. We should look at having fewer places rely on these details, not make it easier to rely on them.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Extract `bind_param` and `bind_attribute` into `ActiveRecord::TestCase`Ryuta Kamizono2017-05-041-0/+8
| | | | These are used in tests from anywhere.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* let Regexp#match? be globally availableXavier Noria2016-10-271-1/+0
| | | | | | Regexp#match? should be considered to be part of the Ruby core library. We are emulating it for < 2.4, but not having to require the extension is part of the illusion of the emulation.
* Preserve cached queries name in AS notificationsJean Boussier2016-09-221-5/+2
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Consolidate `ActiveRecord::TestCase` and `ActiveSupport::TestCase` in AR ↵Ryuta Kamizono2016-08-141-0/+16
| | | | test cases
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-5/+5
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* adds missing requiresXavier Noria2016-07-241-0/+1
|
* systematic revision of =~ usage in ARXavier Noria2016-07-231-1/+1
| | | | | Where appropriatei, prefer the more concise Regexp#match?, String#include?, String#start_with?, or String#end_with?
* Remove unnecessary `assert_date_from_db`Ryuta Kamizono2016-06-121-4/+0
| | | | | | `assert_date_from_db` was added at 6a2104d for SQL Server. But latest sqlserver adapter work to pass expected behavior since 8e4624b.
* Remove legacy mysql adapterAbdelkader Boudih2015-12-171-6/+0
|
* Remove `#tables` extra args againRyuta Kamizono2015-10-221-1/+1
| | | | | | This issue was resolved by #21687 already. But re-add args by #18856. `#tables` extra args was only using by `#table_exists?`. This is for internal API. This commit will remove these extra args again.
* Fix test failures caused by d99db6b8b3e4Sean Griffin2015-10-201-1/+1
| | | | | I messed up the merge conflict, and accidentally removed a schema query that needed to be ignored.
* Fix merge conflicts for #18856Sean Griffin2015-10-201-1/+1
|\
| * Match table names exactly on MySQLMatt Jones2015-02-081-1/+1
| | | | | | | | | | | | | | | | The `SHOW TABLES LIKE` command accepts metacharacters `%` and `_` in potentially unexpected ways. This can be avoided by querying `information_schema.tables` directly. Fixes #17897
* | Refactor `table_exists?` in AbstractMysqlAdapterRyuta Kamizono2015-09-201-1/+1
| | | | | | | | | | | | `table_exists?` calls `tables` twice when passed `'dbname.tblname'` arg. This change is that `table_exists?` execute only once query always and extra args of `tables` is removed.
* | Correctly dump composite primary keyRyuta Kamizono2015-09-201-1/+1
| | | | | | | | | | | | | | | | | | Example: create_table :barcodes, primary_key: ["region", "code"] do |t| t.string :region t.integer :code end
* | make it possible to run AR tests with bin/testYves Senn2015-06-111-0/+24
| |
* | Add collation support for string and text columns in SQLite3Akshay Vishnoi2015-05-281-1/+1
|/
* - Extracted silence_stream method to new module in activesupport/testing.Vipul A M2015-01-201-17/+3
| | | | | | | | | | | | - Added include for the same in ActiveSupport::Test. - Removed occurrences of silence_stream being used elsewhere. - Reordered activesupport testcase requires alphabetically. - Removed require of silence stream from test_case - Moved quietly method to stream helper - Moved capture output to stream helper module and setup requires for the same elsewhere
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* Ignore Postgresql "SELECT tablename FROM pg_tables" when counting queriesAkira Matsuda2014-08-201-1/+1
|
* Ignore MySQL "SHOW VARIABLES" when counting queriesAkira Matsuda2014-08-151-1/+1
|
* we intend to keep the `capture` helper for Active Record tests.Yves Senn2014-07-161-18/+12
| | | | This is a follow up to f8f5cdc
* Active Record tests still depend on `capture`. Let's keep it for now.Yves Senn2014-07-161-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 3121412 /cc @rafaelfranca This will remove deprecation warnings from the PostgreSQL suite: ``` DEPRECATION WARNING: #capture(stream) is deprecated and will be removed in the next release. (called from capture at /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89) /Users/senny/Projects/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:73:in `ensure_warning_is_issued' /Users/senny/Projects/rails/activerecord/test/cases/adapters/postgresql/composite_test.rb:48:in `test_column' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:106:in `block (3 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:204:in `capture_exceptions' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:103:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:256:in `time_it' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:102:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:276:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest/test.rb:101:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:759:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:293:in `run_one_method' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:287:in `block (2 levels) in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `each' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:286:in `block in run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:317:in `on_signal' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:306:in `with_info_handler' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:285:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `block in __run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `map' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:149:in `__run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:126:in `run' /Users/senny/Projects/rails/.bundle/gems/minitest-5.3.3/lib/minitest.rb:55:in `block in autorun' ```
* Remove dead test code for unsupported adaptersSean Griffin2014-05-171-7/+1
|
* refactor assert_sql query to reuse capture_sqleileencodes2014-03-311-3/+1
| | | | | | | set assert_sql to reuse the capture_sql method from above instead of repeating the code in response to comments on issue #14546
* add capture_sql method to compare sql statements and compareeileencodes2014-03-311-0/+6
| | | | | Other methods compare specific patterns, this method outputs the actual sql query that is generated.
* Do not count query for all_constraints and all_tab_cols in OracleYasuo Honda2013-11-181-1/+1
|
* Do not count "SHOW CREATE TABLE" queries when testing against mysqlAkira Matsuda2013-11-111-1/+1
|
* assert_no_queries should allow to ignore some queriesNeeraj Singh2013-07-301-2/+3
|
* removes the obsolete private method column_methods_hash [Closes #11406]Xavier Noria2013-07-161-0/+12
|
* remove unused `ActiveRecord::TestCase#sqlite3` method.Yves Senn2013-07-021-6/+0
|
* deprecated `ActiveRecord::TestCase` is no longer public.Yves Senn2013-07-021-2/+94
| | | | /cc @tenderlove
* load active_support/deprecation in active_support/railsXavier Noria2012-08-021-1/+0
|
* Get ActiveRecord::TestCase back on its feet, despite deprecation. It ↵Jeremy Kemper2012-02-051-60/+7
| | | | requires SQLCounter which was moved to AR internal tests only.
* Moving AR::TestCase in to the AR tests directoryAaron Patterson2012-01-241-0/+63