diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-03 10:32:30 -0600 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-12-03 10:32:30 -0600 |
commit | 99f2cb4918786382413bdd29b3cacfd5b9377677 (patch) | |
tree | 9279a5f1b63a03f51b1a04734a4c70bb6b6c3546 /activerecord/test/cases/associations | |
parent | 0b4858cf38f522208381f9bfbbb5c066aceb30d2 (diff) | |
parent | 1e1056f6435254c81f02fd0fba53d9356050cb00 (diff) | |
download | rails-99f2cb4918786382413bdd29b3cacfd5b9377677.tar.gz rails-99f2cb4918786382413bdd29b3cacfd5b9377677.tar.bz2 rails-99f2cb4918786382413bdd29b3cacfd5b9377677.zip |
Merge branch 'master' of git@github.com:rails/rails
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb | 5 | ||||
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb index b5bedf3704..2f08e09d43 100644 --- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb @@ -658,6 +658,11 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase assert_equal 1, categories(:technology).posts_gruoped_by_title.size end + def test_find_scoped_grouped_having + assert_equal 2, projects(:active_record).well_payed_salary_groups.size + assert projects(:active_record).well_payed_salary_groups.all? { |g| g.salary > 10000 } + end + def test_get_ids assert_equal projects(:active_record, :action_controller).map(&:id).sort, developers(:david).project_ids.sort assert_equal [projects(:active_record).id], developers(:jamis).project_ids diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 59784e1bcb..816ceb6855 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -255,6 +255,11 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal 2, companies(:first_firm).clients_grouped_by_name.length end + def test_find_scoped_grouped_having + assert_equal 1, authors(:david).popular_grouped_posts.length + assert_equal 0, authors(:mary).popular_grouped_posts.length + end + def test_adding force_signal37_to_load_all_clients_of_firm natural = Client.new("name" => "Natural Company") |