aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Use *_transaction methods in TransactionManagerArthur Neves2014-08-151-0/+24
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | Use `commit_transaction`/`rollback_transaction` on `within_new_transaction` method, so they make sure they `pop` the transaction from the stack before calling the methods `commit`/`rollback`.
* | | | | fix typo in method name (broken build :sweat:)Yves Senn2014-08-151-1/+1
| | | | |
* | | | | prefer `has_attribute?` over `attributes.key?`.Yves Senn2014-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | Follow up to the discussion on #16505.
* | | | | create_table + transactional_fixtures = :bomb:Akira Matsuda2014-08-151-0/+4
| | | | |
* | | | | Ignore MySQL "SHOW VARIABLES" when counting queriesAkira Matsuda2014-08-151-1/+1
| | | | |
* | | | | Be sure to reset PK name renamed in the testAkira Matsuda2014-08-151-0/+3
| | | | |
* | | | | Warm up Symbols with where methodAkira Matsuda2014-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | Looks like #first wasn't warm enough...
* | | | | Merge pull request #16502 from bogdan/where-hash-nested-relationSantiago Pastorino2014-08-141-0/+9
|\ \ \ \ \ | | | | | | | | | | | | [Regression 4.0 -> 4.1] Fixed AR::Relation#where edge case with Hash and other Relation
| * | | | | Fixed AR::Relation#where edge case with Hash and other RelationBogdan Gusiev2014-08-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: Author.where(posts: { author_id: Author.where(country_id: 1) }).joins(:posts)
* | | | | | Ignore SCHEMA queries in some habtm testsAkira Matsuda2014-08-141-4/+4
| | | | | |
* | | | | | Merge pull request #8813 from ↵Yves Senn2014-08-141-0/+19
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | greyblake/dont_write_timestamps_if_they_are_not_attributes Write timestamps only if there are timestamps columns Conflicts: activerecord/CHANGELOG.md
| * | | | | | Do not try to write timestamps if they are missing #8813Potapov Sergey2014-02-161-0/+22
| | | | | | |
* | | | | | | Make sure that fixtures are loaded before findingAkira Matsuda2014-08-141-0/+4
| | | | | | |
* | | | | | | FormatAkira Matsuda2014-08-141-2/+2
| | | | | | |
* | | | | | | Clear validators before and after each testAkira Matsuda2014-08-142-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Or some tests fail when run in random order
* | | | | | | Finally! None of our tests are order_dependent!Akira Matsuda2014-08-141-5/+0
| |_|_|_|/ / |/| | | | |
* | | | | | Merge pull request #16491 from akshay-vishnoi/doc-changesYves Senn2014-08-132-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | [ci skip] fix spelling of overridden
| * | | | | | [ci skip] fix spelling of overrideAkshay Vishnoi2014-08-132-2/+2
| | |_|_|/ / | |/| | | |
* / | | | | `index_exists?` with `:name` checks specified columns.Yves Senn2014-08-131-0/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Yves Senn & Matthew Draper] The column check was embodied in the defaul index name. If the :name option was used, the specified columns were not verified at all. Given: ``` assert connection.index_exists?(table_name, :foo_id, :name => :index_testings_on_yo_momma) ``` That index could have been defined on any field, not necessarily on `:foo_id`.
* | | | | :bomb:Rafael Mendonça França2014-08-121-1/+1
| | | | |
* | | | | Nobody sucks so nobody should call this awful method nameRafael Mendonça França2014-08-121-1/+1
| | | | |
* | | | | users_dont_suck_but_only_we_suck_and_only_our_tests_are_order_dependent!Akira Matsuda2014-08-121-0/+5
| |_|/ / |/| | | | | | | | | | | | | | | Calling ActiveSupport::TestCase.i_suck_and_my_tests_are_order_dependent! in AS::TestCase makes everyone's tests order dependent, which should never be done by the framework.
* | | | 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.