diff --git a/app/controllers/commentaires_controller.rb b/app/controllers/commentaires_controller.rb index 9120d3671..17bb3fa46 100644 --- a/app/controllers/commentaires_controller.rb +++ b/app/controllers/commentaires_controller.rb @@ -7,7 +7,7 @@ class CommentairesController < ApplicationController @commentaire.save - if request.referer.include?'/recapitulatif' + if request.referer.include? '/recapitulatif' redirect_to url_for({controller: :recapitulatif, action: :show, :dossier_id => params['dossier_id']}) else redirect_to url_for({controller: 'admin/dossier', action: :show, :dossier_id => params['dossier_id']}) diff --git a/app/controllers/recapitulatif_controller.rb b/app/controllers/recapitulatif_controller.rb index 7f5bf4f87..c5670277d 100644 --- a/app/controllers/recapitulatif_controller.rb +++ b/app/controllers/recapitulatif_controller.rb @@ -9,8 +9,7 @@ class RecapitulatifController < ApplicationController @commentaires = @commentaires.all.decorate @commentaire_email = @dossier.mail_contact - rescue => e - + rescue redirect_to url_for({controller: :start, action: :error_dossier}) end end diff --git a/spec/controllers/demandes_controller_spec.rb b/spec/controllers/demandes_controller_spec.rb index 2d97a332b..c53d0509d 100644 --- a/spec/controllers/demandes_controller_spec.rb +++ b/spec/controllers/demandes_controller_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' RSpec.describe DemandesController, type: :controller do let(:dossier) { create(:dossier, formulaire_id: '') } - let (:dossier_id) { dossier.id } + let(:dossier_id) { dossier.id } describe "GET #show" do it "returns http success" do diff --git a/spec/controllers/description_controller_spec.rb b/spec/controllers/description_controller_spec.rb index ec08574c3..80cbae940 100644 --- a/spec/controllers/description_controller_spec.rb +++ b/spec/controllers/description_controller_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' describe DescriptionController, type: :controller do let(:dossier) { create(:dossier) } - let (:dossier_id) { dossier.id } - let (:bad_dossier_id) { Dossier.count + 10 } + let(:dossier_id) { dossier.id } + let(:bad_dossier_id) { Dossier.count + 10 } describe "GET #show" do it "returns http success" do diff --git a/spec/controllers/dossiers_controller_spec.rb b/spec/controllers/dossiers_controller_spec.rb index 19e44ce02..7db157369 100644 --- a/spec/controllers/dossiers_controller_spec.rb +++ b/spec/controllers/dossiers_controller_spec.rb @@ -2,12 +2,12 @@ require 'spec_helper' RSpec.describe DossiersController, type: :controller do let(:dossier) { create(:dossier, :with_entreprise) } - let (:dossier_id) { dossier.id } - let (:siret_not_found) { 999999999999 } + let(:dossier_id) { dossier.id } + let(:siret_not_found) { 999999999999 } - let (:siren) { dossier.siren } - let (:siret) { dossier.siret } - let (:bad_siret){1} + let(:siren) { dossier.siren } + let(:siret) { dossier.siret } + let(:bad_siret){1} describe 'GET #show' do it "returns http success with dossier_id valid" do diff --git a/spec/factories/dossier.rb b/spec/factories/dossier.rb index dfaa9d5a7..b4d16b069 100644 --- a/spec/factories/dossier.rb +++ b/spec/factories/dossier.rb @@ -3,7 +3,7 @@ FactoryGirl.define do formulaire_id 12 trait :with_entreprise do - after(:build) do |dossier, evaluator| + after(:build) do |dossier, _evaluator| etablissement = create(:etablissement) entreprise = create(:entreprise, etablissement: etablissement) dossier.entreprise = entreprise diff --git a/spec/features/demandes_page/show_page_spec.rb b/spec/features/demandes_page/show_page_spec.rb index ee62a94b8..4568e68a7 100644 --- a/spec/features/demandes_page/show_page_spec.rb +++ b/spec/features/demandes_page/show_page_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Demandes#Show Page' do let(:dossier) { create(:dossier)} - let (:dossier_id) { dossier.id } + let(:dossier_id) { dossier.id } before do visit "/dossiers/#{dossier_id}/demande" @@ -14,11 +14,11 @@ feature 'Demandes#Show Page' do end scenario 'la liste des demandes possibles est présente' do - expect(page).to have_selector ('select[id=formulaire][name=formulaire]'); + expect(page).to have_selector('select[id=formulaire][name=formulaire]'); end scenario 'le bouton "Etape suivante" est présent' do - expect(page).to have_selector ('#etape_suivante'); + expect(page).to have_selector('#etape_suivante'); end end end \ No newline at end of file