-
Notifications
You must be signed in to change notification settings - Fork 0
client_test: Tests are not valuable #116
Comments
That is literally the same thing. The only thing different is that you show an invalid name is invalid, also a no duh test. The tests would be useful if client.rb had any interesting methods but it doesn't so there are no interesting tests. |
@bnickodemus It is not the same thing. Look at the first test. You are explicitly setting valid attributes and then asserting that the client is valid. Because you are explicitly setting valid attributes, the test does not prove anything. Now look at the second test. It is entirely different. First, you are asserting that the client is in a valid state, before making a single change to an attribute that will make the client invalid. By explicitly changing only Prove it to yourself: remove the |
Hi Yong, |
@bnickodemus Glad you asked! First, do you see the difference in the previous tests above? Do you see how the first test isn't valuable, but the second test is? Also, look at client_test.rb. Some notes:
|
The tests are merely re-asserting the obvious. You are instantiating a valid client and then asserting that it is valid, why saying " with a first name is valid.
This is a "no duh" test. Instead, test that a valid client that then has an invalid name is considered invalid.
Same for the other tests.
The text was updated successfully, but these errors were encountered: