Enable the Layout/EmptyLinesAroundBlockBody cop

This commit is contained in:
gregoirenovel 2017-06-12 15:58:15 +02:00
parent aac75106ef
commit f1907f4d0e
84 changed files with 1 additions and 133 deletions

View file

@ -52,7 +52,7 @@ Layout/EmptyLinesAroundBeginBody:
Enabled: true
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Enabled: true
Layout/EmptyLinesAroundClassBody:
Enabled: false

View file

@ -12,7 +12,6 @@ class SIADE::RNAAdapter
data_source[:association].each do |k, v|
params[k] = v if attr_to_fetch.include?(k)
end
params[:association_id] = params[:id]

View file

@ -55,7 +55,6 @@ class Gestionnaire < ActiveRecord::Base
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
table.second.each do |column|
if valid_couple_table_attr? table.first, column.first
PreferenceListDossier.create(
libelle: column.second[:libelle],

View file

@ -14,5 +14,4 @@ Apipie.configure do |config|
Description
EOS
end

View file

@ -1,5 +1,4 @@
Rails.application.routes.draw do
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
devise_for :administrations, skip: [:password, :registrations]
@ -144,7 +143,6 @@ Rails.application.routes.draw do
resource :accompagnateurs, only: [:show, :update]
resource :previsualisation, only: [:show]
end
namespace :accompagnateurs do

View file

@ -13,7 +13,6 @@ class CreateEntreprise < ActiveRecord::Migration
t.integer :date_creation
t.string :nom
t.string :prenom
end
add_reference :entreprises, :dossier, references: :dossiers
end

View file

@ -4,7 +4,6 @@ class BuildDefaultPreferenceListDossier < ActiveRecord::Migration
PreferenceListDossier.available_columns.each do |table|
table.second.each do |column|
if valid_couple_table_attr? table.first, column.first
PreferenceListDossier.create(
libelle: column.second[:libelle],

View file

@ -99,7 +99,6 @@ class ResetAllPreferenceListDossier < ActiveRecord::Migration
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
table.second.each do |column|
if valid_couple_table_attr? table.first, column.first
PreferenceListDossier.create(
libelle: column.second[:libelle],

View file

@ -1,14 +1,12 @@
class CreateNotification < ActiveRecord::Migration[5.0]
def change
create_table :notifications do |t|
t.boolean :already_read, default: false
t.string :liste, array: true
t.boolean :multiple, default: false
t.string :type_notif
t.datetime :created_at
t.datetime :updated_at
end
add_belongs_to :notifications, :dossier

View file

@ -11,7 +11,6 @@
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170523092900) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -475,5 +474,4 @@ ActiveRecord::Schema.define(version: 20170523092900) do
LEFT JOIN individuals ON ((individuals.dossier_id = dossiers.id)))
LEFT JOIN pieces_justificatives ON ((pieces_justificatives.dossier_id = dossiers.id)));
SQL
end

View file

@ -1,5 +1,4 @@
namespace :cloudstorage do
task init: :environment do
os_config = (YAML.load_file(Fog.credentials_path))['default']
@os = OpenStack::Connection.create(
@ -109,5 +108,4 @@ namespace :cloudstorage do
@cont.delete_object(object) unless last_modified.utc > (Time.now - 2.year).utc
}
end
end

View file

@ -12,5 +12,4 @@ describe Admin::PrevisualisationsController, type: :controller do
subject { get :show, params: {procedure_id: procedure.id} }
it { expect(subject.status).to eq(200) }
end
end

View file

