Skip to content

Commit

Permalink
removing dead code from activerecord tests. [#4187 state:resolved]
Browse files Browse the repository at this point in the history
Signed-off-by: wycats <wycats@gmail.com>
  • Loading branch information
tenderlove authored and wycats committed Mar 16, 2010
1 parent 1def143 commit dcf1441
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
Expand Up @@ -186,15 +186,6 @@ def test_succesful_build_association
assert_equal account, firm.account
end

def test_failing_build_association
firm = Firm.new("name" => "GlobalMegaCorp")
firm.save

account = firm.build_account
assert !account.save
assert_equal ["can't be empty"], account.errors["credit_limit"]
end

def test_build_association_twice_without_saving_affects_nothing
count_of_account = Account.count
firm = Firm.find(:first)
Expand Down
12 changes: 0 additions & 12 deletions activerecord/test/cases/associations/join_model_test.rb
Expand Up @@ -52,18 +52,6 @@ def test_has_many_uniq_through_dynamic_find
assert_equal 1, authors(:mary).unique_categorized_posts.find_all_by_title("So I was thinking").size
end

def test_polymorphic_has_many
assert posts(:welcome).taggings.include?(taggings(:welcome_general))
end

def test_polymorphic_has_one
assert_equal taggings(:welcome_general), posts(:welcome).tagging
end

def test_polymorphic_belongs_to
assert_equal posts(:welcome), posts(:welcome).taggings.first.taggable
end

def test_polymorphic_has_many_going_through_join_model
assert_equal tags(:general), tag = posts(:welcome).tags.first
assert_no_queries do
Expand Down
6 changes: 0 additions & 6 deletions activerecord/test/cases/reflection_test.rb
Expand Up @@ -22,12 +22,6 @@ def test_human_name
assert_equal "Subscriber", Subscriber.model_name.human
end

def test_column_null_not_null
subscriber = Subscriber.find(:first)
assert subscriber.column_for_attribute("name").null
assert !subscriber.column_for_attribute("nick").null
end

def test_read_attribute_names
assert_equal(
%w( id title author_name author_email_address bonus_time written_on last_read content approved replies_count parent_id parent_title type ).sort,
Expand Down
19 changes: 0 additions & 19 deletions activerecord/test/cases/validations/i18n_validation_test.rb
Expand Up @@ -47,25 +47,6 @@ def test_validates_uniqueness_of_generates_message_with_custom_default_message
@topic.valid?
end

# validates_uniqueness_of w/o mocha

def test_validates_associated_finds_custom_model_key_translation
I18n.backend.store_translations 'en', :activerecord => {:errors => {:models => {:topic => {:attributes => {:title => {:taken => 'custom message'}}}}}}
I18n.backend.store_translations 'en', :activerecord => {:errors => {:messages => {:taken => 'global message'}}}

Topic.validates_uniqueness_of :title
unique_topic.valid?
assert_equal ['custom message'], unique_topic.errors[:replies]
end

def test_validates_associated_finds_global_default_translation
I18n.backend.store_translations 'en', :activerecord => {:errors => {:messages => {:taken => 'global message'}}}

Topic.validates_uniqueness_of :title
unique_topic.valid?
assert_equal ['global message'], unique_topic.errors[:replies]
end

# validates_associated w/ mocha

def test_validates_associated_generates_message
Expand Down

0 comments on commit dcf1441

Please sign in to comment.