diff options
| author | Teddy Wing | 2017-11-02 18:30:31 +0100 | 
|---|---|---|
| committer | cedricnjanga | 2017-11-13 17:52:54 +0100 | 
| commit | d3c747d149046a864f3be69daf03b2393ca53dc6 (patch) | |
| tree | 04ccaec9205cbd8d96e57c9e956d456f58c8a242 | |
| parent | 95095886ceb51a2036eea6ffda103d3ad590322b (diff) | |
| download | chouette-core-d3c747d149046a864f3be69daf03b2393ca53dc6.tar.bz2 | |
Add route stub for validation finalisation
This route will be called by the Java application when ComplianceCheck
validation is completed.
It will perform post-validation work, primarily updating statuses.
Refs #4757
| -rw-r--r-- | app/controllers/api/v1/compliance_check_sets_controller.rb | 6 | ||||
| -rw-r--r-- | config/routes.rb | 1 | ||||
| -rw-r--r-- | spec/controllers/api/v1/compliance_check_sets_controller_spec.rb | 7 | 
3 files changed, 14 insertions, 0 deletions
| diff --git a/app/controllers/api/v1/compliance_check_sets_controller.rb b/app/controllers/api/v1/compliance_check_sets_controller.rb new file mode 100644 index 000000000..b7206014d --- /dev/null +++ b/app/controllers/api/v1/compliance_check_sets_controller.rb @@ -0,0 +1,6 @@ +class Api::V1::ComplianceCheckSetsController < Api::V1::IbooController +  defaults resource_class: ComplianceCheckSet + +  def validated +  end +end diff --git a/config/routes.rb b/config/routes.rb index 0470d9aec..8d7d4c92d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -63,6 +63,7 @@ ChouetteIhm::Application.routes.draw do        resources :stop_areas, only: [:index, :show]        resources :time_tables, only: [:index, :show]        resources :vehicle_journeys, only: :show +      post 'compliance_check_sets/validated', to: 'compliance_check_sets#validated'      end    end diff --git a/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb b/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb new file mode 100644 index 000000000..c9c58c7cb --- /dev/null +++ b/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb @@ -0,0 +1,7 @@ +RSpec.describe Api::V1::ComplianceCheckSetsController, type: :controller do +  describe "POST #validate" do +    it "calls [that thing that updates statuses on ComplianceCheckX]" do +      post :validated, params: { id: 5 } +    end +  end +end | 