@ -54,7 +54,6 @@ describe Admin::ProceduresController, type: :controller do
end
describe 'DELETE #destroy' do
let(:procedure_draft) { create :procedure, published: false, archived: false }
let(:procedure_published) { create :procedure, published: true, archived: false }
let(:procedure_archived) { create :procedure, published: false, archived: true }
@ -150,7 +149,6 @@ describe Admin::ProceduresController, type: :controller do
it { expect(subject.direction).to eq(direction) }
it { expect(subject.lien_demarche).to eq(lien_demarche) }
it { expect(subject.administrateur_id).to eq(admin.id) }
end
describe 'procedure module api carto attributs in database' do
@ -278,7 +276,6 @@ describe Admin::ProceduresController, type: :controller do
it { expect(subject.for_individual).not_to eq procedure_params[:for_individual] }
it { expect(subject.individual_with_siret).not_to eq procedure_params[:individual_with_siret] }
it { expect(subject.use_api_carto).not_to eq procedure_params[:module_api_carto_attributes][:use_api_carto] }
end
end
end
@ -465,7 +462,6 @@ describe Admin::ProceduresController, type: :controller do
it { expect(body.first['mine']).to be_truthy }
it { expect(body.second['label']).to eq(procedure2.path) }
it { expect(body.second['mine']).to be_falsy }
end
context 'filtered' do
@ -482,7 +478,6 @@ describe Admin::ProceduresController, type: :controller do
end
context 'when procedure is archived' do
before do
procedure3.update_attribute :archived, true
subject

View file

@ -1,11 +1,9 @@
require 'spec_helper'
describe AdministrationsController, type: :controller do
let(:administration) { create :administration }
describe 'GET #index' do
subject { get :index }
context 'when administration user is not connect' do
@ -13,7 +11,6 @@ describe AdministrationsController, type: :controller do
end
context 'when administration user is connect' do
before do
sign_in administration
end
@ -23,7 +20,6 @@ describe AdministrationsController, type: :controller do
end
describe 'POST #create' do
let(:email) { 'plop@plop.com' }
let(:password) { 'password' }
@ -43,7 +39,6 @@ describe AdministrationsController, type: :controller do
expect(NewAdminMailer).to receive(:deliver_now!)
subject
end
end
context 'when email or password are missing' do

View file

@ -2,7 +2,6 @@ require 'spec_helper'
describe API::StatistiquesController, type: :controller do
describe '#GET dossiers_stats' do
before do
get :dossiers_stats
end

View file

@ -95,7 +95,6 @@ describe API::V1::DossiersController do
end
context 'when procedure is found and belongs to current admin' do
context 'when dossier does not exist' do
let(:procedure_id) { procedure.id }
let(:dossier_id) { 99999 }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe Backoffice::AvisController, type: :controller do
describe '#POST create' do
let(:gestionnaire){ create(:gestionnaire) }
let!(:dossier){ create(:dossier, state: 'received') }

View file

@ -346,7 +346,6 @@ describe Backoffice::DossiersController, type: :controller do
it 'change state for updated' do
expect(dossier.state).to eq 'updated'
end
end
describe 'flash alert' do

View file

@ -16,7 +16,6 @@ describe Ban::SearchController, type: :controller do
end
context 'when request return nothing', vcr: {cassette_name: 'bano_search_nothing'} do
let (:request) { 'je recherche pas grand chose' }
it { expect(response.status).to eq 200 }

View file

@ -2,7 +2,6 @@ require 'spec_helper'
describe CguController, type: :controller do
describe 'GET #index' do
subject { get :index }
it { expect(subject.status).to eq 200 }

View file

@ -2,7 +2,6 @@ require 'spec_helper'
describe DemoController, type: :controller do
describe 'GET #index' do
subject { get :index }
it { expect(subject.status).to eq 200 }

View file

@ -41,7 +41,6 @@ describe InvitesController, type: :controller do
it { expect(invite.user).to eq user }
it { expect(flash[:notice]).to be_present }
end
context 'when email is not assign to an user' do

View file

@ -2,13 +2,11 @@ require 'spec_helper'
describe PingController, type: :controller do
describe 'GET #index' do
subject { get :index }
it { expect(subject.status).to eq 200 }
context 'when base is un-plug' do
before do
allow(ActiveRecord::Base).to receive(:connected?).and_return(false)
end

