How to use rspec to check the screen?

I am writing a site that will rely a lot on screen shielding. Since I know that screen scripting is prone to hacking, I would like to somehow receive a notification that there is a problem.

The solution that I think will work is to write an rspec test for each site I want to support. The test will open several deleted pages from each site and compare them with the results that I expect from my scraper. I would also like to run the same tests on locally cached copies so that I know if my code has changed the scraper or deleted the site. I would like to somehow run these tests once a day and notify me of any problems.

In the end, I would like to make it a stone, because it is a repetition problem for me. I usually make a lot of scratches, and it would be nice to know when everything breaks.

So my problem is that I'm relatively new to writing tests for my code, and I don't know what the best way to fix this.

+4
source share
1 answer

Take a look at the gem of the VCR , which will allow you to get local copies of the various pages that you want to test, being able to constantly update them, as well as testing against live pages.

+5
source

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


All Articles