aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-26 18:08:26 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-26 18:08:26 -0300
commit923e274313dda8c772922e859df681f3d050a30e (patch)
treeef31fe6a9a6e3ab9570e9eb0753f90f7e9faa29e /activerecord/test/cases
parente11e285b1373b0399433943198aefbcdd29db09b (diff)
parent00b024218f1c91fde1217ae4951bd2c817bc9ea9 (diff)
downloadrails-923e274313dda8c772922e859df681f3d050a30e.tar.gz
rails-923e274313dda8c772922e859df681f3d050a30e.tar.bz2
rails-923e274313dda8c772922e859df681f3d050a30e.zip
Merge pull request #15300 from arthurnn/refactor_reflections
Refactor reflections
Diffstat (limited to 'activerecord/test/cases')
-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