Permalink
Browse files

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>
  • Loading branch information...
1 parent 9ef232a commit 5d0afe75ebd7d88f982a57af84dba1ef62b14c0c @no6v no6v committed with josevalim May 16, 2010
Showing with 6 additions and 0 deletions.
  1. +1 −0 activerecord/lib/active_record/fixtures.rb
  2. +5 −0 activerecord/test/cases/fixtures_test.rb
@@ -891,6 +891,7 @@ def setup_fixture_accessors(table_names = nil)
instances.size == 1 ? instances.first : instances
end
+ private table_name
end
end
@@ -256,6 +256,11 @@ def test_without_complete_instantiation
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

0 comments on commit 5d0afe7

Please sign in to comment.