A
A
Alexander Grishin2015-10-24 20:46:41
Ruby on Rails
Alexander Grishin, 2015-10-24 20:46:41

How are tests different from validation?

Why do I need tests? When there is validation, why do we need tests?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Poimtsev, 2015-10-24
@poimtsev

Validation is an additional feature of the framework that allows you to check whether the dressed data meets your expectations. For example - that the user will enter a password of 8 characters, and not of 3, or that the site address " wwdi.ru " is correct, but "yaya//yvayva,.," is incorrect. Tests, on the other hand, are a tool for checking how your code works correctly, for example, that after login, the user is sent to the dashboard, and with correct registration, a new user appears.

R
Roman Kitaev, 2015-10-24
@deliro

I don't know why you need tests. You can replace them with validation. In our villages, this is not yet possible.

I
index0h, 2015-10-24
@index0h

It's hard to say how they differ, it's like asking: what is the difference between blue and soft.
Validation involves checking data with a positive or negative result.
Assertions are similar to validations, but must throw exceptions, unlike validations.
Tests involve checking the business logic of the application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question