Skip to content

Commit

Permalink
Fix broken tests added by 85c724d
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Feb 1, 2012
1 parent e1de540 commit f532cd1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions activerecord/test/cases/associations/has_many_associations_test.rb
Expand Up @@ -1254,7 +1254,7 @@ def test_get_ids_for_unloaded_finder_sql_associations_loads_them
end end


def test_get_ids_for_ordered_association def test_get_ids_for_ordered_association
assert_equal [companies(:second_client).id, companies(:first_client).id], companies(:first_firm).clients_ordered_by_rating_ids assert_equal [companies(:second_client).id, companies(:first_client).id], companies(:first_firm).clients_ordered_by_name_ids
end end


def test_assign_ids_ignoring_blanks def test_assign_ids_ignoring_blanks
Expand Down Expand Up @@ -1405,29 +1405,29 @@ def test_calling_first_or_last_on_new_record_should_not_run_queries
firm.clients.last firm.clients.last
end end
end end

def test_custom_primary_key_on_new_record_should_fetch_with_query def test_custom_primary_key_on_new_record_should_fetch_with_query
author = Author.new(:name => "David") author = Author.new(:name => "David")
assert !author.essays.loaded? assert !author.essays.loaded?

assert_queries 1 do assert_queries 1 do
assert_equal 1, author.essays.size assert_equal 1, author.essays.size
end end

assert_equal author.essays, Essay.find_all_by_writer_id("David") assert_equal author.essays, Essay.find_all_by_writer_id("David")

end end

def test_has_many_custom_primary_key def test_has_many_custom_primary_key
david = authors(:david) david = authors(:david)
assert_equal david.essays, Essay.find_all_by_writer_id("David") assert_equal david.essays, Essay.find_all_by_writer_id("David")
end end

def test_blank_custom_primary_key_on_new_record_should_not_run_queries def test_blank_custom_primary_key_on_new_record_should_not_run_queries
author = Author.new author = Author.new
assert !author.essays.loaded? assert !author.essays.loaded?

assert_queries 0 do assert_queries 0 do
assert_equal 0, author.essays.size assert_equal 0, author.essays.size
end end
end end
Expand Down
4 changes: 2 additions & 2 deletions activerecord/test/cases/reflection_test.rb
Expand Up @@ -189,8 +189,8 @@ def test_association_reflection_in_modules


def test_reflection_of_all_associations def test_reflection_of_all_associations
# FIXME these assertions bust a lot # FIXME these assertions bust a lot
assert_equal 37, Firm.reflect_on_all_associations.size assert_equal 38, Firm.reflect_on_all_associations.size
assert_equal 27, Firm.reflect_on_all_associations(:has_many).size assert_equal 28, Firm.reflect_on_all_associations(:has_many).size
assert_equal 10, Firm.reflect_on_all_associations(:has_one).size assert_equal 10, Firm.reflect_on_all_associations(:has_one).size
assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size
end end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/test/models/company.rb
Expand Up @@ -45,7 +45,7 @@ class Firm < Company
has_many :unsorted_clients_with_symbol, :class_name => :Client has_many :unsorted_clients_with_symbol, :class_name => :Client
has_many :clients_sorted_desc, :class_name => "Client", :order => "id DESC" has_many :clients_sorted_desc, :class_name => "Client", :order => "id DESC"
has_many :clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id" has_many :clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id"
has_many :clients_ordered_by_rating, :order => "rating", :class_name => "Client" has_many :clients_ordered_by_name, :order => "name", :class_name => "Client"
has_many :unvalidated_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :validate => false has_many :unvalidated_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :validate => false
has_many :dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :dependent => :destroy has_many :dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :dependent => :destroy
has_many :exclusively_dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :dependent => :delete_all has_many :exclusively_dependent_clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id", :dependent => :delete_all
Expand Down

0 comments on commit f532cd1

Please sign in to comment.