O
OnRails Ruby
class PersonTest < Test::Unit::TestCase
fixtures
eople
def setup
end
def test_should_create_person
assert_difference people, :count do
person=Person.newly_created
assert !person.new_record?,
"#{person.errors.full_messages.to_sentence}"
end
end
end
people.yml
test1:
id: 1
user_id: 1
firstname: test1
lastname: YY
test2:
id: 2
user_id: 2
firstname: test2
lastname: TT
ruby test\unit\person_test.rb
1) Error:
test_should_create_person(PersonTest):
ArgumentError: wrong number of arguments (0 for 1)
test/unit/person_test.rb:16:in `people'
test/unit/person_test.rb:16:in `test_should_create_person'
1 tests, 0 assertions, 0 failures, 1 errors
I don't know why causeed this proble. who can tell me? Thanks.
fixtures
def setup
end
def test_should_create_person
assert_difference people, :count do
person=Person.newly_created
assert !person.new_record?,
"#{person.errors.full_messages.to_sentence}"
end
end
end
people.yml
test1:
id: 1
user_id: 1
firstname: test1
lastname: YY
test2:
id: 2
user_id: 2
firstname: test2
lastname: TT
ruby test\unit\person_test.rb
1) Error:
test_should_create_person(PersonTest):
ArgumentError: wrong number of arguments (0 for 1)
test/unit/person_test.rb:16:in `people'
test/unit/person_test.rb:16:in `test_should_create_person'
1 tests, 0 assertions, 0 failures, 1 errors
I don't know why causeed this proble. who can tell me? Thanks.