View file

@ -64,7 +64,6 @@ describe RootController, type: :controller do
end
it { expect(response.body).to have_css('.landing') }
end
context "unified login" do
@ -78,5 +77,4 @@ describe RootController, type: :controller do
expect(response.body).to have_css("a[href='#{new_user_session_path}']")
end
end
end

View file

@ -179,7 +179,6 @@ shared_examples 'carte_controller_spec' do
end
describe '#get_position' do
context 'when etablissement is nil' do
before do
dossier.update etablissement: nil

View file

@ -87,7 +87,6 @@ shared_examples 'description_controller_spec' do
context 'when dossier does not have an enterprise datas' do
before do
end
it { expect(dossier.entreprise).to be_nil }

View file

@ -2,7 +2,6 @@ require 'spec_helper'
describe Users::Dossiers::AddSiretController, type: :controller do
describe '#GET show' do
let(:dossier) { create :dossier }
before do

View file

@ -5,7 +5,6 @@ describe Users::Dossiers::CommentairesController, type: :controller do
let(:texte_commentaire) { 'Commentaire de test' }
describe '#POST create' do
subject {
post :create, params:{dossier_id: dossier.id, texte_commentaire: texte_commentaire}
dossier.reload
@ -42,7 +41,6 @@ describe Users::Dossiers::CommentairesController, type: :controller do
expect(NotificationMailer).to_not receive(:new_answer)
subject
end
end
end
end

View file

@ -66,7 +66,6 @@ describe Users::DossiersController, type: :controller do
it { expect { subject }.to change(Dossier, :count).by 1 }
describe 'save user siret' do
context 'when user have not a saved siret' do
context 'when siret is present on request' do
subject { get :new, params: {procedure_id: procedure_id, siret: siret} }
@ -349,7 +348,6 @@ describe Users::DossiersController, type: :controller do
end
it { expect(response.status).to eq 200 }
end
end
@ -456,7 +454,6 @@ describe Users::DossiersController, type: :controller do
it { expect { subject }.to change { Dossier.count }.by(0) }
end
end
describe 'PUT #change_siret' do

View file

@ -33,7 +33,6 @@ describe Users::RecapitulatifController, type: :controller do
it { is_expected.to redirect_to root_path }
end
end
end
describe 'POST #initiate' do

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe Users::RegistrationsController, type: :controller do
let(:email) { 'test@octo.com' }
let(:password) { 'password' }

View file

@ -83,7 +83,6 @@ describe Users::SessionsController, type: :controller do
end
it 'signs user + gestionnaire + administrateur in' do
post :create, params: {user: {email: administrateur.email, password: administrateur.password}}
expect(@response.redirect?).to be(true)
expect(subject.current_user).to eq(user)
@ -200,7 +199,6 @@ describe Users::SessionsController, type: :controller do
expect(subject.current_administrateur).to be(nil)
end
end
end
end

View file

@ -25,5 +25,4 @@ describe ProcedureDecorator do
it { expect(subject.quartiers_prioritaires).to be_falsey }
it { expect(subject.cadastre).to be_falsey }
end
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe ProceduresDecorator do
before do
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))

View file

@ -9,7 +9,6 @@ describe TypeDeChampDecorator do
let!(:type_de_champ_2) { create(:type_de_champ_public, procedure: procedure, order_place: 2) }
describe '#button_up' do
describe 'with first piece justificative' do
let(:index) { 0 }
subject { type_de_champ_0.decorate }
@ -50,5 +49,4 @@ describe TypeDeChampDecorator do
end
end
end
end

View file

