Getting started with tests in Rails

We decided to use rails to create our small project. This is a really small project and is likely to take six person-months or less. All people working on the project are new to Rails and have limited experience in web coding.

Our software should provide users with an easy-to-use interface for viewing a huge amount of measurement and visualization data. Users identify themselves using a user account that restricts the data that they can see.

What automatic tests should we do, and are there textbooks that are freely available to help us do this?

+3
source share
5 answers

Consider the three β€œlegs” of the MVC (model-view-controller) design pattern on which Rails is based.

representation

They should be largely devoid of business logic: the code should be associated with the display of data and manipulation of the user interface.

Controllers

Minimal logic (the usual wisdom is to work with "thin controllers"). Testing (in the "test / functional" directory) should be simple and, I hope, mainly related to checking the contents of navigation and response. Begin with the idea of ​​simplifying them as long as possible, so you will be ready for more complex testing topics when you need them.

Models

-. , , , . , , .

, Noel Rappin Rails Prescriptions - () PDF-, Rails .

+4

railscasts. rspec: ! (, ), . , , , . (, )

0

, , , Blackbox

0

Thoughtbot Shoulda is a very easy to use and intuitive testing environment, with language options and not much "magic" that needs to be learned through tutorials and reading api.

Dave Thomas, one of the authors of the Rails science fiction book Agile Web Development with Rails, offers a good, quick overview of Shoulda .

0
source

Source: https://habr.com/ru/post/1709691/


All Articles