I am trying to setup some tests for the first time but I have run into
an error
which I cannot solve
I have a function (set_due), defined in the main class (todo) , that
takes an
instance of the main class as a parameter, and updates an attribute
(due) of the
instance’s DB record. Not very OO but works OK
I want to test that set_due correctly calculates a new due date. in the
functional test script I have added:-
def test_set_due
@todo = Todo.new(:when_id => 4,:day=>1,:week=>2,:month=>nil)
# might need to save here
set_due(@todo)
# need to assert something here
end
which gives the following error when running:-
test_set_due(TodosControllerTest):NoMethodError: undefined method
`set_due’ for
#TodosControllerTest:0x38d7460
The test cannot seem to find the set_due method? I have syntax checked
the
controller (ruby -c) and made the set_due method public but neither
helps. stuck
Peter