mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove a redundant test case of HABTM_associations_test
This commit is contained in:
parent
ac3c04513e
commit
c3dd37eefa
1 changed files with 0 additions and 13 deletions
|
@ -367,19 +367,6 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
|
|||
assert_equal Developer.find(1).projects.sort_by(&:id).last, proj # prove join table is updated
|
||||
end
|
||||
|
||||
def test_create_by_new_record
|
||||
devel = Developer.new(name: "Marcel", salary: 75000)
|
||||
devel.projects.build(name: "Make bed")
|
||||
proj2 = devel.projects.build(name: "Lie in it")
|
||||
assert_equal devel.projects.last, proj2
|
||||
assert !proj2.persisted?
|
||||
devel.save
|
||||
assert devel.persisted?
|
||||
assert proj2.persisted?
|
||||
assert_equal devel.projects.last, proj2
|
||||
assert_equal Developer.find_by_name("Marcel").projects.last, proj2 # prove join table is updated
|
||||
end
|
||||
|
||||
def test_creation_respects_hash_condition
|
||||
# in Oracle '' is saved as null therefore need to save ' ' in not null column
|
||||
post = categories(:general).post_with_conditions.build(body: " ")
|
||||
|
|
Loading…
Reference in a new issue