automch-code / google-scraping

0 stars 0 forks source link

[Chore] Add test for the Google Scraper #26

Closed olivierobert closed 11 months ago

olivierobert commented 11 months ago

Issue

Automated tests do not cover the core business logic: scraping.

Expected

While 100% test coverage is not required for this code challenge, all critical paths of the application should be unit-tested (and, ideally, UI-tested). So the following should be covered:

[!NOTE] Writing tests for an asynchronous process that makes HTTP requests is where the tricky parts lie. This is why you are expected to propose a valid solution.

automch-code commented 11 months ago

Hello, Olivier thank you for letting me know. I will proceed to add RSpec for core logic.

olivierobert commented 11 months ago

As a hint, you will need to record the request to Google. A team such as https://github.com/vcr/vcr is usually the easiest go-to tool.

automch-code commented 11 months ago

Hello Olivier I try to use Webmock when GoogleScraper.call here pull-request. I'm not sure if I do it the right way.

olivierobert commented 11 months ago

The usage of Webmock is sound. The implementation is sufficient to show you can research a new tool and apply it 💪