fisting a bunch of unused variable warnings
This commit is contained in:
parent
8124b2bc24
commit
022519a032
@ -17,7 +17,7 @@ def setup
|
||||
|
||||
def generate_test_objects
|
||||
post = Namespaced::Post.create( :title => 'Great stuff', :body => 'This is not', :author_id => 1 )
|
||||
tagging = Tagging.create( :taggable => post )
|
||||
Tagging.create( :taggable => post )
|
||||
end
|
||||
|
||||
def test_class_names
|
||||
|
@ -323,7 +323,7 @@ def test_eager_with_has_many_through
|
||||
|
||||
def test_eager_with_has_many_through_a_belongs_to_association
|
||||
author = authors(:mary)
|
||||
post = Post.create!(:author => author, :title => "TITLE", :body => "BODY")
|
||||
Post.create!(:author => author, :title => "TITLE", :body => "BODY")
|
||||
author.author_favorites.create(:favorite_author_id => 1)
|
||||
author.author_favorites.create(:favorite_author_id => 2)
|
||||
posts_with_author_favorites = author.posts.find(:all, :include => :author_favorites)
|
||||
@ -521,7 +521,7 @@ def test_eager_association_loading_with_habtm
|
||||
end
|
||||
|
||||
def test_eager_with_inheritance
|
||||
posts = SpecialPost.find(:all, :include => [ :comments ])
|
||||
SpecialPost.find(:all, :include => [ :comments ])
|
||||
end
|
||||
|
||||
def test_eager_has_one_with_association_inheritance
|
||||
@ -561,16 +561,16 @@ def test_eager_with_multi_table_conditional_properly_counts_the_records_when_usi
|
||||
|
||||
def test_eager_with_invalid_association_reference
|
||||
assert_raise(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys") {
|
||||
post = Post.find(6, :include=> :monkeys )
|
||||
Post.find(6, :include=> :monkeys )
|
||||
}
|
||||
assert_raise(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys") {
|
||||
post = Post.find(6, :include=>[ :monkeys ])
|
||||
Post.find(6, :include=>[ :monkeys ])
|
||||
}
|
||||
assert_raise(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys") {
|
||||
post = Post.find(6, :include=>[ 'monkeys' ])
|
||||
Post.find(6, :include=>[ 'monkeys' ])
|
||||
}
|
||||
assert_raise(ActiveRecord::ConfigurationError, "Association was not found; perhaps you misspelled it? You specified :include => :monkeys, :elephants") {
|
||||
post = Post.find(6, :include=>[ :monkeys, :elephants ])
|
||||
Post.find(6, :include=>[ :monkeys, :elephants ])
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -297,7 +297,7 @@ def test_build
|
||||
|
||||
def test_build_by_new_record
|
||||
devel = Developer.new(:name => "Marcel", :salary => 75000)
|
||||
proj1 = devel.projects.build(:name => "Make bed")
|
||||
devel.projects.build(:name => "Make bed")
|
||||
proj2 = devel.projects.build(:name => "Lie in it")
|
||||
assert_equal devel.projects.last, proj2
|
||||
assert !proj2.persisted?
|
||||
@ -322,7 +322,7 @@ def test_create
|
||||
|
||||
def test_create_by_new_record
|
||||
devel = Developer.new(:name => "Marcel", :salary => 75000)
|
||||
proj1 = devel.projects.build(:name => "Make bed")
|
||||
devel.projects.build(:name => "Make bed")
|
||||
proj2 = devel.projects.build(:name => "Lie in it")
|
||||
assert_equal devel.projects.last, proj2
|
||||
assert !proj2.persisted?
|
||||
@ -559,8 +559,6 @@ def test_find_with_merged_options
|
||||
|
||||
def test_dynamic_find_should_respect_association_order
|
||||
# Developers are ordered 'name DESC, id DESC'
|
||||
low_id_jamis = developers(:jamis)
|
||||
middle_id_jamis = developers(:poor_jamis)
|
||||
high_id_jamis = projects(:active_record).developers.create(:name => 'Jamis')
|
||||
|
||||
assert_equal high_id_jamis, projects(:active_record).developers.find(:first, :conditions => "name = 'Jamis'")
|
||||
|
@ -73,7 +73,7 @@ def test_create_resets_cached_counters
|
||||
assert_equal [], person.readers
|
||||
assert_nil person.readers.find_by_post_id(post.id)
|
||||
|
||||
reader = person.readers.create(:post_id => post.id)
|
||||
person.readers.create(:post_id => post.id)
|
||||
|
||||
assert_equal 1, person.readers.count
|
||||
assert_equal 1, person.readers.length
|
||||
@ -88,7 +88,7 @@ def test_find_or_create_by_resets_cached_counters
|
||||
assert_equal [], person.readers
|
||||
assert_nil person.readers.find_by_post_id(post.id)
|
||||
|
||||
reader = person.readers.find_or_create_by_post_id(post.id)
|
||||
person.readers.find_or_create_by_post_id(post.id)
|
||||
|
||||
assert_equal 1, person.readers.count
|
||||
assert_equal 1, person.readers.length
|
||||
@ -402,7 +402,7 @@ def test_adding
|
||||
def test_adding_using_create
|
||||
first_firm = companies(:first_firm)
|
||||
assert_equal 2, first_firm.plain_clients.size
|
||||
natural = first_firm.plain_clients.create(:name => "Natural Company")
|
||||
first_firm.plain_clients.create(:name => "Natural Company")
|
||||
assert_equal 3, first_firm.plain_clients.length
|
||||
assert_equal 3, first_firm.plain_clients.size
|
||||
end
|
||||
@ -483,7 +483,7 @@ def test_build_many
|
||||
end
|
||||
|
||||
def test_build_followed_by_save_does_not_load_target
|
||||
new_client = companies(:first_firm).clients_of_firm.build("name" => "Another Client")
|
||||
companies(:first_firm).clients_of_firm.build("name" => "Another Client")
|
||||
assert companies(:first_firm).save
|
||||
assert !companies(:first_firm).clients_of_firm.loaded?
|
||||
end
|
||||
@ -554,7 +554,7 @@ def test_create_many
|
||||
end
|
||||
|
||||
def test_create_followed_by_save_does_not_load_target
|
||||
new_client = companies(:first_firm).clients_of_firm.create("name" => "Another Client")
|
||||
companies(:first_firm).clients_of_firm.create("name" => "Another Client")
|
||||
assert companies(:first_firm).save
|
||||
assert !companies(:first_firm).clients_of_firm.loaded?
|
||||
end
|
||||
@ -852,7 +852,6 @@ def test_dependence
|
||||
|
||||
def test_dependence_for_associations_with_hash_condition
|
||||
david = authors(:david)
|
||||
post = posts(:thinking).id
|
||||
assert_difference('Post.count', -1) { assert david.destroy }
|
||||
end
|
||||
|
||||
@ -872,7 +871,7 @@ def test_destroy_dependent_when_deleted_from_association
|
||||
def test_three_levels_of_dependence
|
||||
topic = Topic.create "title" => "neat and simple"
|
||||
reply = topic.replies.create "title" => "neat and simple", "content" => "still digging it"
|
||||
silly_reply = reply.replies.create "title" => "neat and simple", "content" => "ain't complaining"
|
||||
reply.replies.create "title" => "neat and simple", "content" => "ain't complaining"
|
||||
|
||||
assert_nothing_raised { topic.destroy }
|
||||
end
|
||||
@ -897,7 +896,6 @@ def test_dependence_on_account
|
||||
|
||||
def test_depends_and_nullify
|
||||
num_accounts = Account.count
|
||||
num_companies = Company.count
|
||||
|
||||
core = companies(:rails_core)
|
||||
assert_equal accounts(:rails_core_account), core.account
|
||||
@ -914,7 +912,7 @@ def test_depends_and_nullify
|
||||
def test_restrict
|
||||
firm = RestrictedFirm.new(:name => 'restrict')
|
||||
firm.save!
|
||||
child_firm = firm.companies.create(:name => 'child')
|
||||
firm.companies.create(:name => 'child')
|
||||
assert !firm.companies.empty?
|
||||
assert_raise(ActiveRecord::DeleteRestrictionError) { firm.destroy }
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user