提交 dcf1441c 编写于 作者: A Aaron Patterson 提交者: wycats

removing dead code from activerecord tests. [#4187 state:resolved]

Signed-off-by: Nwycats <wycats@gmail.com>
上级 1def1430
......@@ -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)
......
......@@ -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
......
......@@ -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,
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册