@ -9,7 +9,6 @@ describe TypeDePieceJustificativeDecorator do
let!(:type_de_piece_justificative_2) { create(:type_de_piece_justificative, procedure: procedure, order_place: 2) }
describe '#button_up' do
describe 'with first piece justificative' do
let(:index) { 0 }
subject { type_de_piece_justificative_0.decorate }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe DossiersListFacades do
let(:gestionnaire) { create :gestionnaire }
let(:procedure) { create :procedure, libelle: 'Ma procédure' }
let(:procedure_2) { create :procedure, libelle: 'Ma seconde procédure' }
@ -27,7 +26,6 @@ describe DossiersListFacades do
end
describe '#preference_list_dossiers_filter' do
subject { facade.preference_list_dossiers_filter }
context 'when procedure is not pasted at the facade' do

View file

@ -1,6 +1,5 @@
FactoryGirl.define do
factory :champ do
type_de_champ { FactoryGirl.create(:type_de_champ_public) }
end
end

View file

@ -42,7 +42,6 @@ FactoryGirl.define do
trait :with_cerfa_upload do
after(:build) do |dossier, _evaluator|
dossier.cerfa << create(:cerfa)
end
end

View file

@ -1,6 +1,5 @@
FactoryGirl.define do
factory :type_de_piece_justificative do
libelle 'RIB'
description 'Releve identité bancaire'

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'add a new type de champs', js: true do
let(:administrateur) { create(:administrateur) }
let(:procedure) { create(:procedure, administrateur: administrateur) }

View file

@ -58,6 +58,5 @@ feature 'Administrator connection' do
end
end
end
end
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'As an administrateur I wanna clone a procedure', js: true do
let(:administrateur) { create(:administrateur) }
before do
@ -10,7 +9,6 @@ feature 'As an administrateur I wanna clone a procedure', js: true do
end
context 'Cloning procedure' do
before 'Create procedure' do
page.find_by_id('new-procedure').click
fill_in 'procedure_libelle', with: 'libelle de la procedure'

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'As an administrateur I wanna create a new procedure', js: true do
let(:administrateur) { create(:administrateur) }
before do
@ -10,7 +9,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
end
context 'Right after sign_in I shall see all procedure states links' do
scenario 'Finding draft procedures' do
page.find_by_id('draft-procedures').trigger('click')
expect(page).to have_current_path(admin_procedures_draft_path, only_path: true)
@ -28,7 +26,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
end
context 'Creating a new procedure' do
scenario 'Finding new procedure link' do
page.find_by_id('new-procedure').click
expect(page).to have_current_path(new_admin_procedure_path, only_path: true)

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'procedure locked' do
let(:administrateur) { create(:administrateur) }
let(:published) { false }
let(:procedure) { create(:procedure, administrateur: administrateur, published: published) }

View file

@ -20,7 +20,6 @@ feature 'As an Accompagnateur I can navigate and use each functionnality around
end
context 'On index' do
scenario 'Switching between procedures' do
page.all('#procedure-list a').first.click
expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_1.id.to_s), only_path: true)

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'usage of pref list dossier lateral panel', js: true do
let(:administrateur) { create(:administrateur) }
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
let(:procedure) { create(:procedure, administrateur: administrateur) }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'usage of pref list dossier lateral panel by procedure', js: true do
let(:administrateur) { create(:administrateur) }
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
let(:procedure) { create(:procedure, :with_type_de_champ, administrateur: administrateur) }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'France Connect Particulier Connexion' do
let(:code) { 'plop' }
let(:given_name) { 'titi' }
let(:family_name) { 'toto' }
@ -21,7 +20,6 @@ feature 'France Connect Particulier Connexion' do
}
context 'when user is on login page' do
before do
visit new_user_session_path
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'As a User I want to edit a dossier I own' do
let(:user) { create(:user) }
let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_type_de_champ, :with_two_type_de_piece_justificative, :with_dossier_link) }
let!(:dossier) { create(:dossier, :with_entreprise, :for_individual, :with_dossier_link, procedure: procedure_for_individual, user: user, autorisation_donnees: true, state: 'initiated') }
@ -12,7 +11,6 @@ feature 'As a User I want to edit a dossier I own' do
end
context 'After sign_in, I can navigate through dossiers indexes and edit a dossier' do
scenario 'After sign_in, I can see dossiers "à traiter" (default), and other indexes' do
expect(page.find('#a_traiter')['class'] ).to eq('active procedure-list-element')
page.find_by_id('brouillon').click

