/discrepency-detector

API that check and display the discrepancies between 2 web-services.

Primary LanguageRuby

Discrepency Detector

Travis build information for branch master Dependency Status Security warnings Maintainability Test Coverage

This is an API that check and display the discrepencies between 2 web-services. Check the original spec.

Usage example:

curl -vv -H "Accept: application/json" -H "Content-type: application/json" -XPOST http://localhost:3000/ads/status --data '{"ads": [{"external_reference": "1", "status": "active", "description": "foo", "id": 42, "job_id": 2029}]}'

Returns

{
  "enabled": [
    {
      "id": "1",
      "ad_server_reference": 42,
      "job_id": 2029,
      "status": "enabled",
      "description": "Description for campaign 11"
    }
  ],
  "deleted": [],
  "disabled": [],
  "discrepencies": [
    {
      "id": "2",
      "ad_server_reference": 44,
      "job_id": 2030,
      "status": "disabled",
      "description": "Description for campaign 12"
    }
  ]
}

Set up

  • Install ruby 2.4.2. For instance, using rvm: rvm install 2.4.2
  • Install gem bundler: gem install bundler --no-ri --no-rdoc
  • Install dependencies: bundle install

Run it

  • Start the webserver: bin/rails s

Test suite

On top of each commit, all tests must pass:

  bundle exec rake

Check code syntax

On top of each commit, no offenses must be detected

  bundle exec rubocop -- .