diff options
| author | Robert | 2017-11-13 13:19:06 +0100 | 
|---|---|---|
| committer | Robert | 2017-11-17 14:57:36 +0100 | 
| commit | e4d75876d5bd9a4560133395f119abc05dc00b3d (patch) | |
| tree | fe91dc719a7acb9b50c1f50e42f5adf3516900a2 | |
| parent | 52f185193aea2e47feff0aa9b395ee67b86608f1 (diff) | |
| download | chouette-core-e4d75876d5bd9a4560133395f119abc05dc00b3d.tar.bz2 | |
Refs: #4823@1.7h; CodeReview #show -> #executed
| -rw-r--r-- | app/controllers/compliance_check_sets_controller.rb | 10 | ||||
| -rw-r--r-- | app/helpers/compliance_check_sets_helper.rb | 4 | ||||
| -rw-r--r-- | app/views/compliance_check_sets/executed.html.slim (renamed from app/views/compliance_check_sets/show.html.slim) | 0 | ||||
| -rw-r--r-- | app/views/compliance_checks/_filters.html.slim | 2 | ||||
| -rw-r--r-- | config/routes.rb | 1 | ||||
| -rw-r--r-- | db/schema.rb | 43 | ||||
| -rw-r--r-- | spec/controllers/compliance_check_sets_controller_spec.rb | 4 | ||||
| -rw-r--r-- | spec/features/compliance_ckeck_sets_spec.rb | 4 | 
8 files changed, 25 insertions, 43 deletions
| diff --git a/app/controllers/compliance_check_sets_controller.rb b/app/controllers/compliance_check_sets_controller.rb index 56d1b9f1f..5f392ef82 100644 --- a/app/controllers/compliance_check_sets_controller.rb +++ b/app/controllers/compliance_check_sets_controller.rb @@ -19,8 +19,8 @@ class ComplianceCheckSetsController < InheritedResources::Base      end    end -  def show -    show!(&method(:implement_show)) +  def executed +    show!(&method(:implement_executed))    end @@ -28,11 +28,11 @@ class ComplianceCheckSetsController < InheritedResources::Base    # Action Implementation    # --------------------- -  def implement_show format -    format.html(&method(:implement_show_for_html)) +  def implement_executed format +    format.html(&method(:implement_executed_for_html))    end -  def implement_show_for_html _mime_response +  def implement_executed_for_html _mime_response      @q_checks_form        = @compliance_check_set.compliance_checks.ransack(params[:q])      @compliance_check_set = @compliance_check_set.decorate      @compliance_checks    = diff --git a/app/helpers/compliance_check_sets_helper.rb b/app/helpers/compliance_check_sets_helper.rb index 349ecae87..fc7165fed 100644 --- a/app/helpers/compliance_check_sets_helper.rb +++ b/app/helpers/compliance_check_sets_helper.rb @@ -3,6 +3,10 @@ module ComplianceCheckSetsHelper      workbench_compliance_check_set_path(compliance_check_set.workbench, compliance_check_set)    end +  def executed_compliance_check_set_path(compliance_check_set) +    executed_workbench_compliance_check_set_path(compliance_check_set.workbench, compliance_check_set) +  end +    def compliance_check_path(compliance_check)      workbench_compliance_check_set_compliance_check_path(        compliance_check.compliance_check_set.workbench, diff --git a/app/views/compliance_check_sets/show.html.slim b/app/views/compliance_check_sets/executed.html.slim index d02adc6b8..d02adc6b8 100644 --- a/app/views/compliance_check_sets/show.html.slim +++ b/app/views/compliance_check_sets/executed.html.slim diff --git a/app/views/compliance_checks/_filters.html.slim b/app/views/compliance_checks/_filters.html.slim index 189e3d787..902fb0735 100644 --- a/app/views/compliance_checks/_filters.html.slim +++ b/app/views/compliance_checks/_filters.html.slim @@ -1,6 +1,6 @@  / Compliance Check Filter  = search_form_for @q_checks_form, -  url: compliance_check_set_path(@compliance_check_set), +  url: executed_compliance_check_set_path(@compliance_check_set),    builder: SimpleForm::FormBuilder,    class: 'form form-filter' do |f| diff --git a/config/routes.rb b/config/routes.rb index 8221dfe1a..8ea8168bf 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -12,6 +12,7 @@ ChouetteIhm::Application.routes.draw do        end      end      resources :compliance_check_sets, only: [:index, :show] do +      get :executed, on: :member        resources :compliance_checks, only: [:show]      end    end diff --git a/db/schema.rb b/db/schema.rb index b8c97f138..477a2fbf4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -284,22 +284,6 @@ ActiveRecord::Schema.define(version: 20171114102438) do    add_index "connection_links", ["objectid"], name: "connection_links_objectid_key", unique: true, using: :btree -  create_table "delayed_jobs", id: :bigserial, force: :cascade do |t| -    t.integer  "priority",               default: 0 -    t.integer  "attempts",               default: 0 -    t.text     "handler" -    t.text     "last_error" -    t.datetime "run_at" -    t.datetime "locked_at" -    t.datetime "failed_at" -    t.string   "locked_by",  limit: 255 -    t.string   "queue",      limit: 255 -    t.datetime "created_at" -    t.datetime "updated_at" -  end - -  add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree -    create_table "exports", id: :bigserial, force: :cascade do |t|      t.integer  "referential_id",  limit: 8      t.string   "status" @@ -421,11 +405,11 @@ ActiveRecord::Schema.define(version: 20171114102438) do      t.datetime "started_at"      t.datetime "ended_at"      t.string   "token_download" -    t.string   "type",                  limit: 255 +    t.string   "type"      t.integer  "parent_id",             limit: 8      t.string   "parent_type" -    t.integer  "current_step",                      default: 0 -    t.integer  "total_steps",                       default: 0 +    t.integer  "current_step",                    default: 0 +    t.integer  "total_steps",                     default: 0      t.datetime "notified_parent_at"      t.string   "creator"    end @@ -566,11 +550,6 @@ ActiveRecord::Schema.define(version: 20171114102438) do    add_index "networks", ["objectid"], name: "networks_objectid_key", unique: true, using: :btree    add_index "networks", ["registration_number"], name: "networks_registration_number_key", using: :btree -  create_table "object_id_factories", id: :bigserial, force: :cascade do |t| -    t.datetime "created_at", null: false -    t.datetime "updated_at", null: false -  end -    create_table "organisations", id: :bigserial, force: :cascade do |t|      t.string   "name"      t.datetime "created_at" @@ -737,7 +716,7 @@ ActiveRecord::Schema.define(version: 20171114102438) do    create_table "stop_areas", id: :bigserial, force: :cascade do |t|      t.integer  "parent_id",                       limit: 8 -    t.string   "objectid",                                                              null: false +    t.string   "objectid",                                                            null: false      t.integer  "object_version",                  limit: 8      t.string   "creator_id"      t.string   "name" @@ -746,8 +725,8 @@ ActiveRecord::Schema.define(version: 20171114102438) do      t.string   "registration_number"      t.string   "nearest_topic_name"      t.integer  "fare_code" -    t.decimal  "longitude",                                   precision: 19, scale: 16 -    t.decimal  "latitude",                                    precision: 19, scale: 16 +    t.decimal  "longitude",                                 precision: 19, scale: 16 +    t.decimal  "latitude",                                  precision: 19, scale: 16      t.string   "long_lat_type"      t.string   "country_code"      t.string   "street_name" @@ -765,7 +744,7 @@ ActiveRecord::Schema.define(version: 20171114102438) do      t.datetime "deleted_at"      t.datetime "created_at"      t.datetime "updated_at" -    t.string   "stif_type",                       limit: 255 +    t.string   "stif_type"    end    add_index "stop_areas", ["name"], name: "index_stop_areas_on_name", using: :btree @@ -836,12 +815,12 @@ ActiveRecord::Schema.define(version: 20171114102438) do    add_index "time_table_periods", ["time_table_id"], name: "index_time_table_periods_on_time_table_id", using: :btree    create_table "time_tables", id: :bigserial, force: :cascade do |t| -    t.string   "objectid",                                null: false -    t.integer  "object_version",  limit: 8,   default: 1 +    t.string   "objectid",                              null: false +    t.integer  "object_version",  limit: 8, default: 1      t.string   "creator_id"      t.string   "version"      t.string   "comment" -    t.integer  "int_day_types",               default: 0 +    t.integer  "int_day_types",             default: 0      t.date     "start_date"      t.date     "end_date"      t.integer  "calendar_id",     limit: 8 @@ -994,9 +973,7 @@ ActiveRecord::Schema.define(version: 20171114102438) do    add_foreign_key "compliance_controls", "compliance_control_blocks"    add_foreign_key "compliance_controls", "compliance_control_sets"    add_foreign_key "group_of_lines_lines", "group_of_lines", name: "groupofline_group_fkey", on_delete: :cascade -  add_foreign_key "journey_frequencies", "timebands", name: "journey_frequencies_timeband_id_fk", on_delete: :nullify    add_foreign_key "journey_frequencies", "timebands", on_delete: :nullify -  add_foreign_key "journey_frequencies", "vehicle_journeys", name: "journey_frequencies_vehicle_journey_id_fk", on_delete: :nullify    add_foreign_key "journey_frequencies", "vehicle_journeys", on_delete: :nullify    add_foreign_key "journey_patterns", "routes", name: "jp_route_fkey", on_delete: :cascade    add_foreign_key "journey_patterns", "stop_points", column: "arrival_stop_point_id", name: "arrival_point_fkey", on_delete: :nullify diff --git a/spec/controllers/compliance_check_sets_controller_spec.rb b/spec/controllers/compliance_check_sets_controller_spec.rb index 804b0a658..3ddb1dad1 100644 --- a/spec/controllers/compliance_check_sets_controller_spec.rb +++ b/spec/controllers/compliance_check_sets_controller_spec.rb @@ -5,9 +5,9 @@ RSpec.describe ComplianceCheckSetsController, type: :controller do    let(:compliance_check_set) { create :compliance_check_set } -  describe "GET show" do +  describe "GET executed" do      it 'should be successful' do -      get :show, workbench_id: compliance_check_set.workbench.id, id: compliance_check_set.id +      get :executed, workbench_id: compliance_check_set.workbench.id, id: compliance_check_set.id        expect(response).to be_success      end    end diff --git a/spec/features/compliance_ckeck_sets_spec.rb b/spec/features/compliance_ckeck_sets_spec.rb index 9d04ef200..c8fb16c93 100644 --- a/spec/features/compliance_ckeck_sets_spec.rb +++ b/spec/features/compliance_ckeck_sets_spec.rb @@ -19,10 +19,10 @@ RSpec.describe "ComplianceCheckSets", type: :feature do    let!(:direct_checks){ make_check(nil, times: 2) + make_check(nil, severity: :error) }    let!(:indirect_checks){ blox.map{ |block| make_check(block) } } -  context 'show' do +  context 'executed' do      before do -      visit(compliance_check_set_path(compliance_check_set)) +      visit(executed_compliance_check_set_path(compliance_check_set))      end      it 'we can see the expected content' do | 
