aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2010-05-16 16:12:13 +0200
committerJosé Valim <jose.valim@gmail.com>2010-05-16 20:14:36 +0200
commit5d0afe75ebd7d88f982a57af84dba1ef62b14c0c (patch)
tree2e552840ac1a96c7ad71cd3c482988e5ea3d389a /activerecord
parent9ef232a78532f57c6c67b48690ad20b0cc107de8 (diff)
downloadrails-5d0afe75ebd7d88f982a57af84dba1ef62b14c0c.tar.gz
rails-5d0afe75ebd7d88f982a57af84dba1ef62b14c0c.tar.bz2
rails-5d0afe75ebd7d88f982a57af84dba1ef62b14c0c.zip
prevent to run fixture accessor (e.g. test_foos for TestFoo model) as a test case [#2992 state:resolved]
Signed-off-by: Wijnand Wiersma <wijnand@videre.net> Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/fixtures.rb1
-rw-r--r--activerecord/test/cases/fixtures_test.rb5
2 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 4bf33c3856..8099aaa7f7 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -891,6 +891,7 @@ module ActiveRecord
instances.size == 1 ? instances.first : instances
end
+ private table_name
end
end
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index 3ce23209cc..8008b86f81 100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
@@ -256,6 +256,11 @@ class FixturesWithoutInstantiationTest < ActiveRecord::TestCase
def test_fixtures_from_root_yml_without_instantiation
assert !defined?(@unknown), "@unknown is not defined"
end
+
+ def test_visibility_of_accessor_method
+ assert_equal false, respond_to?(:topics, false), "should be private method"
+ assert_equal true, respond_to?(:topics, true), "confirm to respond surely"
+ end
def test_accessor_methods
assert_equal "The First Topic", topics(:first).title