aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-14 21:35:52 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-14 21:35:52 -0300
commitf85371f69d9fbc197c39b3c05b05d109952bde6e (patch)
tree9fcc2c3f98b00aaea9b222bb07cd24e24fbfe0ce /activerecord/test/cases
parentec6bb3320991df57c00a30c61a03cb5b44942404 (diff)
parent8f6e5986acddf1c126bebf27774d7c7866bb4fa7 (diff)
downloadrails-f85371f69d9fbc197c39b3c05b05d109952bde6e.tar.gz
rails-f85371f69d9fbc197c39b3c05b05d109952bde6e.tar.bz2
rails-f85371f69d9fbc197c39b3c05b05d109952bde6e.zip
Merge pull request #14871 from kassio/kb-fixes-namespaced-habtm
Fix how to compute class name on habtm namespaced. Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb12
1 files changed, 12 insertions, 0 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 cfdfff6af9..878f1877db 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
@@ -22,6 +22,9 @@ require 'models/sponsor'
require 'models/country'
require 'models/treaty'
require 'models/vertex'
+require 'models/publisher'
+require 'models/publisher/article'
+require 'models/publisher/magazine'
require 'active_support/core_ext/string/conversions'
class ProjectWithAfterCreateHook < ActiveRecord::Base
@@ -848,4 +851,13 @@ class HasAndBelongsToManyAssociationsTest < ActiveRecord::TestCase
def test_custom_join_table
assert_equal 'edges', Vertex.reflect_on_association(:sources).join_table
end
+
+ def test_namespaced_habtm
+ magazine = Publisher::Magazine.create
+ article = Publisher::Article.create
+ magazine.articles << article
+ magazine.save
+
+ assert_includes magazine.articles, article
+ end
end