aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
Commit message (Collapse)AuthorAgeFilesLines
* Define id_was to get the previous value of the primary keyRafael Mendonça França2014-08-061-0/+10
| | | | | | | | | Currently when we call id_was and we have a custom primary key name Active Record will return the current value of the primary key. This make impossible to correctly do an update operation if you change the id. Fixes #16413
* Merge pull request #16364 from arthurnn/make_transaction_one_classJeremy Kemper2014-08-051-2/+2
|\ | | | | Clarify Transaction responsibilities by breaking unneeded inheritance hierarchy.
| * Cleanup Transaction inheritance.Arthur Neves2014-08-051-2/+2
| | | | | | | | | | | | | | | | | | Transaction class doesnt need to encapsulate the transaction state using inheritance. This removes all Transaction subclasses, and let the Transaction object controls different actions based on its own state. Basically the only actions would behave differently are `being`,`commit`,`rollback` as they could act in a savepoint or in a real transaction.
* | Merge pull request #16333 from ↵Yves Senn2014-08-041-0/+5
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | joker1007/fix_decimal_cast_from_float_with_large_precision Fix type casting to Decimal from Float with large precision Conflicts: activerecord/CHANGELOG.md
| * | Fix type casting to Decimal from Float with ...joker10072014-08-011-0/+5
| | | | | | | | | | | | | | | When I defines large precision column at RDBMS, I assigns float value, raise ArgumentError (precision too large).
* | | Merge pull request #16374 from rajcybage/consistency_minitestRafael Mendonça França2014-08-022-3/+3
|\ \ \ | |_|/ |/| | rename MiniTest to Minitest
| * | rename MiniTest to MinitestRajarshi Das2014-08-022-3/+3
| | |
* | | Merge pull request #16341 from arthurnn/transactions_remove_beginRafael Mendonça França2014-07-311-2/+2
|\ \ \ | | | | | | | | Transactions refactoring - 2
| * | | Remove being/number methods from transaction classArthur Neves2014-07-311-2/+2
| | |/ | |/|
* / | Add ActiveRecord::Tasks::DatabaseTasks.migrateJack Danger Canty2014-07-311-0/+13
|/ / | | | | | | | | | | This extracts the logic that was embedded in a Rake task into a static method. Bonus: the first test for `rake db:migrate`
* | Merge pull request #16284 from arthurnn/transactionsRafael Mendonça França2014-07-281-0/+20
|\ \ | | | | | | | | | Transactions refactoring
| * | savepoint_name should return nil for non-savepoint transactionsArthur Neves2014-07-281-0/+20
| | | | | | | | | | | | Also add test to assets the savepoint name
* | | Add where condition so select_one returns the correct record.Zuhao Wan2014-07-281-1/+1
| |/ |/|
* | Add support for Postgresql JSONBPhilippe Creux2014-07-241-9/+25
|/ | | | [Philippe Creux, Chris Teague]
* tests, run adapter specific rake tests only for the right adapter.Yves Senn2014-07-243-0/+6
|
* build fix, fix error introduced with 091b246bb0111357edbb9703ea342a944b04deb6Yves Senn2014-07-241-2/+2
| | | | | | | | | | | | | | Fixes the following issue: 1) Failure: ActiveRecord::MySQLPurgeTest#test_establishes_connection_to_test_database [test/cases/tasks/mysql_rake_test.rb:200]: not all expectations were satisfied unsatisfied expectations: - expected exactly once, not yet invoked: ActiveRecord::Base.establish_connection(:test) satisfied expectations: - allowed any number of times, invoked once: #<Mock:0x2349430>.recreate_database(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.establish_connection(any_parameters) - allowed any number of times, invoked once: ActiveRecord::Base.connection(any_parameters)
* Merge pull request #16231 from Envek/type_in_referencesYves Senn2014-07-223-1/+20
|\ | | | | | | | | | | * Allow to specify a type for foreign key column in migrations * unified the docs * some cleanup in CHANGELOG
| * Allow to specify a type for foreign key column in migrationsAndrey Novikov2014-07-223-1/+25
|/ | | | [Andrey Novikov & Łukasz Sarnacki]
* Merge pull request #16253 from ↵Yves Senn2014-07-221-1/+1
|\ | | | | | | | | zuhao/refactor_activerecord_nested_through_associations_test Make sure assertion passes for postgresql.
| * Make sure assertion passes for postgresql.Zuhao Wan2014-07-221-1/+1
| |
* | Remove redundant that already happened in teardown.Zuhao Wan2014-07-221-1/+0
|/
* build fix, remove not null constraint.Yves Senn2014-07-221-1/+1
| | | | | | | | | | | The fixtures are still in play, adding a new column without a default and `null: true` is not possible. This reverts back to leaking global state, as our `schema.rb` adds the `null: false` constraint on this field. A future solution would be to make the `migration_test.rb` run independent of fixture tables. This way we can simply drop the state after test execution, without worrying about side effects. /cc @zuhao
* Merge pull request #16250 from zuhao/refactor_activerecord_migration_testYves Senn2014-07-221-1/+1
|\ | | | | Remove length limit that results failure in other tests.
| * Remove length limit that results failure in other tests.Zuhao Wan2014-07-221-1/+1
| |
* | Remove the side-effects of validates_presence_of.Zuhao Wan2014-07-221-2/+3
|/
* Merge branch 'rm-remove-mocha'Rafael Mendonça França2014-07-191-0/+2
|\ | | | | | | | | Conflicts: actionpack/test/abstract_unit.rb
| * Stop requiring mocha automaticallyRafael Mendonça França2014-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | We are planning to remove mocha from our test suite because of performance problems. To make this possible we should stop require mocha on ActionSupport::TestCase. This should not affect applications since users still need to add mocha to Gemfile and this already load mocha. Added FIXME notes to place that still need mocha removal
* | create_join_table uses same logic as HABTM reflectionsStefan Kanev2014-07-181-0/+24
| | | | | | | | | | | | | | | | Before this change, create_join_table would not remove the common prefix in the join table name, unlike ActiveRecord::Reflections. A HABTM between Music::Artist and Music::Record would use a table music_artists_records, while create_join table would create music_artists_music_records.
* | Merge pull request #15762 from arthurnn/better_error_on_bad_alias_methodMatthew Draper2014-07-181-2/+20
|\ \ | | | | | | | | | Dont swallow errors when bad alias_method
| * | Dont swallow errors when bad alias_methodArthur Neves2014-06-241-2/+20
| | |
* | | Disable some tests on SQLiteRafael Mendonça França2014-07-171-77/+77
| | | | | | | | | | | | | | | These tests were passing before because the precision were not using to cast the value. Not it is being used so it would fail on sqlite3
* | | Merge pull request #16188 from marianovalles/fix_rational_to_decimal_type_castRafael Mendonça França2014-07-172-7/+33
|\ \ \ | | | | | | | | | | | | Fix rational to decimal on type_cast_from_user
| * | | Fix decimal_test module and add new test for object responding to to_dMariano Valles2014-07-161-6/+15
| | | |
| * | | Fix case statement to use ::Numeric and ::StringMariano Valles2014-07-162-17/+24
| | | |
| * | | Change class evaluation for Rationals in cast_valueMariano Valles2014-07-161-1/+1
| | | |
| * | | Fix rational to decimal on type_cast_from_userMariano Valles2014-07-161-0/+10
| | | |
* | | | Merge pull request #16196 from yahonda/mysql_restrict_testMatthew Draper2014-07-172-8/+6
|\ \ \ \ | | | | | | | | | | Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"
| * | | | Revert "Rename to test_mysql_strict_mode_disabled_dont_override_global_sql_mode"Yasuo Honda2014-07-172-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit babc24c1b07c1fd58b9b3249b0256f9b0d45c0f0. Conflicts: activerecord/test/cases/adapters/mysql/connection_test.rb activerecord/test/cases/adapters/mysql2/connection_test.rb
* | | | | Merge pull request #15944 from seuros/uuidRafael Mendonça França2014-07-161-0/+37
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat invalid uuid as nil Conflicts: activerecord/CHANGELOG.md
| * | | | | Treat invalid uuid as nilAbdelkader Boudih2014-07-141-0/+37
| |/ / / /
* | | | | Merge pull request #16183 from goddamnhippie/fix-psych-warningRafael Mendonça França2014-07-161-0/+1
|\ \ \ \ \ | | | | | | | | | | | | Implement required #encode_with
| * | | | | Implement required #encode_withGustavo Beathyate2014-07-151-0/+1
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | While running the spec `ARCONN=mysql2 ruby -v -Itest test/cases/yaml_serialization_test.rb` the following warning shows up: `implementing to_yaml is deprecated, please implement "encode_with"`
* | | | | Merge pull request #15718 from chancancode/regression_from_15694Godfrey Chan2014-07-161-1/+5
|\ \ \ \ \ | | | | | | | | | | | | Fixed a regression introduced in 84cf156
| * | | | | Fixed a regression introduced in 84cf156Godfrey Chan2014-06-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 84cf156 (PR #15694) introduced a subtle regression. There are actually three distinct entry points to creating an AR object – via .new (i.e. #initialize), via #init_with (e.g. from YAML or database queries) and via .allocate. With the patch in 84cf156, attribute methods and respond_to? will not work correctly when objects are allocated directly, without going through either The reason this test case didn't catch the regression was that the `Topic` class is shared between test cases, so by the time this test case is ran the attribute methods are very likely to be defined. Switching to use a fresh anonymous class in the test to ensure we surface this problem in the future.
* | | | | | 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-162-19/+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' ```
* | | | | | use foreign key DSL in our tests.Yves Senn2014-07-161-2/+2
| | | | | |
* | | | | | Merge pull request #16138 from sgrif/sg-attribute-set-keyYves Senn2014-07-161-5/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | AttributeSet#include? -> AttributeSet#key?
| * | | | | | AttributeSet#include? -> AttributeSet#key?Sean Griffin2014-07-111-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/rails/rails/pull/15868/files#r14135210
* | | | | | | Merge pull request #16180 from rafaelfranca/rm-dirtyRafael Mendonça França2014-07-151-2/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Improve Active Model Dirty API.