Enable the Layout/EmptyLinesAroundBlockBody cop
This commit is contained in:
parent
aac75106ef
commit
f1907f4d0e
84 changed files with 1 additions and 133 deletions
|
@ -52,7 +52,7 @@ Layout/EmptyLinesAroundBeginBody:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Layout/EmptyLinesAroundBlockBody:
|
Layout/EmptyLinesAroundBlockBody:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Layout/EmptyLinesAroundClassBody:
|
Layout/EmptyLinesAroundClassBody:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
|
@ -12,7 +12,6 @@ class SIADE::RNAAdapter
|
||||||
|
|
||||||
data_source[:association].each do |k, v|
|
data_source[:association].each do |k, v|
|
||||||
params[k] = v if attr_to_fetch.include?(k)
|
params[k] = v if attr_to_fetch.include?(k)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
params[:association_id] = params[:id]
|
params[:association_id] = params[:id]
|
||||||
|
|
|
@ -55,7 +55,6 @@ class Gestionnaire < ActiveRecord::Base
|
||||||
|
|
||||||
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
|
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
|
||||||
table.second.each do |column|
|
table.second.each do |column|
|
||||||
|
|
||||||
if valid_couple_table_attr? table.first, column.first
|
if valid_couple_table_attr? table.first, column.first
|
||||||
PreferenceListDossier.create(
|
PreferenceListDossier.create(
|
||||||
libelle: column.second[:libelle],
|
libelle: column.second[:libelle],
|
||||||
|
|
|
@ -14,5 +14,4 @@ Apipie.configure do |config|
|
||||||
Description
|
Description
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
|
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
|
||||||
|
|
||||||
devise_for :administrations, skip: [:password, :registrations]
|
devise_for :administrations, skip: [:password, :registrations]
|
||||||
|
@ -144,7 +143,6 @@ Rails.application.routes.draw do
|
||||||
resource :accompagnateurs, only: [:show, :update]
|
resource :accompagnateurs, only: [:show, :update]
|
||||||
|
|
||||||
resource :previsualisation, only: [:show]
|
resource :previsualisation, only: [:show]
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
namespace :accompagnateurs do
|
namespace :accompagnateurs do
|
||||||
|
|
|
@ -13,7 +13,6 @@ class CreateEntreprise < ActiveRecord::Migration
|
||||||
t.integer :date_creation
|
t.integer :date_creation
|
||||||
t.string :nom
|
t.string :nom
|
||||||
t.string :prenom
|
t.string :prenom
|
||||||
|
|
||||||
end
|
end
|
||||||
add_reference :entreprises, :dossier, references: :dossiers
|
add_reference :entreprises, :dossier, references: :dossiers
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,6 @@ class BuildDefaultPreferenceListDossier < ActiveRecord::Migration
|
||||||
|
|
||||||
PreferenceListDossier.available_columns.each do |table|
|
PreferenceListDossier.available_columns.each do |table|
|
||||||
table.second.each do |column|
|
table.second.each do |column|
|
||||||
|
|
||||||
if valid_couple_table_attr? table.first, column.first
|
if valid_couple_table_attr? table.first, column.first
|
||||||
PreferenceListDossier.create(
|
PreferenceListDossier.create(
|
||||||
libelle: column.second[:libelle],
|
libelle: column.second[:libelle],
|
||||||
|
|
|
@ -99,7 +99,6 @@ class ResetAllPreferenceListDossier < ActiveRecord::Migration
|
||||||
|
|
||||||
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
|
PreferenceListDossier.available_columns_for(procedure_id).each do |table|
|
||||||
table.second.each do |column|
|
table.second.each do |column|
|
||||||
|
|
||||||
if valid_couple_table_attr? table.first, column.first
|
if valid_couple_table_attr? table.first, column.first
|
||||||
PreferenceListDossier.create(
|
PreferenceListDossier.create(
|
||||||
libelle: column.second[:libelle],
|
libelle: column.second[:libelle],
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
class CreateNotification < ActiveRecord::Migration[5.0]
|
class CreateNotification < ActiveRecord::Migration[5.0]
|
||||||
def change
|
def change
|
||||||
create_table :notifications do |t|
|
create_table :notifications do |t|
|
||||||
|
|
||||||
t.boolean :already_read, default: false
|
t.boolean :already_read, default: false
|
||||||
t.string :liste, array: true
|
t.string :liste, array: true
|
||||||
t.boolean :multiple, default: false
|
t.boolean :multiple, default: false
|
||||||
t.string :type_notif
|
t.string :type_notif
|
||||||
t.datetime :created_at
|
t.datetime :created_at
|
||||||
t.datetime :updated_at
|
t.datetime :updated_at
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
add_belongs_to :notifications, :dossier
|
add_belongs_to :notifications, :dossier
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20170523092900) do
|
ActiveRecord::Schema.define(version: 20170523092900) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
|
@ -475,5 +474,4 @@ ActiveRecord::Schema.define(version: 20170523092900) do
|
||||||
LEFT JOIN individuals ON ((individuals.dossier_id = dossiers.id)))
|
LEFT JOIN individuals ON ((individuals.dossier_id = dossiers.id)))
|
||||||
LEFT JOIN pieces_justificatives ON ((pieces_justificatives.dossier_id = dossiers.id)));
|
LEFT JOIN pieces_justificatives ON ((pieces_justificatives.dossier_id = dossiers.id)));
|
||||||
SQL
|
SQL
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
namespace :cloudstorage do
|
namespace :cloudstorage do
|
||||||
|
|
||||||
task init: :environment do
|
task init: :environment do
|
||||||
os_config = (YAML.load_file(Fog.credentials_path))['default']
|
os_config = (YAML.load_file(Fog.credentials_path))['default']
|
||||||
@os = OpenStack::Connection.create(
|
@os = OpenStack::Connection.create(
|
||||||
|
@ -109,5 +108,4 @@ namespace :cloudstorage do
|
||||||
@cont.delete_object(object) unless last_modified.utc > (Time.now - 2.year).utc
|
@cont.delete_object(object) unless last_modified.utc > (Time.now - 2.year).utc
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,5 +12,4 @@ describe Admin::PrevisualisationsController, type: :controller do
|
||||||
subject { get :show, params: {procedure_id: procedure.id} }
|
subject { get :show, params: {procedure_id: procedure.id} }
|
||||||
it { expect(subject.status).to eq(200) }
|
it { expect(subject.status).to eq(200) }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,7 +54,6 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'DELETE #destroy' do
|
describe 'DELETE #destroy' do
|
||||||
|
|
||||||
let(:procedure_draft) { create :procedure, published: false, archived: false }
|
let(:procedure_draft) { create :procedure, published: false, archived: false }
|
||||||
let(:procedure_published) { create :procedure, published: true, archived: false }
|
let(:procedure_published) { create :procedure, published: true, archived: false }
|
||||||
let(:procedure_archived) { create :procedure, published: false, archived: true }
|
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.direction).to eq(direction) }
|
||||||
it { expect(subject.lien_demarche).to eq(lien_demarche) }
|
it { expect(subject.lien_demarche).to eq(lien_demarche) }
|
||||||
it { expect(subject.administrateur_id).to eq(admin.id) }
|
it { expect(subject.administrateur_id).to eq(admin.id) }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'procedure module api carto attributs in database' do
|
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.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.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] }
|
it { expect(subject.use_api_carto).not_to eq procedure_params[:module_api_carto_attributes][:use_api_carto] }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -465,7 +462,6 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
it { expect(body.first['mine']).to be_truthy }
|
it { expect(body.first['mine']).to be_truthy }
|
||||||
it { expect(body.second['label']).to eq(procedure2.path) }
|
it { expect(body.second['label']).to eq(procedure2.path) }
|
||||||
it { expect(body.second['mine']).to be_falsy }
|
it { expect(body.second['mine']).to be_falsy }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'filtered' do
|
context 'filtered' do
|
||||||
|
@ -482,7 +478,6 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when procedure is archived' do
|
context 'when procedure is archived' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
procedure3.update_attribute :archived, true
|
procedure3.update_attribute :archived, true
|
||||||
subject
|
subject
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe AdministrationsController, type: :controller do
|
describe AdministrationsController, type: :controller do
|
||||||
|
|
||||||
let(:administration) { create :administration }
|
let(:administration) { create :administration }
|
||||||
|
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
|
|
||||||
subject { get :index }
|
subject { get :index }
|
||||||
|
|
||||||
context 'when administration user is not connect' do
|
context 'when administration user is not connect' do
|
||||||
|
@ -13,7 +11,6 @@ describe AdministrationsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when administration user is connect' do
|
context 'when administration user is connect' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in administration
|
sign_in administration
|
||||||
end
|
end
|
||||||
|
@ -23,7 +20,6 @@ describe AdministrationsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST #create' do
|
describe 'POST #create' do
|
||||||
|
|
||||||
let(:email) { 'plop@plop.com' }
|
let(:email) { 'plop@plop.com' }
|
||||||
let(:password) { 'password' }
|
let(:password) { 'password' }
|
||||||
|
|
||||||
|
@ -43,7 +39,6 @@ describe AdministrationsController, type: :controller do
|
||||||
expect(NewAdminMailer).to receive(:deliver_now!)
|
expect(NewAdminMailer).to receive(:deliver_now!)
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when email or password are missing' do
|
context 'when email or password are missing' do
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe API::StatistiquesController, type: :controller do
|
describe API::StatistiquesController, type: :controller do
|
||||||
describe '#GET dossiers_stats' do
|
describe '#GET dossiers_stats' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
get :dossiers_stats
|
get :dossiers_stats
|
||||||
end
|
end
|
||||||
|
|
|
@ -95,7 +95,6 @@ describe API::V1::DossiersController do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when procedure is found and belongs to current admin' do
|
context 'when procedure is found and belongs to current admin' do
|
||||||
|
|
||||||
context 'when dossier does not exist' do
|
context 'when dossier does not exist' do
|
||||||
let(:procedure_id) { procedure.id }
|
let(:procedure_id) { procedure.id }
|
||||||
let(:dossier_id) { 99999 }
|
let(:dossier_id) { 99999 }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Backoffice::AvisController, type: :controller do
|
describe Backoffice::AvisController, type: :controller do
|
||||||
|
|
||||||
describe '#POST create' do
|
describe '#POST create' do
|
||||||
let(:gestionnaire){ create(:gestionnaire) }
|
let(:gestionnaire){ create(:gestionnaire) }
|
||||||
let!(:dossier){ create(:dossier, state: 'received') }
|
let!(:dossier){ create(:dossier, state: 'received') }
|
||||||
|
|
|
@ -346,7 +346,6 @@ describe Backoffice::DossiersController, type: :controller do
|
||||||
it 'change state for updated' do
|
it 'change state for updated' do
|
||||||
expect(dossier.state).to eq 'updated'
|
expect(dossier.state).to eq 'updated'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'flash alert' do
|
describe 'flash alert' do
|
||||||
|
|
|
@ -16,7 +16,6 @@ describe Ban::SearchController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when request return nothing', vcr: {cassette_name: 'bano_search_nothing'} do
|
context 'when request return nothing', vcr: {cassette_name: 'bano_search_nothing'} do
|
||||||
|
|
||||||
let (:request) { 'je recherche pas grand chose' }
|
let (:request) { 'je recherche pas grand chose' }
|
||||||
|
|
||||||
it { expect(response.status).to eq 200 }
|
it { expect(response.status).to eq 200 }
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe CguController, type: :controller do
|
describe CguController, type: :controller do
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
|
|
||||||
subject { get :index }
|
subject { get :index }
|
||||||
|
|
||||||
it { expect(subject.status).to eq 200 }
|
it { expect(subject.status).to eq 200 }
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe DemoController, type: :controller do
|
describe DemoController, type: :controller do
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
|
|
||||||
subject { get :index }
|
subject { get :index }
|
||||||
|
|
||||||
it { expect(subject.status).to eq 200 }
|
it { expect(subject.status).to eq 200 }
|
||||||
|
|
|
@ -41,7 +41,6 @@ describe InvitesController, type: :controller do
|
||||||
|
|
||||||
it { expect(invite.user).to eq user }
|
it { expect(invite.user).to eq user }
|
||||||
it { expect(flash[:notice]).to be_present }
|
it { expect(flash[:notice]).to be_present }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when email is not assign to an user' do
|
context 'when email is not assign to an user' do
|
||||||
|
|
|
@ -2,13 +2,11 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe PingController, type: :controller do
|
describe PingController, type: :controller do
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
|
|
||||||
subject { get :index }
|
subject { get :index }
|
||||||
|
|
||||||
it { expect(subject.status).to eq 200 }
|
it { expect(subject.status).to eq 200 }
|
||||||
|
|
||||||
context 'when base is un-plug' do
|
context 'when base is un-plug' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(ActiveRecord::Base).to receive(:connected?).and_return(false)
|
allow(ActiveRecord::Base).to receive(:connected?).and_return(false)
|
||||||
end
|
end
|
||||||
|
|
|
@ -64,7 +64,6 @@ describe RootController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(response.body).to have_css('.landing') }
|
it { expect(response.body).to have_css('.landing') }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "unified login" do
|
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}']")
|
expect(response.body).to have_css("a[href='#{new_user_session_path}']")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -179,7 +179,6 @@ shared_examples 'carte_controller_spec' do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#get_position' do
|
describe '#get_position' do
|
||||||
|
|
||||||
context 'when etablissement is nil' do
|
context 'when etablissement is nil' do
|
||||||
before do
|
before do
|
||||||
dossier.update etablissement: nil
|
dossier.update etablissement: nil
|
||||||
|
|
|
@ -87,7 +87,6 @@ shared_examples 'description_controller_spec' do
|
||||||
|
|
||||||
context 'when dossier does not have an enterprise datas' do
|
context 'when dossier does not have an enterprise datas' do
|
||||||
before do
|
before do
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(dossier.entreprise).to be_nil }
|
it { expect(dossier.entreprise).to be_nil }
|
||||||
|
|
|
@ -2,7 +2,6 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe Users::Dossiers::AddSiretController, type: :controller do
|
describe Users::Dossiers::AddSiretController, type: :controller do
|
||||||
describe '#GET show' do
|
describe '#GET show' do
|
||||||
|
|
||||||
let(:dossier) { create :dossier }
|
let(:dossier) { create :dossier }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -5,7 +5,6 @@ describe Users::Dossiers::CommentairesController, type: :controller do
|
||||||
let(:texte_commentaire) { 'Commentaire de test' }
|
let(:texte_commentaire) { 'Commentaire de test' }
|
||||||
|
|
||||||
describe '#POST create' do
|
describe '#POST create' do
|
||||||
|
|
||||||
subject {
|
subject {
|
||||||
post :create, params:{dossier_id: dossier.id, texte_commentaire: texte_commentaire}
|
post :create, params:{dossier_id: dossier.id, texte_commentaire: texte_commentaire}
|
||||||
dossier.reload
|
dossier.reload
|
||||||
|
@ -42,7 +41,6 @@ describe Users::Dossiers::CommentairesController, type: :controller do
|
||||||
expect(NotificationMailer).to_not receive(:new_answer)
|
expect(NotificationMailer).to_not receive(:new_answer)
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,7 +66,6 @@ describe Users::DossiersController, type: :controller do
|
||||||
it { expect { subject }.to change(Dossier, :count).by 1 }
|
it { expect { subject }.to change(Dossier, :count).by 1 }
|
||||||
|
|
||||||
describe 'save user siret' do
|
describe 'save user siret' do
|
||||||
|
|
||||||
context 'when user have not a saved siret' do
|
context 'when user have not a saved siret' do
|
||||||
context 'when siret is present on request' do
|
context 'when siret is present on request' do
|
||||||
subject { get :new, params: {procedure_id: procedure_id, siret: siret} }
|
subject { get :new, params: {procedure_id: procedure_id, siret: siret} }
|
||||||
|
@ -349,7 +348,6 @@ describe Users::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(response.status).to eq 200 }
|
it { expect(response.status).to eq 200 }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -456,7 +454,6 @@ describe Users::DossiersController, type: :controller do
|
||||||
|
|
||||||
it { expect { subject }.to change { Dossier.count }.by(0) }
|
it { expect { subject }.to change { Dossier.count }.by(0) }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'PUT #change_siret' do
|
describe 'PUT #change_siret' do
|
||||||
|
|
|
@ -33,7 +33,6 @@ describe Users::RecapitulatifController, type: :controller do
|
||||||
it { is_expected.to redirect_to root_path }
|
it { is_expected.to redirect_to root_path }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST #initiate' do
|
describe 'POST #initiate' do
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Users::RegistrationsController, type: :controller do
|
describe Users::RegistrationsController, type: :controller do
|
||||||
|
|
||||||
let(:email) { 'test@octo.com' }
|
let(:email) { 'test@octo.com' }
|
||||||
let(:password) { 'password' }
|
let(:password) { 'password' }
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,6 @@ describe Users::SessionsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'signs user + gestionnaire + administrateur in' do
|
it 'signs user + gestionnaire + administrateur in' do
|
||||||
|
|
||||||
post :create, params: {user: {email: administrateur.email, password: administrateur.password}}
|
post :create, params: {user: {email: administrateur.email, password: administrateur.password}}
|
||||||
expect(@response.redirect?).to be(true)
|
expect(@response.redirect?).to be(true)
|
||||||
expect(subject.current_user).to eq(user)
|
expect(subject.current_user).to eq(user)
|
||||||
|
@ -200,7 +199,6 @@ describe Users::SessionsController, type: :controller do
|
||||||
expect(subject.current_administrateur).to be(nil)
|
expect(subject.current_administrateur).to be(nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -25,5 +25,4 @@ describe ProcedureDecorator do
|
||||||
it { expect(subject.quartiers_prioritaires).to be_falsey }
|
it { expect(subject.quartiers_prioritaires).to be_falsey }
|
||||||
it { expect(subject.cadastre).to be_falsey }
|
it { expect(subject.cadastre).to be_falsey }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe ProceduresDecorator do
|
describe ProceduresDecorator do
|
||||||
|
|
||||||
before 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))
|
||||||
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
|
create(:procedure, :published, created_at: Time.new(2015, 12, 24, 14, 10))
|
||||||
|
|
|
@ -9,7 +9,6 @@ describe TypeDeChampDecorator do
|
||||||
let!(:type_de_champ_2) { create(:type_de_champ_public, procedure: procedure, order_place: 2) }
|
let!(:type_de_champ_2) { create(:type_de_champ_public, procedure: procedure, order_place: 2) }
|
||||||
|
|
||||||
describe '#button_up' do
|
describe '#button_up' do
|
||||||
|
|
||||||
describe 'with first piece justificative' do
|
describe 'with first piece justificative' do
|
||||||
let(:index) { 0 }
|
let(:index) { 0 }
|
||||||
subject { type_de_champ_0.decorate }
|
subject { type_de_champ_0.decorate }
|
||||||
|
@ -50,5 +49,4 @@ describe TypeDeChampDecorator do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,6 @@ describe TypeDePieceJustificativeDecorator do
|
||||||
let!(:type_de_piece_justificative_2) { create(:type_de_piece_justificative, procedure: procedure, order_place: 2) }
|
let!(:type_de_piece_justificative_2) { create(:type_de_piece_justificative, procedure: procedure, order_place: 2) }
|
||||||
|
|
||||||
describe '#button_up' do
|
describe '#button_up' do
|
||||||
|
|
||||||
describe 'with first piece justificative' do
|
describe 'with first piece justificative' do
|
||||||
let(:index) { 0 }
|
let(:index) { 0 }
|
||||||
subject { type_de_piece_justificative_0.decorate }
|
subject { type_de_piece_justificative_0.decorate }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe DossiersListFacades do
|
describe DossiersListFacades do
|
||||||
|
|
||||||
let(:gestionnaire) { create :gestionnaire }
|
let(:gestionnaire) { create :gestionnaire }
|
||||||
let(:procedure) { create :procedure, libelle: 'Ma procédure' }
|
let(:procedure) { create :procedure, libelle: 'Ma procédure' }
|
||||||
let(:procedure_2) { create :procedure, libelle: 'Ma seconde procédure' }
|
let(:procedure_2) { create :procedure, libelle: 'Ma seconde procédure' }
|
||||||
|
@ -27,7 +26,6 @@ describe DossiersListFacades do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#preference_list_dossiers_filter' do
|
describe '#preference_list_dossiers_filter' do
|
||||||
|
|
||||||
subject { facade.preference_list_dossiers_filter }
|
subject { facade.preference_list_dossiers_filter }
|
||||||
|
|
||||||
context 'when procedure is not pasted at the facade' do
|
context 'when procedure is not pasted at the facade' do
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :champ do
|
factory :champ do
|
||||||
|
|
||||||
type_de_champ { FactoryGirl.create(:type_de_champ_public) }
|
type_de_champ { FactoryGirl.create(:type_de_champ_public) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -42,7 +42,6 @@ FactoryGirl.define do
|
||||||
|
|
||||||
trait :with_cerfa_upload do
|
trait :with_cerfa_upload do
|
||||||
after(:build) do |dossier, _evaluator|
|
after(:build) do |dossier, _evaluator|
|
||||||
|
|
||||||
dossier.cerfa << create(:cerfa)
|
dossier.cerfa << create(:cerfa)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :type_de_piece_justificative do
|
factory :type_de_piece_justificative do
|
||||||
|
|
||||||
libelle 'RIB'
|
libelle 'RIB'
|
||||||
description 'Releve identité bancaire'
|
description 'Releve identité bancaire'
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'add a new type de champs', js: true do
|
feature 'add a new type de champs', js: true do
|
||||||
|
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,5 @@ feature 'Administrator connection' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'As an administrateur I wanna clone a procedure', js: true do
|
feature 'As an administrateur I wanna clone a procedure', js: true do
|
||||||
|
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -10,7 +9,6 @@ feature 'As an administrateur I wanna clone a procedure', js: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'Cloning procedure' do
|
context 'Cloning procedure' do
|
||||||
|
|
||||||
before 'Create procedure' do
|
before 'Create procedure' do
|
||||||
page.find_by_id('new-procedure').click
|
page.find_by_id('new-procedure').click
|
||||||
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
fill_in 'procedure_libelle', with: 'libelle de la procedure'
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'As an administrateur I wanna create a new procedure', js: true do
|
feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
|
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -10,7 +9,6 @@ feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'Right after sign_in I shall see all procedure states links' do
|
context 'Right after sign_in I shall see all procedure states links' do
|
||||||
|
|
||||||
scenario 'Finding draft procedures' do
|
scenario 'Finding draft procedures' do
|
||||||
page.find_by_id('draft-procedures').trigger('click')
|
page.find_by_id('draft-procedures').trigger('click')
|
||||||
expect(page).to have_current_path(admin_procedures_draft_path, only_path: true)
|
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
|
end
|
||||||
|
|
||||||
context 'Creating a new procedure' do
|
context 'Creating a new procedure' do
|
||||||
|
|
||||||
scenario 'Finding new procedure link' do
|
scenario 'Finding new procedure link' do
|
||||||
page.find_by_id('new-procedure').click
|
page.find_by_id('new-procedure').click
|
||||||
expect(page).to have_current_path(new_admin_procedure_path, only_path: true)
|
expect(page).to have_current_path(new_admin_procedure_path, only_path: true)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'procedure locked' do
|
feature 'procedure locked' do
|
||||||
|
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
let(:published) { false }
|
let(:published) { false }
|
||||||
let(:procedure) { create(:procedure, administrateur: administrateur, published: published) }
|
let(:procedure) { create(:procedure, administrateur: administrateur, published: published) }
|
||||||
|
|
|
@ -20,7 +20,6 @@ feature 'As an Accompagnateur I can navigate and use each functionnality around
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'On index' do
|
context 'On index' do
|
||||||
|
|
||||||
scenario 'Switching between procedures' do
|
scenario 'Switching between procedures' do
|
||||||
page.all('#procedure-list a').first.click
|
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)
|
expect(page).to have_current_path(backoffice_dossiers_procedure_path(id: procedure_1.id.to_s), only_path: true)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'usage of pref list dossier lateral panel', js: true do
|
feature 'usage of pref list dossier lateral panel', js: true do
|
||||||
|
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
|
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
|
||||||
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'usage of pref list dossier lateral panel by procedure', js: true do
|
feature 'usage of pref list dossier lateral panel by procedure', js: true do
|
||||||
|
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
|
let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) }
|
||||||
let(:procedure) { create(:procedure, :with_type_de_champ, administrateur: administrateur) }
|
let(:procedure) { create(:procedure, :with_type_de_champ, administrateur: administrateur) }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'France Connect Particulier Connexion' do
|
feature 'France Connect Particulier Connexion' do
|
||||||
|
|
||||||
let(:code) { 'plop' }
|
let(:code) { 'plop' }
|
||||||
let(:given_name) { 'titi' }
|
let(:given_name) { 'titi' }
|
||||||
let(:family_name) { 'toto' }
|
let(:family_name) { 'toto' }
|
||||||
|
@ -21,7 +20,6 @@ feature 'France Connect Particulier Connexion' do
|
||||||
}
|
}
|
||||||
|
|
||||||
context 'when user is on login page' do
|
context 'when user is on login page' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
visit new_user_session_path
|
visit new_user_session_path
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'As a User I want to edit a dossier I own' do
|
feature 'As a User I want to edit a dossier I own' do
|
||||||
|
|
||||||
let(:user) { create(:user) }
|
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(: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') }
|
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
|
end
|
||||||
|
|
||||||
context 'After sign_in, I can navigate through dossiers indexes and edit a dossier' do
|
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
|
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')
|
expect(page.find('#a_traiter')['class'] ).to eq('active procedure-list-element')
|
||||||
page.find_by_id('brouillon').click
|
page.find_by_id('brouillon').click
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
feature 'As a User I want to sort and paginate dossiers', js: true do
|
feature 'As a User I want to sort and paginate dossiers', js: true do
|
||||||
|
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:procedure_for_individual) { create(:procedure, :published, :for_individual) }
|
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
|
end
|
||||||
|
|
||||||
context 'After sign_in, I can see my 51 dossiers on the index' do
|
context 'After sign_in, I can see my 51 dossiers on the index' do
|
||||||
|
|
||||||
scenario 'Using sort' do
|
scenario 'Using sort' do
|
||||||
visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
|
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)
|
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)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id).to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Carto::GeoAPI::Driver do
|
describe Carto::GeoAPI::Driver do
|
||||||
|
|
||||||
describe '.regions', vcr: {cassette_name: 'geoapi_regions'} do
|
describe '.regions', vcr: {cassette_name: 'geoapi_regions'} do
|
||||||
subject { described_class.regions }
|
subject { described_class.regions }
|
||||||
|
|
||||||
|
@ -18,7 +17,6 @@ describe Carto::GeoAPI::Driver do
|
||||||
subject { described_class.pays }
|
subject { described_class.pays }
|
||||||
|
|
||||||
it { is_expected.to eq File.open('app/lib/carto/geo_api/pays.json').read }
|
it { is_expected.to eq File.open('app/lib/carto/geo_api/pays.json').read }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'departements_url' do
|
describe 'departements_url' do
|
||||||
|
|
|
@ -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.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("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) }
|
it { expect(subject.body).to include(avis.introduction) }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -262,7 +262,6 @@ describe Dossier do
|
||||||
|
|
||||||
it { is_expected.to eq 'replied' }
|
it { is_expected.to eq 'replied' }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -295,7 +294,6 @@ describe Dossier do
|
||||||
|
|
||||||
it { is_expected.to eq('replied') }
|
it { is_expected.to eq('replied') }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
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.second.type_de_champ.libelle).to eq 'type_2_2' }
|
||||||
it { expect(subject.last.type_de_champ.libelle).to eq 'type_2_3' }
|
it { expect(subject.last.type_de_champ.libelle).to eq 'type_2_3' }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#ordered_champs_private' do
|
describe '#ordered_champs_private' do
|
||||||
|
@ -850,7 +847,6 @@ describe Dossier do
|
||||||
|
|
||||||
it_behaves_like 'dossier is processed', 'without_continuation'
|
it_behaves_like 'dossier is processed', 'without_continuation'
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.downloadable' do
|
describe '.downloadable' do
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe DropDownList do
|
describe DropDownList do
|
||||||
|
|
||||||
describe 'database columns' do
|
describe 'database columns' do
|
||||||
it { is_expected.to have_db_column(:value) }
|
it { is_expected.to have_db_column(:value) }
|
||||||
end
|
end
|
||||||
|
@ -24,7 +23,6 @@ Pilotage / Ingénierie
|
||||||
|
|
||||||
context 'when one value is empty' do
|
context 'when one value is empty' do
|
||||||
let(:value) { "Cohésion sociale
|
let(:value) { "Cohésion sociale
|
||||||
|
|
||||||
Cadre de vie / Urb.
|
Cadre de vie / Urb.
|
||||||
Pilotage / Ingénierie
|
Pilotage / Ingénierie
|
||||||
"
|
"
|
||||||
|
|
|
@ -23,7 +23,6 @@ describe Etablissement do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#geo_adresse' do
|
describe '#geo_adresse' do
|
||||||
|
|
||||||
let(:etablissement) { create(:etablissement) }
|
let(:etablissement) { create(:etablissement) }
|
||||||
|
|
||||||
subject { etablissement.geo_adresse }
|
subject { etablissement.geo_adresse }
|
||||||
|
|
|
@ -103,7 +103,6 @@ describe Gestionnaire, type: :model do
|
||||||
subject { gestionnaire.follow? dossier.id }
|
subject { gestionnaire.follow? dossier.id }
|
||||||
|
|
||||||
context 'when gestionnaire follow a dossier' do
|
context 'when gestionnaire follow a dossier' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
create :follow, dossier_id: dossier.id, gestionnaire_id: gestionnaire.id
|
create :follow, dossier_id: dossier.id, gestionnaire_id: gestionnaire.id
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,7 +32,6 @@ describe Invite do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect{ subject }.to raise_error ActiveRecord::RecordInvalid }
|
it { expect{ subject }.to raise_error ActiveRecord::RecordInvalid }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,7 +13,6 @@ describe PieceJustificative do
|
||||||
it { is_expected.to belong_to(:type_de_piece_justificative) }
|
it { is_expected.to belong_to(:type_de_piece_justificative) }
|
||||||
it { is_expected.to belong_to(:user) }
|
it { is_expected.to belong_to(:user) }
|
||||||
it { is_expected.to have_one(:commentaire) }
|
it { is_expected.to have_one(:commentaire) }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'validations' do
|
describe 'validations' do
|
||||||
|
|
|
@ -190,7 +190,6 @@ describe PreferenceListDossier do
|
||||||
it { expect(subject[:order]).to be_nil }
|
it { expect(subject[:order]).to be_nil }
|
||||||
it { expect(subject[:filter]).to be_nil }
|
it { expect(subject[:filter]).to be_nil }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'etablissement' do
|
describe 'etablissement' do
|
||||||
|
|
|
@ -46,5 +46,4 @@ describe ProcedurePath do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -175,7 +175,6 @@ describe Procedure do
|
||||||
subject.types_de_piece_justificative.zip(procedure.types_de_piece_justificative).each do |stc, ptc|
|
subject.types_de_piece_justificative.zip(procedure.types_de_piece_justificative).each do |stc, ptc|
|
||||||
expect(stc).to have_same_attributes_as(ptc)
|
expect(stc).to have_same_attributes_as(ptc)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should duplicate existing mail_templates' do
|
it 'should duplicate existing mail_templates' do
|
||||||
|
@ -244,7 +243,6 @@ describe Procedure do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'total_dossier' do
|
describe 'total_dossier' do
|
||||||
|
|
||||||
let(:procedure) { create :procedure }
|
let(:procedure) { create :procedure }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -9,7 +9,6 @@ describe QuartierPrioritaire do
|
||||||
it { is_expected.to belong_to(:dossier) }
|
it { is_expected.to belong_to(:dossier) }
|
||||||
|
|
||||||
describe 'geometry' do
|
describe 'geometry' do
|
||||||
|
|
||||||
let(:qp) { create :quartier_prioritaire, geometry: qp_geometry }
|
let(:qp) { create :quartier_prioritaire, geometry: qp_geometry }
|
||||||
let(:qp_geometry) { File.open('spec/support/files/qp_geometry_value.txt').read }
|
let(:qp_geometry) { File.open('spec/support/files/qp_geometry_value.txt').read }
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Siret, type: :model do
|
describe Siret, type: :model do
|
||||||
|
|
||||||
let(:valid_siret) { '41816609600051' }
|
let(:valid_siret) { '41816609600051' }
|
||||||
let(:invalid_siret) { '111111111' }
|
let(:invalid_siret) { '111111111' }
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ shared_examples 'type_de_champ_spec' do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'field_for_list?' do
|
describe 'field_for_list?' do
|
||||||
|
|
||||||
let(:type_de_champ_yes) { create :type_de_champ_public, type_champ: 'text' }
|
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_1) { create :type_de_champ_public, type_champ: 'textarea' }
|
||||||
let(:type_de_champ_no_2) { create :type_de_champ_public, type_champ: 'header_section' }
|
let(:type_de_champ_no_2) { create :type_de_champ_public, type_champ: 'header_section' }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe TypeDeChamp do
|
describe TypeDeChamp do
|
||||||
|
|
||||||
require 'models/type_de_champ_shared_example'
|
require 'models/type_de_champ_shared_example'
|
||||||
|
|
||||||
it_should_behave_like "type_de_champ_spec"
|
it_should_behave_like "type_de_champ_spec"
|
||||||
|
|
|
@ -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(:updated_at) }
|
||||||
it { is_expected.to have_db_column(:siret) }
|
it { is_expected.to have_db_column(:siret) }
|
||||||
it { is_expected.to have_db_column(:loged_in_with_france_connect) }
|
it { is_expected.to have_db_column(:loged_in_with_france_connect) }
|
||||||
|
|
||||||
end
|
end
|
||||||
describe 'associations' do
|
describe 'associations' do
|
||||||
it { is_expected.to have_many(:dossiers) }
|
it { is_expected.to have_many(:dossiers) }
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe DossierTableExportSerializer do
|
describe DossierTableExportSerializer do
|
||||||
|
|
||||||
describe '#emails_accompagnateurs' do
|
describe '#emails_accompagnateurs' do
|
||||||
|
|
||||||
let(:gestionnaire){ create(:gestionnaire) }
|
let(:gestionnaire){ create(:gestionnaire) }
|
||||||
let(:follow) { create(:follow, gestionnaire: gestionnaire) }
|
let(:follow) { create(:follow, gestionnaire: gestionnaire) }
|
||||||
|
|
||||||
|
@ -28,7 +26,5 @@ describe DossierTableExportSerializer do
|
||||||
|
|
||||||
it { is_expected.to eq "#{gestionnaire.email} #{gestionnaire2.email}" }
|
it { is_expected.to eq "#{gestionnaire.email} #{gestionnaire2.email}" }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe AccompagnateurService do
|
describe AccompagnateurService do
|
||||||
|
|
||||||
let(:procedure) { create :procedure }
|
let(:procedure) { create :procedure }
|
||||||
let(:accompagnateur) { create :gestionnaire }
|
let(:accompagnateur) { create :gestionnaire }
|
||||||
|
|
||||||
let(:accompagnateur_service) { AccompagnateurService.new accompagnateur, procedure, to}
|
let(:accompagnateur_service) { AccompagnateurService.new accompagnateur, procedure, to}
|
||||||
|
|
||||||
describe '#change_assignement!' do
|
describe '#change_assignement!' do
|
||||||
|
|
||||||
subject { accompagnateur_service.change_assignement! }
|
subject { accompagnateur_service.change_assignement! }
|
||||||
|
|
||||||
context 'when accompagnateur is not assign at the procedure' do
|
context 'when accompagnateur is not assign at the procedure' do
|
||||||
|
@ -34,7 +32,6 @@ describe AccompagnateurService do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#build_default_column' do
|
describe '#build_default_column' do
|
||||||
|
|
||||||
subject { accompagnateur_service.build_default_column }
|
subject { accompagnateur_service.build_default_column }
|
||||||
|
|
||||||
context 'when to is not assign' do
|
context 'when to is not assign' do
|
||||||
|
|
|
@ -24,7 +24,6 @@ describe DossiersListGestionnaireService do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when gestionnaire have default sort' do
|
context 'when gestionnaire have default sort' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
preference_attr.update_column(:order, 'asc')
|
preference_attr.update_column(:order, 'asc')
|
||||||
end
|
end
|
||||||
|
@ -74,7 +73,6 @@ describe DossiersListGestionnaireService do
|
||||||
|
|
||||||
it { expect(select_preference_list_dossier.order).to eq 'desc' }
|
it { expect(select_preference_list_dossier.order).to eq 'desc' }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when procedure as already a preference order' do
|
context 'when procedure as already a preference order' do
|
||||||
|
@ -128,7 +126,6 @@ describe DossiersListGestionnaireService do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#join_filter' do
|
describe '#join_filter' do
|
||||||
|
|
||||||
subject { DossiersListGestionnaireService.new(gestionnaire, liste, nil).joins_filter }
|
subject { DossiersListGestionnaireService.new(gestionnaire, liste, nil).joins_filter }
|
||||||
|
|
||||||
it { is_expected.to eq []}
|
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%'" }
|
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
|
context 'when last filter caractere is *' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
gestionnaire.preference_list_dossiers
|
gestionnaire.preference_list_dossiers
|
||||||
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
|
.find_by(table: 'entreprise', attr: 'raison_sociale', procedure: nil)
|
||||||
|
@ -242,7 +238,6 @@ describe DossiersListGestionnaireService do
|
||||||
end
|
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%'" }
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe NotificationService do
|
describe NotificationService do
|
||||||
|
|
||||||
describe '.notify' do
|
describe '.notify' do
|
||||||
let(:dossier) { create :dossier }
|
let(:dossier) { create :dossier }
|
||||||
let(:service) { described_class.new type_notif, dossier.id }
|
let(:service) { described_class.new type_notif, dossier.id }
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe PrevisualisationService do
|
describe PrevisualisationService do
|
||||||
|
|
||||||
describe '.destroy_all_champs' do
|
describe '.destroy_all_champs' do
|
||||||
subject { described_class.destroy_all_champs dossier }
|
subject { described_class.destroy_all_champs dossier }
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ describe UserRoutesAuthorizationService do
|
||||||
let(:controller) { Users::CarteController }
|
let(:controller) { Users::CarteController }
|
||||||
|
|
||||||
context 'when use_api_carto is false' do
|
context 'when use_api_carto is false' do
|
||||||
|
|
||||||
describe 'draft' do
|
describe 'draft' do
|
||||||
let(:state) { 'draft' }
|
let(:state) { 'draft' }
|
||||||
it { is_expected.to be_falsey }
|
it { is_expected.to be_falsey }
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
|
|
||||||
expect_list = %w()
|
expect_list = %w()
|
||||||
|
|
||||||
config.before(:suite) do
|
config.before(:suite) do
|
||||||
|
|
|
@ -4,7 +4,6 @@ describe BaseUploader do
|
||||||
let(:uploader) { described_class.new }
|
let(:uploader) { described_class.new }
|
||||||
|
|
||||||
describe '#cache_dir' do
|
describe '#cache_dir' do
|
||||||
|
|
||||||
subject { uploader.cache_dir }
|
subject { uploader.cache_dir }
|
||||||
|
|
||||||
context 'when rails env is not production' do
|
context 'when rails env is not production' do
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe RemoteDownloader do
|
describe RemoteDownloader do
|
||||||
|
|
||||||
let(:filename) { 'file_name.pdf' }
|
let(:filename) { 'file_name.pdf' }
|
||||||
|
|
||||||
subject { described_class.new filename }
|
subject { described_class.new filename }
|
||||||
|
|
|
@ -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
|
context 'when dossier not have cerfa, piece justificative and demarche link' do
|
||||||
it { expect(rendered).not_to have_content 'Documents administratifs' }
|
it { expect(rendered).not_to have_content 'Documents administratifs' }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,6 @@ describe 'admin/procedures/show.html.haml', type: :view do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when procedure have a gestionnare affected' do
|
context 'when procedure have a gestionnare affected' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
create :assign_to, gestionnaire: create(:gestionnaire), procedure: procedure
|
create :assign_to, gestionnaire: create(:gestionnaire), procedure: procedure
|
||||||
render
|
render
|
||||||
|
@ -76,7 +75,5 @@ describe 'admin/procedures/show.html.haml', type: :view do
|
||||||
describe 'procedure link is present' do
|
describe 'procedure link is present' do
|
||||||
it { expect(rendered).to have_content(commencer_url(procedure_path: procedure.path)) }
|
it { expect(rendered).to have_content(commencer_url(procedure_path: procedure.path)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,6 @@ describe 'layouts/_navbar.html.haml', type: :view do
|
||||||
let!(:procedure) { create(:procedure, administrateur: administrateur) }
|
let!(:procedure) { create(:procedure, administrateur: administrateur) }
|
||||||
|
|
||||||
describe 'navbar entries' do
|
describe 'navbar entries' do
|
||||||
|
|
||||||
context 'when disconnected' do
|
context 'when disconnected' do
|
||||||
before do
|
before do
|
||||||
render
|
render
|
||||||
|
@ -39,6 +38,5 @@ describe 'layouts/_navbar.html.haml', type: :view do
|
||||||
subject { rendered }
|
subject { rendered }
|
||||||
it { is_expected.to match(/Déconnexion/) }
|
it { is_expected.to match(/Déconnexion/) }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.html.haml', type: :view do
|
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!(:dossier) { create(:dossier, :with_entreprise, state: state, archived: archived) }
|
||||||
let(:state) { 'draft' }
|
let(:state) { 'draft' }
|
||||||
let(:archived) { false }
|
let(:archived) { false }
|
||||||
|
@ -25,7 +24,6 @@ describe 'layouts/left_panels/_left_panel_backoffice_dossierscontroller_show.htm
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'button dossier state changements' do
|
context 'button dossier state changements' do
|
||||||
|
|
||||||
shared_examples 'button Passer en instruction is present' do
|
shared_examples 'button Passer en instruction is present' do
|
||||||
it { expect(rendered).to have_link('Passer en instruction') }
|
it { expect(rendered).to have_link('Passer en instruction') }
|
||||||
end
|
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_content('Archivé') }
|
||||||
it { expect(rendered).to have_link('Désarchiver') }
|
it { expect(rendered).to have_link('Désarchiver') }
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -82,5 +82,4 @@ describe 'layouts/left_panels/_left_panel_users_recapitulatifcontroller_show.htm
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
context 'when dossier not have cerfa, piece justificative and demarche link' do
|
||||||
it { expect(rendered).not_to have_content 'Documents administratifs' }
|
it { expect(rendered).not_to have_content 'Documents administratifs' }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -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_content('Modifier les documents')
|
||||||
expect(rendered).to have_css('#upload-pj-modal')
|
expect(rendered).to have_css('#upload-pj-modal')
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when invite is logged' do
|
context 'when invite is logged' do
|
||||||
|
|
||||||
context 'when invite is by Gestionnaire' do
|
context 'when invite is by Gestionnaire' do
|
||||||
let!(:invite_user) { create(:user, email: 'invite@octo.com') }
|
let!(:invite_user) { create(:user, email: 'invite@octo.com') }
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@ RSpec.describe AutoArchiveProcedureWorker, type: :worker do
|
||||||
subject { AutoArchiveProcedureWorker.new.perform }
|
subject { AutoArchiveProcedureWorker.new.perform }
|
||||||
|
|
||||||
context "when procedures have no auto_archive_on" do
|
context "when procedures have no auto_archive_on" do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
subject
|
subject
|
||||||
procedure.reload
|
procedure.reload
|
||||||
|
|
Loading…
Reference in a new issue