aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/reflection_test.rb
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2014-05-24 14:03:30 -0400
committerArthur Neves <arthurnn@gmail.com>2014-05-24 14:55:20 -0400
commit09ac448a8eff73ffb7a3f683207802e8cb1f6d0b (patch)
tree668528eedc99f79d91431c7b7dd6acccd42d5221 /activerecord/test/cases/reflection_test.rb
parente2bd0eb758100a5d6f55201318809a7ed7b37040 (diff)
downloadrails-09ac448a8eff73ffb7a3f683207802e8cb1f6d0b.tar.gz
rails-09ac448a8eff73ffb7a3f683207802e8cb1f6d0b.tar.bz2
rails-09ac448a8eff73ffb7a3f683207802e8cb1f6d0b.zip
Merge pull request #15210 from arthurnn/fix_hbtm_reflection
Fix habtm reflection Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/reflection_test.rb
Diffstat (limited to 'activerecord/test/cases/reflection_test.rb')
-rw-r--r--activerecord/test/cases/reflection_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb
index c085fcf161..e6603f28be 100644
--- a/activerecord/test/cases/reflection_test.rb
+++ b/activerecord/test/cases/reflection_test.rb
@@ -200,7 +200,12 @@ class ReflectionTest < ActiveRecord::TestCase
end
def test_reflection_should_not_raise_error_when_compared_to_other_object
- assert_nothing_raised { Firm.reflections['clients'] == Object.new }
+ assert_not_equal Object.new, Firm._reflections['clients']
+ end
+
+ def test_has_and_belongs_to_many_reflection
+ assert_equal :has_and_belongs_to_many, Category.reflections['posts'].macro
+ assert_equal :posts, Category.reflect_on_all_associations(:has_and_belongs_to_many).first.name
end
def test_has_many_through_reflection