View file

@ -1,7 +1,6 @@
require 'spec_helper'
feature 'As a User I want to sort and paginate dossiers', js: true do
let(:user) { create(:user) }
let(:procedure_for_individual) { create(:procedure, :published, :for_individual) }
@ -21,7 +20,6 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
end
context 'After sign_in, I can see my 51 dossiers on the index' do
scenario 'Using sort' do
visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
@ -50,5 +48,4 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id).to_s)
end
end
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe Carto::GeoAPI::Driver do
describe '.regions', vcr: {cassette_name: 'geoapi_regions'} do
subject { described_class.regions }
@ -18,7 +17,6 @@ describe Carto::GeoAPI::Driver do
subject { described_class.pays }
it { is_expected.to eq File.open('app/lib/carto/geo_api/pays.json').read }
end
describe 'departements_url' do

View file

@ -9,6 +9,5 @@ RSpec.describe AvisMailer, type: :mailer do
it { expect(subject.subject).to eq("Donnez votre avis sur le dossier nº #{avis.dossier.id} (#{avis.dossier.procedure.libelle})") }
it { expect(subject.body).to include("Vous avez été invité par #{avis.claimant.email} à donner votre avis sur le dossier nº #{avis.dossier.id} de la procédure : #{avis.dossier.procedure.libelle}.") }
it { expect(subject.body).to include(avis.introduction) }
end
end

View file

