diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-23 17:00:15 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-07-23 17:02:14 -0700 |
commit | b8aebb0261470af3df4e55d125b1ce8e8bf1cb32 (patch) | |
tree | 99a5b0e0f2075ee1c33c43bc8421fbfa692dbfea /activerecord/test | |
parent | 2aa20b36384f9ed2e492758840411d1c7cc081ca (diff) | |
download | rails-b8aebb0261470af3df4e55d125b1ce8e8bf1cb32.tar.gz rails-b8aebb0261470af3df4e55d125b1ce8e8bf1cb32.tar.bz2 rails-b8aebb0261470af3df4e55d125b1ce8e8bf1cb32.zip |
acually get the actual source reflection :cry::gun:
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/reflection_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb index 4fc738da94..0e5c7df2cc 100644 --- a/activerecord/test/cases/reflection_test.rb +++ b/activerecord/test/cases/reflection_test.rb @@ -252,8 +252,9 @@ class ReflectionTest < ActiveRecord::TestCase reflection = ActiveRecord::Reflection::AssociationReflection.new(:fuu, :edge, nil, {}, Author) assert_raises(ActiveRecord::UnknownPrimaryKey) { reflection.association_primary_key } - through = ActiveRecord::Reflection::ThroughReflection.new(:fuu, :edge, nil, {}, Author) - through.stubs(:source_reflection).returns(stub_everything(:options => {}, :class_name => 'Edge')) + through = Class.new(ActiveRecord::Reflection::ThroughReflection) { + define_method(:source_reflection) { reflection } + }.new(:fuu, :edge, nil, {}, Author) assert_raises(ActiveRecord::UnknownPrimaryKey) { through.association_primary_key } end |