diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -46,6 +46,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase
     Reader.create person_id: 0, post_id: 0
   end
 
+  def test_has_many_through_create_record
+    assert books(:awdr).subscribers.create!(nick: "bob")
+  end
+
   def test_marshal_dump
     preloaded = Post.includes(:first_blue_tags).first
     assert_equal preloaded, Marshal.load(Marshal.dump(preloaded))
diff --git a/activerecord/test/models/subscription.rb b/activerecord/test/models/subscription.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/models/subscription.rb
+++ b/activerecord/test/models/subscription.rb
@@ -3,4 +3,6 @@
 class Subscription < ActiveRecord::Base
   belongs_to :subscriber, counter_cache: :books_count
   belongs_to :book
+
+  validates_presence_of :subscriber_id, :book_id
 end
Add regression test for has_many through record creation

#<I> affected the behavior of the has_many through record creation.

Since #<I>, the intermediate reflection of simple has_many through
association has `inverse_of` to the association, it causes extra through
record creation, the extra through record required valid before the
association record is saved.

<URL>