@ -262,7 +262,6 @@ describe Dossier do
it { is_expected.to eq 'replied' }
end
end
end
@ -295,7 +294,6 @@ describe Dossier do
it { is_expected.to eq('replied') }
end
end
end
@ -661,7 +659,6 @@ describe Dossier do
it { expect(subject.second.type_de_champ.libelle).to eq 'type_2_2' }
it { expect(subject.last.type_de_champ.libelle).to eq 'type_2_3' }
end
end
describe '#ordered_champs_private' do
@ -850,7 +847,6 @@ describe Dossier do
it_behaves_like 'dossier is processed', 'without_continuation'
end
end
describe '.downloadable' do

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe DropDownList do
describe 'database columns' do
it { is_expected.to have_db_column(:value) }
end
@ -24,7 +23,6 @@ Pilotage / Ingénierie
context 'when one value is empty' do
let(:value) { "Cohésion sociale
Cadre de vie / Urb.
Pilotage / Ingénierie
"

View file

@ -23,7 +23,6 @@ describe Etablissement do
end
describe '#geo_adresse' do
let(:etablissement) { create(:etablissement) }
subject { etablissement.geo_adresse }

View file

@ -103,7 +103,6 @@ describe Gestionnaire, type: :model do
subject { gestionnaire.follow? dossier.id }
context 'when gestionnaire follow a dossier' do
before do
create :follow, dossier_id: dossier.id, gestionnaire_id: gestionnaire.id
end

View file

@ -32,7 +32,6 @@ describe Invite do
end
it { expect{ subject }.to raise_error ActiveRecord::RecordInvalid }
end
end
end

View file

@ -13,7 +13,6 @@ describe PieceJustificative do
it { is_expected.to belong_to(:type_de_piece_justificative) }
it { is_expected.to belong_to(:user) }
it { is_expected.to have_one(:commentaire) }
end
describe 'validations' do

View file

@ -190,7 +190,6 @@ describe PreferenceListDossier do
it { expect(subject[:order]).to be_nil }
it { expect(subject[:filter]).to be_nil }
end
end
describe 'etablissement' do

View file

@ -46,5 +46,4 @@ describe ProcedurePath do
end
end
end
end

View file

@ -175,7 +175,6 @@ describe Procedure do
subject.types_de_piece_justificative.zip(procedure.types_de_piece_justificative).each do |stc, ptc|
expect(stc).to have_same_attributes_as(ptc)
end
end
it 'should duplicate existing mail_templates' do
@ -244,7 +243,6 @@ describe Procedure do
end
describe 'total_dossier' do
let(:procedure) { create :procedure }
before do

View file

@ -9,7 +9,6 @@ describe QuartierPrioritaire do
it { is_expected.to belong_to(:dossier) }
describe 'geometry' do
let(:qp) { create :quartier_prioritaire, geometry: qp_geometry }
let(:qp_geometry) { File.open('spec/support/files/qp_geometry_value.txt').read }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe Siret, type: :model do
let(:valid_siret) { '41816609600051' }
let(:invalid_siret) { '111111111' }

View file

@ -43,7 +43,6 @@ shared_examples 'type_de_champ_spec' do
end
describe 'field_for_list?' do
let(:type_de_champ_yes) { create :type_de_champ_public, type_champ: 'text' }
let(:type_de_champ_no_1) { create :type_de_champ_public, type_champ: 'textarea' }
let(:type_de_champ_no_2) { create :type_de_champ_public, type_champ: 'header_section' }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe TypeDeChamp do
require 'models/type_de_champ_shared_example'
it_should_behave_like "type_de_champ_spec"

View file

@ -16,7 +16,6 @@ describe User, type: :model do
it { is_expected.to have_db_column(:updated_at) }
it { is_expected.to have_db_column(:siret) }
it { is_expected.to have_db_column(:loged_in_with_france_connect) }
end
describe 'associations' do
it { is_expected.to have_many(:dossiers) }

View file

@ -1,9 +1,7 @@
require 'spec_helper'
describe DossierTableExportSerializer do
describe '#emails_accompagnateurs' do
let(:gestionnaire){ create(:gestionnaire) }
let(:follow) { create(:follow, gestionnaire: gestionnaire) }
@ -28,7 +26,5 @@ describe DossierTableExportSerializer do
it { is_expected.to eq "#{gestionnaire.email} #{gestionnaire2.email}" }
end
end
end

View file

@ -1,14 +1,12 @@
require 'spec_helper'
describe AccompagnateurService do
let(:procedure) { create :procedure }
let(:accompagnateur) { create :gestionnaire }
let(:accompagnateur_service) { AccompagnateurService.new accompagnateur, procedure, to}
describe '#change_assignement!' do
subject { accompagnateur_service.change_assignement! }
context 'when accompagnateur is not assign at the procedure' do
@ -34,7 +32,6 @@ describe AccompagnateurService do
end
describe '#build_default_column' do
subject { accompagnateur_service.build_default_column }
context 'when to is not assign' do

View file

@ -24,7 +24,6 @@ describe DossiersListGestionnaireService do
end
context 'when gestionnaire have default sort' do
before do
preference_attr.update_column(:order, 'asc')
end
@ -74,7 +73,6 @@ describe DossiersListGestionnaireService do
it { expect(select_preference_list_dossier.order).to eq 'desc' }
end
end
context 'when procedure as already a preference order' do
@ -128,7 +126,6 @@ describe DossiersListGestionnaireService do
end
describe '#join_filter' do
subject { DossiersListGestionnaireService.new(gestionnaire, liste, nil).joins_filter }
it { is_expected.to eq []}
@ -180,7 +177,6 @@ describe DossiersListGestionnaireService do
it { is_expected.to eq "CAST(dossiers.id as TEXT) LIKE '%23%' AND CAST(entreprises.raison_sociale as TEXT) LIKE '%plop%'" }
context 'when last filter caractere is *' do
before do
gestionnaire.preference_list_dossiers
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
@ -242,7 +238,6 @@ describe DossiersListGestionnaireService do
end
it { is_expected.to eq "CAST(dossiers.id as TEXT) LIKE '%23%' AND CAST(entreprises.raison_sociale as TEXT) LIKE '%plop%' AND champs.type_de_champ_id = 34 AND CAST(champs.value as TEXT) LIKE '%plop%'" }
end
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe NotificationService do
describe '.notify' do
let(:dossier) { create :dossier }
let(:service) { described_class.new type_notif, dossier.id }

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe PrevisualisationService do
describe '.destroy_all_champs' do
subject { described_class.destroy_all_champs dossier }

View file

@ -43,7 +43,6 @@ describe UserRoutesAuthorizationService do
let(:controller) { Users::CarteController }
context 'when use_api_carto is false' do
describe 'draft' do
let(:state) { 'draft' }
it { is_expected.to be_falsey }

View file

@ -1,5 +1,4 @@
RSpec.configure do |config|
expect_list = %w()
config.before(:suite) do

View file

@ -4,7 +4,6 @@ describe BaseUploader do
let(:uploader) { described_class.new }
describe '#cache_dir' do
subject { uploader.cache_dir }
context 'when rails env is not production' do

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe RemoteDownloader do
let(:filename) { 'file_name.pdf' }
subject { described_class.new filename }

View file

@ -127,6 +127,5 @@ describe 'admin/previsualisations/show.html.haml', type: :view do
context 'when dossier not have cerfa, piece justificative and demarche link' do
it { expect(rendered).not_to have_content 'Documents administratifs' }
end
end
end

View file

@ -23,7 +23,6 @@ describe 'admin/procedures/show.html.haml', type: :view do
end
context 'when procedure have a gestionnare affected' do
before do
create :assign_to, gestionnaire: create(:gestionnaire), procedure: procedure
render
@ -76,7 +75,5 @@ describe 'admin/procedures/show.html.haml', type: :view do
describe 'procedure link is present' do
it { expect(rendered).to have_content(commencer_url(procedure_path: procedure.path)) }
end
end
end

View file

@ -7,7 +7,6 @@ describe 'layouts/_navbar.html.haml', type: :view do
let!(:procedure) { create(:procedure, administrateur: administrateur) }
describe 'navbar entries' do
context 'when disconnected' do
before do
render
@ -39,6 +38,5 @@ describe 'layouts/_navbar.html.haml', type: :view do
subject { rendered }
it { is_expected.to match(/Déconnexion/) }
end
end
end

View file

@ -1,7 +1,6 @@
require 'spec_helper'
describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml', type: :view do
let!(:dossier) { create(:dossier, :with_entreprise, state: state, archived: archived) }
let(:state) { 'draft' }
let(:archived) { false }
@ -25,7 +24,6 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
end
context 'button dossier state changements' do
shared_examples 'button Passer en instruction is present' do
it { expect(rendered).to have_link('Passer en instruction') }
end
@ -149,8 +147,6 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
it { expect(rendered).to have_content('Archivé') }
it { expect(rendered).to have_link('Désarchiver') }
end
end
end

View file

@ -82,5 +82,4 @@ describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.htm
end
end
end
end

View file

@ -124,6 +124,5 @@ describe 'users/description/show.html.haml', type: :view do
context 'when dossier not have cerfa, piece justificative and demarche link' do
it { expect(rendered).not_to have_content 'Documents administratifs' }
end
end
end

View file

@ -69,11 +69,9 @@ describe 'users/recapitulatif/show.html.haml', type: :view do
expect(rendered).to have_content('Modifier les documents')
expect(rendered).to have_css('#upload-pj-modal')
end
end
context 'when invite is logged' do
context 'when invite is by Gestionnaire' do
let!(:invite_user) { create(:user, email: 'invite@octo.com') }

View file

@ -9,7 +9,6 @@ RSpec.describe AutoArchiveProcedureWorker, type: :worker do
subject { AutoArchiveProcedureWorker.new.perform }
context "when procedures have no auto_archive_on" do
before do
subject
procedure.reload