Helper functions in Rails unit tests -
I am using this type of code in my code tests in my code.
The test should be "amazing" really insists on the end
I am using a factoryguir instead of fixtures.
I think I am repeating myself very much and it will be very useful to do auxiliary work. What is the best way to create and call support functions in unit testing? Is there any such before_filter
as it is in the controller (I tried to put it in, but this is just an undefined method). Any help is appreciated!
You can add utility work to your unit tests without any problems. Unless you say them like "test_something" they will not run as a unit test, then you can call them in your actual unit testing methods (the format you use when you boil down to keep any method in the class ).
should:
test "
The utility methods used in all places can be found in test_helper and they all You can optionally do a module that you combine in your tests to provide common utility methods.
If you set up a unit before testing If you are making normal calls then you have a setup
method in which class Each test will be called before.
Comments
Post a Comment