1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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>
This commit is contained in:
Nobuhiro IMAI 2010-05-16 16:12:13 +02:00 committed by José Valim
parent 9ef232a785
commit 5d0afe75eb
2 changed files with 6 additions and 0 deletions

View file

@ -891,6 +891,7 @@ module ActiveRecord
instances.size == 1 ? instances.first : instances
end
private table_name
end
end

View file

@ -257,6 +257,11 @@ class FixturesWithoutInstantiationTest < ActiveRecord::TestCase
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
assert_equal "Jamis", developers(:jamis).name