aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-05-31 16:01:06 +0930
committerGitHub <noreply@github.com>2017-05-31 16:01:06 +0930
commit7c800fe5e338540ef195f071a7f3604ed4197f3f (patch)
tree0fb6e597c6fa1a2ef152add5485c638e87d30932
parent60dd214784a709ac6ece73ba35483f9c4700d0e7 (diff)
parentc3dd37eefa61d7cc4c4725341dd09bdd9e2e2ac5 (diff)
downloadrails-7c800fe5e338540ef195f071a7f3604ed4197f3f.tar.gz
rails-7c800fe5e338540ef195f071a7f3604ed4197f3f.tar.bz2
rails-7c800fe5e338540ef195f071a7f3604ed4197f3f.zip
Merge pull request #29290 from koic/remove_redundant_habtm_associations_test
Remove a redundant test case of HABTM_associations_test
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb13
1 files changed, 0 insertions, 13 deletions
diff --git a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
index 4bf1b5bcd5..f73005b3cb 100644
--- a/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
@@ -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: " ")