Merge branch 'dev'
This commit is contained in:
commit
12dcbf85a7
26 changed files with 74 additions and 49 deletions
|
@ -110,7 +110,7 @@ Layout/IndentationConsistency:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Layout/IndentationWidth:
|
Layout/IndentationWidth:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Layout/InitialIndentation:
|
Layout/InitialIndentation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
@ -170,7 +170,7 @@ Layout/SpaceAroundKeyword:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
Layout/SpaceAroundOperators:
|
Layout/SpaceAroundOperators:
|
||||||
Enabled: false
|
Enabled: true
|
||||||
|
|
||||||
Layout/SpaceBeforeBlockBraces:
|
Layout/SpaceBeforeBlockBraces:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
|
@ -72,9 +72,9 @@ class Admin::AttestationTemplatesController < AdminController
|
||||||
|
|
||||||
def uninterlaced_png(uploaded_file)
|
def uninterlaced_png(uploaded_file)
|
||||||
if uploaded_file.present? && uploaded_file.content_type == 'image/png'
|
if uploaded_file.present? && uploaded_file.content_type == 'image/png'
|
||||||
chunky_img = ChunkyPNG::Image.from_io(uploaded_file)
|
chunky_img = ChunkyPNG::Image.from_io(uploaded_file)
|
||||||
chunky_img.save(uploaded_file.tempfile.to_path, interlace: false)
|
chunky_img.save(uploaded_file.tempfile.to_path, interlace: false)
|
||||||
uploaded_file.tempfile.reopen(uploaded_file.tempfile.to_path, 'rb')
|
uploaded_file.tempfile.reopen(uploaded_file.tempfile.to_path, 'rb')
|
||||||
end
|
end
|
||||||
|
|
||||||
uploaded_file
|
uploaded_file
|
||||||
|
|
|
@ -12,7 +12,8 @@ class Admin::GestionnairesController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@gestionnaire = Gestionnaire.find_by_email(params[:gestionnaire][:email])
|
email = params[:gestionnaire][:email].downcase
|
||||||
|
@gestionnaire = Gestionnaire.find_by_email(email)
|
||||||
procedure_id = params[:procedure_id]
|
procedure_id = params[:procedure_id]
|
||||||
|
|
||||||
if @gestionnaire.nil?
|
if @gestionnaire.nil?
|
||||||
|
|
|
@ -5,7 +5,7 @@ class Admin::PrevisualisationsController < AdminController
|
||||||
@procedure
|
@procedure
|
||||||
@dossier = Dossier.new(id: 0, procedure: @procedure)
|
@dossier = Dossier.new(id: 0, procedure: @procedure)
|
||||||
|
|
||||||
PrevisualisationService.destroy_all_champs @dossier
|
PrevisualisationService.delete_all_champs @dossier
|
||||||
@dossier.build_default_champs
|
@dossier.build_default_champs
|
||||||
|
|
||||||
@champs = @dossier.ordered_champs
|
@champs = @dossier.ordered_champs
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module CredentialsSyncableConcern
|
module CredentialsSyncableConcern
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
after_update :sync_credentials
|
after_update :sync_credentials
|
||||||
|
|
|
@ -92,6 +92,10 @@ class Dossier < ActiveRecord::Base
|
||||||
unreaded_notifications.order("created_at ASC").first
|
unreaded_notifications.order("created_at ASC").first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def was_piece_justificative_uploaded_for_type_id?(type_id)
|
||||||
|
pieces_justificatives.where(type_de_piece_justificative_id: type_id).count > 0
|
||||||
|
end
|
||||||
|
|
||||||
def retrieve_last_piece_justificative_by_type(type)
|
def retrieve_last_piece_justificative_by_type(type)
|
||||||
pieces_justificatives.where(type_de_piece_justificative_id: type).last
|
pieces_justificatives.where(type_de_piece_justificative_id: type).last
|
||||||
end
|
end
|
||||||
|
@ -101,12 +105,12 @@ class Dossier < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_default_champs
|
def build_default_champs
|
||||||
procedure.types_de_champ.each do |type_de_champ|
|
procedure.types_de_champ.all.each do |type_de_champ|
|
||||||
ChampPublic.create(type_de_champ_id: type_de_champ.id, dossier_id: id)
|
ChampPublic.create(type_de_champ: type_de_champ, dossier: self)
|
||||||
end
|
end
|
||||||
|
|
||||||
procedure.types_de_champ_private.each do |type_de_champ|
|
procedure.types_de_champ_private.all.each do |type_de_champ|
|
||||||
ChampPrivate.create(type_de_champ_id: type_de_champ.id, dossier_id: id)
|
ChampPrivate.create(type_de_champ: type_de_champ, dossier: self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -117,11 +121,15 @@ class Dossier < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def ordered_champs
|
def ordered_champs
|
||||||
champs.includes(:type_de_champ).order('types_de_champ.order_place')
|
# TODO: use the line below when the procedure preview does not leak champ with dossier_id == 0
|
||||||
|
# champs.joins(:type_de_champ).order('types_de_champ.order_place')
|
||||||
|
champs.joins(', types_de_champ').where("champs.type_de_champ_id = types_de_champ.id AND types_de_champ.procedure_id = #{procedure.id}").order('order_place')
|
||||||
end
|
end
|
||||||
|
|
||||||
def ordered_champs_private
|
def ordered_champs_private
|
||||||
champs_private.includes(:type_de_champ).order('types_de_champ.order_place')
|
# TODO: use the line below when the procedure preview does not leak champ with dossier_id == 0
|
||||||
|
# champs_private.includes(:type_de_champ).order('types_de_champ.order_place')
|
||||||
|
champs_private.joins(', types_de_champ').where("champs.type_de_champ_id = types_de_champ.id AND types_de_champ.procedure_id = #{procedure.id}").order('order_place')
|
||||||
end
|
end
|
||||||
|
|
||||||
def ordered_pieces_justificatives
|
def ordered_pieces_justificatives
|
||||||
|
|
|
@ -8,7 +8,7 @@ class PreferenceListDossier < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def table_with_s_attr
|
def table_with_s_attr
|
||||||
return 'dossiers.'+self.attr if table.nil? || table.empty?
|
return 'dossiers.' + self.attr if table.nil? || table.empty?
|
||||||
table + 's' + '.' + attr
|
table + 's' + '.' + attr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ class DossiersListGestionnaireService
|
||||||
filter_preference_list.inject('') do |acc, preference|
|
filter_preference_list.inject('') do |acc, preference|
|
||||||
unless preference.filter.blank?
|
unless preference.filter.blank?
|
||||||
filter = preference.filter.gsub('*', '%').gsub("'", "''")
|
filter = preference.filter.gsub('*', '%').gsub("'", "''")
|
||||||
filter = "%"+filter+"%" unless filter.include? '%'
|
filter = "%" + filter + "%" unless filter.include? '%'
|
||||||
|
|
||||||
value = preference.table_with_s_attr
|
value = preference.table_with_s_attr
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class PrevisualisationService
|
class PrevisualisationService
|
||||||
def self.destroy_all_champs dossier
|
def self.delete_all_champs dossier
|
||||||
Champ.where(dossier_id: dossier.id, type_de_champ_id: dossier.procedure.types_de_champ.ids).destroy_all
|
Champ.where(dossier_id: dossier.id, type_de_champ_id: dossier.procedure.types_de_champ.ids).delete_all
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@ class RenderPartialService
|
||||||
def self.left_panel_exist? left_panel_url
|
def self.left_panel_exist? left_panel_url
|
||||||
file = left_panel_url.split('/').last
|
file = left_panel_url.split('/').last
|
||||||
|
|
||||||
File.exist?(Rails.root.join('app','views', 'layouts', 'left_panels', '_'+file+'.html.haml'))
|
File.exist?(Rails.root.join('app','views', 'layouts', 'left_panels', '_' + file + '.html.haml'))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -3,7 +3,7 @@ class SiretFormatValidator < ActiveModel::EachValidator
|
||||||
unless value =~ /^\d{14}$/
|
unless value =~ /^\d{14}$/
|
||||||
record.errors.add(attribute, :format)
|
record.errors.add(attribute, :format)
|
||||||
end
|
end
|
||||||
unless value!= nil && (luhn_checksum(value) % 10 == 0)
|
unless value != nil && (luhn_checksum(value) % 10 == 0)
|
||||||
record.errors.add(attribute, :checksum)
|
record.errors.add(attribute, :checksum)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
- if tpj.api_entreprise
|
- if tpj.api_entreprise
|
||||||
%span.text-success{ id: "piece_justificative_#{tpj.id}" } Nous l'avons récupéré pour vous.
|
%span.text-success{ id: "piece_justificative_#{tpj.id}" } Nous l'avons récupéré pour vous.
|
||||||
- else
|
- else
|
||||||
- if dossier.retrieve_last_piece_justificative_by_type(tpj.id).nil?
|
- if !dossier.was_piece_justificative_uploaded_for_type_id?(tpj.id)
|
||||||
= file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes
|
= file_field_tag "piece_justificative_#{tpj.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes
|
||||||
- else
|
- else
|
||||||
%span.btn.btn-sm.btn-file.btn-success
|
%span.btn.btn-sm.btn-file.btn-success
|
||||||
|
|
|
@ -9,7 +9,7 @@ Rails.application.configure do
|
||||||
# Do not eager load code on boot.
|
# Do not eager load code on boot.
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
config.public_file_server.enabled = true
|
config.public_file_server.enabled = true
|
||||||
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
|
|
|
@ -13,7 +13,7 @@ Rails.application.configure do
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
# Configure static file server for tests with Cache-Control for performance.
|
# Configure static file server for tests with Cache-Control for performance.
|
||||||
config.public_file_server.enabled = true
|
config.public_file_server.enabled = true
|
||||||
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
|
|
|
@ -27,7 +27,7 @@ CarrierWave.configure do |config|
|
||||||
if Rails.env.production?
|
if Rails.env.production?
|
||||||
config.fog_directory = "tps"
|
config.fog_directory = "tps"
|
||||||
elsif Rails.env.development?
|
elsif Rails.env.development?
|
||||||
config.fog_directory= "test_local"
|
config.fog_directory = "test_local"
|
||||||
else
|
else
|
||||||
config.fog_directory = "tps_dev"
|
config.fog_directory = "tps_dev"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if LogStasher.enabled
|
if LogStasher.enabled
|
||||||
LogStasher.add_custom_fields do |fields|
|
LogStasher.add_custom_fields do |fields|
|
||||||
fields[:type] = "tps"
|
fields[:type] = "tps"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@ SmartListing.configure do |config|
|
||||||
# :unlimited_per_page => false, # allow infinite page size
|
# :unlimited_per_page => false, # allow infinite page size
|
||||||
# :paginate => true, # allow pagination
|
# :paginate => true, # allow pagination
|
||||||
# :memorize_per_page => false, # save per page settings in the cookie
|
# :memorize_per_page => false, # save per page settings in the cookie
|
||||||
:page_sizes => [10, 20, 50, 100], # set available page sizes array
|
:page_sizes => [10, 20, 50, 100], # set available page sizes array
|
||||||
# :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
|
# :kaminari_options => {:theme => "smart_listing"}, # Kaminari's paginate helper options
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class RemoveDuplicateEmailReceived < ActiveRecord::Migration[5.0]
|
class RemoveDuplicateEmailReceived < ActiveRecord::Migration[5.0]
|
||||||
def change
|
def change
|
||||||
all_mails = MailReceived.all
|
all_mails = MailReceived.all
|
||||||
groupped = all_mails.group_by { |m| m.procedure_id }
|
groupped = all_mails.group_by { |m| m.procedure_id }
|
||||||
filtered = groupped.reject { |k, v| v.length < 2 }
|
filtered = groupped.reject { |k, v| v.length < 2 }
|
||||||
filtered.each do |k, duplicate_mails|
|
filtered.each do |k, duplicate_mails|
|
||||||
|
|
|
@ -119,6 +119,22 @@ describe Admin::GestionnairesController, type: :controller do
|
||||||
it { expect(gestionnaire.administrateurs.size).to eq 2 }
|
it { expect(gestionnaire.administrateurs.size).to eq 2 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when an other admin will add the same email with some uppercase in it' do
|
||||||
|
let(:email) { 'Test@Plop.com' }
|
||||||
|
let(:gestionnaire) { Gestionnaire.find_by_email(email.downcase) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
create :gestionnaire, email: email, administrateurs: [admin]
|
||||||
|
|
||||||
|
sign_out admin
|
||||||
|
sign_in admin_2
|
||||||
|
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(admin_2.gestionnaires).to include gestionnaire }
|
||||||
|
end
|
||||||
|
|
||||||
context 'Email notification' do
|
context 'Email notification' do
|
||||||
it 'Notification email is sent when accompagnateur is create' do
|
it 'Notification email is sent when accompagnateur is create' do
|
||||||
expect(GestionnaireMailer).to receive(:new_gestionnaire).and_return(GestionnaireMailer)
|
expect(GestionnaireMailer).to receive(:new_gestionnaire).and_return(GestionnaireMailer)
|
||||||
|
|
|
@ -248,7 +248,7 @@ shared_examples 'description_controller_spec' do
|
||||||
it { expect(response).to redirect_to users_dossier_recapitulatif_path }
|
it { expect(response).to redirect_to users_dossier_recapitulatif_path }
|
||||||
|
|
||||||
context 'when champs is type_de_champ datetime' do
|
context 'when champs is type_de_champ datetime' do
|
||||||
it { expect(dossier.champs.second.value).to eq(dossier_date_value+' '+dossier_hour_value+':'+dossier_minute_value) }
|
it { expect(dossier.champs.second.value).to eq(dossier_date_value + ' ' + dossier_hour_value + ':' + dossier_minute_value) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when champs value is empty' do
|
context 'when champs value is empty' do
|
||||||
|
@ -270,8 +270,8 @@ shared_examples 'description_controller_spec' do
|
||||||
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
||||||
before do
|
before do
|
||||||
post :update, params: {dossier_id: dossier_id,
|
post :update, params: {dossier_id: dossier_id,
|
||||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||||
dossier.reload
|
dossier.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -280,8 +280,8 @@ shared_examples 'description_controller_spec' do
|
||||||
expect(ClamavService).to receive(:safe_file?).twice
|
expect(ClamavService).to receive(:safe_file?).twice
|
||||||
|
|
||||||
post :update, params: {dossier_id: dossier_id,
|
post :update, params: {dossier_id: dossier_id,
|
||||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -318,8 +318,8 @@ shared_examples 'description_controller_spec' do
|
||||||
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
||||||
|
|
||||||
subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
|
subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
|
||||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||||
}
|
}
|
||||||
|
|
||||||
context 'when user is a guest' do
|
context 'when user is a guest' do
|
||||||
|
@ -394,8 +394,8 @@ shared_examples 'description_controller_spec_POST_piece_justificatives_for_owner
|
||||||
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
let(:all_pj_type) { dossier.procedure.type_de_piece_justificative_ids }
|
||||||
|
|
||||||
subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
|
subject { patch :pieces_justificatives, params: {dossier_id: dossier.id,
|
||||||
'piece_justificative_'+all_pj_type[0].to_s => piece_justificative_0,
|
'piece_justificative_' + all_pj_type[0].to_s => piece_justificative_0,
|
||||||
'piece_justificative_'+all_pj_type[1].to_s => piece_justificative_1}
|
'piece_justificative_' + all_pj_type[1].to_s => piece_justificative_1}
|
||||||
}
|
}
|
||||||
|
|
||||||
context 'when user is the owner', vcr: {cassette_name: 'controllers_users_description_controller_pieces_justificatives'} do
|
context 'when user is the owner', vcr: {cassette_name: 'controllers_users_description_controller_pieces_justificatives'} do
|
||||||
|
|
|
@ -40,22 +40,22 @@ feature 'usage of pref list dossier lateral panel by procedure', js: true do
|
||||||
|
|
||||||
context 'when on click on add attribut specific at the procedure button' do
|
context 'when on click on add attribut specific at the procedure button' do
|
||||||
before do
|
before do
|
||||||
page.click_on 'add_pref_list_champs_'+procedure.types_de_champ.first.id.to_s
|
page.click_on 'add_pref_list_champs_' + procedure.types_de_champ.first.id.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'preference list panel is brought up to date' do
|
scenario 'preference list panel is brought up to date' do
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(page).to have_css('#delete_pref_list_champs_'+procedure.types_de_champ.first.id.to_s)
|
expect(page).to have_css('#delete_pref_list_champs_' + procedure.types_de_champ.first.id.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when on click on delete attribut button' do
|
context 'when on click on delete attribut button' do
|
||||||
before do
|
before do
|
||||||
page.click_on 'delete_pref_list_champs_'+procedure.types_de_champ.first.id.to_s
|
page.click_on 'delete_pref_list_champs_' + procedure.types_de_champ.first.id.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'preference list panel is brought up to date' do
|
scenario 'preference list panel is brought up to date' do
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(page).not_to have_css('#delete_pref_list_champs_'+procedure.types_de_champ.first.id.to_s)
|
expect(page).not_to have_css('#delete_pref_list_champs_' + procedure.types_de_champ.first.id.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'dossier is brought up to date' do
|
scenario 'dossier is brought up to date' do
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe CARTO::SGMAP::API do
|
||||||
before do
|
before do
|
||||||
stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search")
|
stub_request(:post, "https://apicarto.sgmap.fr/quartiers-prioritaires/search")
|
||||||
.with(:body => /.*/,
|
.with(:body => /.*/,
|
||||||
:headers => {'Content-Type'=>'application/json'})
|
:headers => {'Content-Type' => 'application/json'})
|
||||||
.to_return(status: status, body: body)
|
.to_return(status: status, body: body)
|
||||||
end
|
end
|
||||||
context 'when geojson is empty' do
|
context 'when geojson is empty' do
|
||||||
|
@ -55,7 +55,7 @@ describe CARTO::SGMAP::API do
|
||||||
before do
|
before do
|
||||||
stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie")
|
stub_request(:post, "https://apicarto.sgmap.fr/cadastre/geometrie")
|
||||||
.with(:body => /.*/,
|
.with(:body => /.*/,
|
||||||
:headers => {'Content-Type'=>'application/json'})
|
:headers => {'Content-Type' => 'application/json'})
|
||||||
.to_return(status: status, body: body)
|
.to_return(status: status, body: body)
|
||||||
end
|
end
|
||||||
context 'when geojson is empty' do
|
context 'when geojson is empty' do
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe CARTO::SGMAP::QuartiersPrioritaires::Adapter do
|
||||||
it { expect(subject[:nom]).to eq('Hauts De Vallières') }
|
it { expect(subject[:nom]).to eq('Hauts De Vallières') }
|
||||||
it { expect(subject[:commune]).to eq('Metz') }
|
it { expect(subject[:commune]).to eq('Metz') }
|
||||||
|
|
||||||
it { expect(subject[:geometry]).to eq({:type=>"MultiPolygon", :coordinates=>[[[[6.2136923480551, 49.1342109827851], [6.21416055031881, 49.1338823553928]]]]}) }
|
it { expect(subject[:geometry]).to eq({:type => "MultiPolygon", :coordinates => [[[[6.2136923480551, 49.1342109827851], [6.21416055031881, 49.1338823553928]]]]}) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe MailTemplateConcern do
|
||||||
let(:initiated_mail) { Mails::InitiatedMail.default }
|
let(:initiated_mail) { Mails::InitiatedMail.default }
|
||||||
|
|
||||||
it 'works' do
|
it 'works' do
|
||||||
initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--'
|
initiated_mail.object = '[TPS] --numero_dossier-- --libelle_procedure-- --lien_dossier--'
|
||||||
expected =
|
expected =
|
||||||
"[TPS] #{dossier.id} #{dossier.procedure.libelle} " +
|
"[TPS] #{dossier.id} #{dossier.procedure.libelle} " +
|
||||||
"<a target=\"_blank\" href=\"http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif\">http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif</a>"
|
"<a target=\"_blank\" href=\"http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif\">http://localhost:3000/users/dossiers/#{dossier.id}/recapitulatif</a>"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe PrevisualisationService do
|
describe PrevisualisationService do
|
||||||
describe '.destroy_all_champs' do
|
describe '.delete_all_champs' do
|
||||||
subject { described_class.destroy_all_champs dossier }
|
subject { described_class.delete_all_champs dossier }
|
||||||
|
|
||||||
let(:procedure_1) { create :procedure, :with_type_de_champ }
|
let(:procedure_1) { create :procedure, :with_type_de_champ }
|
||||||
let(:procedure_2) { create :procedure, :with_type_de_champ }
|
let(:procedure_2) { create :procedure, :with_type_de_champ }
|
||||||
|
@ -14,7 +14,7 @@ describe PrevisualisationService do
|
||||||
it { expect(TypeDeChamp.all.size).to eq 2 }
|
it { expect(TypeDeChamp.all.size).to eq 2 }
|
||||||
it { expect(Champ.all.size).to eq 2 }
|
it { expect(Champ.all.size).to eq 2 }
|
||||||
|
|
||||||
context 'when function destroy_all_champs is call' do
|
context 'when function delete_all_champs is call' do
|
||||||
let(:dossier) { dossier_1 }
|
let(:dossier) { dossier_1 }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -8,12 +8,12 @@ describe RenderPartialService do
|
||||||
describe 'navbar' do
|
describe 'navbar' do
|
||||||
subject { service.navbar }
|
subject { service.navbar }
|
||||||
|
|
||||||
it { is_expected.to eq 'layouts/navbars/navbar_'+controller.to_s.parameterize + '_' + method.to_s }
|
it { is_expected.to eq 'layouts/navbars/navbar_' + controller.to_s.parameterize + '_' + method.to_s }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'left_panel' do
|
describe 'left_panel' do
|
||||||
subject { service.left_panel }
|
subject { service.left_panel }
|
||||||
|
|
||||||
it { is_expected.to eq 'layouts/left_panels/left_panel_'+controller.to_s.parameterize + '_' + method.to_s }
|
it { is_expected.to eq 'layouts/left_panels/left_panel_' + controller.to_s.parameterize + '_' + method.to_s }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue