Merge branch 'develop' into staging
This commit is contained in:
commit
eda62f7fee
24 changed files with 110 additions and 73 deletions
BIN
app/assets/images/edit.png
Normal file
BIN
app/assets/images/edit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
app/assets/images/pencil.png
Normal file
BIN
app/assets/images/pencil.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -93,22 +93,30 @@ function add_event_freeDraw() {
|
||||||
freeDraw.on('markers', function (e) {
|
freeDraw.on('markers', function (e) {
|
||||||
$("#json_latlngs").val(JSON.stringify(e.latLngs));
|
$("#json_latlngs").val(JSON.stringify(e.latLngs));
|
||||||
|
|
||||||
|
add_event_edit();
|
||||||
|
|
||||||
get_external_data(e.latLngs);
|
get_external_data(e.latLngs);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#map").on('click', function(){
|
||||||
|
freeDraw.setMode(L.FreeDraw.MODES.VIEW);
|
||||||
|
});
|
||||||
|
|
||||||
$("#new").on('click', function (e) {
|
$("#new").on('click', function (e) {
|
||||||
freeDraw.setMode(L.FreeDraw.MODES.CREATE);
|
freeDraw.setMode(L.FreeDraw.MODES.CREATE);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#edit").on('click', function (e) {
|
|
||||||
freeDraw.setMode(L.FreeDraw.MODES.EDIT);
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#delete").on('click', function (e) {
|
$("#delete").on('click', function (e) {
|
||||||
freeDraw.setMode(L.FreeDraw.MODES.DELETE);
|
freeDraw.setMode(L.FreeDraw.MODES.DELETE);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function add_event_edit (){
|
||||||
|
$(".leaflet-container g path").on('click', function (e) {
|
||||||
|
setTimeout(function(){freeDraw.setMode(L.FreeDraw.MODES.EDIT | L.FreeDraw.MODES.DELETE)}, 50);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function get_position() {
|
function get_position() {
|
||||||
var position;
|
var position;
|
||||||
|
|
||||||
|
@ -131,7 +139,7 @@ function get_address_point(request) {
|
||||||
}).done(function (data) {
|
}).done(function (data) {
|
||||||
if (data.lat != null) {
|
if (data.lat != null) {
|
||||||
map.setView(new L.LatLng(data.lat, data.lon), data.zoom);
|
map.setView(new L.LatLng(data.lat, data.lon), data.zoom);
|
||||||
L.marker([data.lat, data.lon], {icon: icon}).addTo(map);
|
//L.marker([data.lat, data.lon], {icon: icon}).addTo(map);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,16 @@ table {
|
||||||
@extend .col-md-12;
|
@extend .col-md-12;
|
||||||
@extend .col-lg-12;
|
@extend .col-lg-12;
|
||||||
|
|
||||||
|
margin-left: 15px;
|
||||||
|
width: 90%;
|
||||||
height: 600px;
|
height: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#map.qp, #map.cadastre {
|
#map.qp, #map.cadastre {
|
||||||
@extend .col-md-9;
|
@extend .col-md-9;
|
||||||
@extend .col-lg-9;
|
@extend .col-lg-9;
|
||||||
|
|
||||||
|
width: 70%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
|
@ -35,6 +39,10 @@ table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-container path {
|
||||||
|
cursor: url('/assets/edit.png'), default !important;
|
||||||
|
}
|
||||||
|
|
||||||
#infos_dossier {
|
#infos_dossier {
|
||||||
#map.mini {
|
#map.mini {
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
@ -42,8 +50,6 @@ table {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#map section.overlay {
|
#map section.overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -56,7 +62,7 @@ table {
|
||||||
}
|
}
|
||||||
|
|
||||||
#map.mode-create {
|
#map.mode-create {
|
||||||
cursor: crosshair !important;
|
cursor: url('/assets/pencil.png'), crosshair !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#map g path.tracer {
|
#map g path.tracer {
|
||||||
|
|
|
@ -80,7 +80,7 @@ class Admin::ProceduresController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def archive
|
def archive
|
||||||
change_status({archived: true})
|
change_status({archived: params[:archive]})
|
||||||
end
|
end
|
||||||
|
|
||||||
def active_class
|
def active_class
|
||||||
|
|
|
@ -94,6 +94,6 @@ class Users::DescriptionController < UsersController
|
||||||
private
|
private
|
||||||
|
|
||||||
def create_params
|
def create_params
|
||||||
params.permit(:nom_projet, :description)
|
params.permit(:nom_projet)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,6 @@ class Dossier < ActiveRecord::Base
|
||||||
after_save :build_default_champs, if: Proc.new { procedure_id_changed? }
|
after_save :build_default_champs, if: Proc.new { procedure_id_changed? }
|
||||||
|
|
||||||
validates :nom_projet, presence: true, allow_blank: false, allow_nil: true
|
validates :nom_projet, presence: true, allow_blank: false, allow_nil: true
|
||||||
validates :description, presence: true, allow_blank: false, allow_nil: true
|
|
||||||
validates :user, presence: true
|
validates :user, presence: true
|
||||||
|
|
||||||
WAITING_FOR_GESTIONNAIRE = %w(initiated updated submitted)
|
WAITING_FOR_GESTIONNAIRE = %w(initiated updated submitted)
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
class DossierSerializer < ActiveModel::Serializer
|
class DossierSerializer < ActiveModel::Serializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
:nom_projet,
|
:nom_projet,
|
||||||
:description,
|
|
||||||
:created_at,
|
:created_at,
|
||||||
:updated_at,
|
:updated_at,
|
||||||
:archived,
|
:archived,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%ul.nav.nav-tabs
|
%ul.nav.nav-tabs
|
||||||
%li{class: @draft_class}
|
%li{class: @draft_class}
|
||||||
%a{:href => "#{url_for :admin_procedures_draft}"}
|
%a{:href => "#{url_for :admin_procedures_draft}"}
|
||||||
%h5{style: 'color: black'}
|
%h5.text-primary
|
||||||
="Brouillons"
|
="Brouillons"
|
||||||
|
|
||||||
%li{class: @active_class}
|
%li{class: @active_class}
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
%h4
|
%h4
|
||||||
= @facade.dossier.procedure.libelle
|
= @facade.dossier.procedure.libelle
|
||||||
|
|
||||||
.description
|
|
||||||
= h @facade.dossier.description.html_safe
|
|
||||||
|
|
||||||
- if @facade.dossier.mandataire_social && gestionnaire_signed_in?
|
- if @facade.dossier.mandataire_social && gestionnaire_signed_in?
|
||||||
.mandataire_social.text-success.center
|
.mandataire_social.text-success.center
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
%h2
|
%h2
|
||||||
='Localisation de votre demande'
|
='Localisation'
|
||||||
|
%h4.text-primary
|
||||||
|
Positionnez-vous et dessinez sur la carte la zone d'action de votre demande.
|
||||||
%br
|
%br
|
||||||
|
|
||||||
.content{style:'margin-bottom:60px'}
|
.content{style:'margin-bottom:60px'}
|
||||||
%button#new.btn.btn-sm.btn-success{type:'button'} Nouveau
|
%button#new.btn.btn-md.btn-success{type:'button'}
|
||||||
\-
|
%i.fa.fa-pencil
|
||||||
%button#edit.btn.btn-sm.btn-info{type:'button'} Editer
|
Ajouter une zone
|
||||||
\-
|
-#\-
|
||||||
%button#delete.btn.btn-sm.btn-danger{type:'button'} Supprimer
|
-#%button#edit.btn.btn-sm.btn-info{type:'button'} Editer
|
||||||
|
-#\-
|
||||||
|
-#%button#delete.btn.btn-sm.btn-danger{type:'button'} Supprimer
|
||||||
|
|
||||||
%span#search_by_address{style: 'margin-left: 20px'}
|
%span#search_by_address{style: 'margin-left: 20px'}
|
||||||
%input.form-control{type: :address, placeholder: 'Rechercher une adresse'}
|
%input.form-control{type: :address, placeholder: 'Rechercher une adresse'}
|
||||||
|
|
|
@ -15,9 +15,10 @@
|
||||||
= '*'
|
= '*'
|
||||||
|
|
||||||
-if champ.type_champ == 'textarea'
|
-if champ.type_champ == 'textarea'
|
||||||
%textarea.form-control{name:"champs['#{champ.id}']",
|
%textarea.form-control.wysihtml5{name:"champs['#{champ.id}']",
|
||||||
placeholder: champ.libelle,
|
placeholder: champ.description,
|
||||||
id: "champs_#{champ.id}"}
|
id: "champs_#{champ.id}",
|
||||||
|
row: '6'}
|
||||||
=champ.value
|
=champ.value
|
||||||
-elsif champ.type_champ == 'civilite'
|
-elsif champ.type_champ == 'civilite'
|
||||||
%label.radio-inline
|
%label.radio-inline
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
type: champ.type_champ,
|
type: champ.type_champ,
|
||||||
'data-provide' => champ.data_provide,
|
'data-provide' => champ.data_provide,
|
||||||
'data-date-format' => ('dd/mm/yyyy' if champ.type_champ == 'datetime')}
|
'data-date-format' => ('dd/mm/yyyy' if champ.type_champ == 'datetime')}
|
||||||
|
|
||||||
- unless champ.description.empty?
|
- unless champ.description.empty?
|
||||||
.row
|
.row
|
||||||
.col-lg-8.col-md-8{class: 'description_div', id:"description_champs_#{champ.id}"}
|
.col-lg-8.col-md-8{class: 'description_div', id:"description_champs_#{champ.id}"}
|
||||||
|
|
|
@ -12,11 +12,6 @@
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%h4 Libellé pour votre dossier *
|
%h4 Libellé pour votre dossier *
|
||||||
= text_field_tag :nom_projet, @dossier.nom_projet, placeholder: 'Nom du projet', class: 'form-control'
|
= text_field_tag :nom_projet, @dossier.nom_projet, placeholder: 'Nom du projet', class: 'form-control'
|
||||||
%br
|
|
||||||
.row
|
|
||||||
.col-md-12
|
|
||||||
%h4 Description *
|
|
||||||
= text_area_tag :description, @dossier.description, rows: '6', placeholder: 'Description du projet', class: 'form-control wysihtml5'
|
|
||||||
|
|
||||||
#liste_champs
|
#liste_champs
|
||||||
-unless @champs.nil?
|
-unless @champs.nil?
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
class DeleteDefaultDescriptionToDossier < ActiveRecord::Migration
|
||||||
|
class Dossier < ActiveRecord::Base
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Champ < ActiveRecord::Base
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Procedure < ActiveRecord::Base
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class TypeDeChamp < ActiveRecord::Base
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def up
|
||||||
|
Procedure.all.each do |procedure|
|
||||||
|
#change all type_de_champ place_order by +1 to insert new type_de_champ description on first place
|
||||||
|
TypeDeChamp.where(procedure_id: procedure.id).each do |type_de_champ|
|
||||||
|
type_de_champ.order_place += 1
|
||||||
|
type_de_champ.save
|
||||||
|
end
|
||||||
|
|
||||||
|
#insert type_de_champ description on first place
|
||||||
|
TypeDeChamp.create(libelle: 'Description', description: 'Description de votre demande', type_champ: 'textarea', order_place: 0, procedure_id: procedure.id, mandatory: true)
|
||||||
|
end
|
||||||
|
|
||||||
|
Dossier.all.each do |dossier|
|
||||||
|
#get the new type de champ
|
||||||
|
new_type_de_champ = TypeDeChamp.where(libelle: 'Description', type_champ: 'textarea', order_place: 0, procedure_id: dossier.procedure_id, mandatory: true)
|
||||||
|
|
||||||
|
#create a new champ with the actual description value
|
||||||
|
Champ.create(value: dossier.description, type_de_champ_id: new_type_de_champ.first.id, dossier_id: dossier.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
remove_column :dossiers, :description
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
add_column :dossiers, :description, :text
|
||||||
|
|
||||||
|
TypeDeChamp.where(libelle: 'Description', type_champ: 'textarea', order_place: 0, mandatory: true).each do |type_de_champ|
|
||||||
|
Champ.where(type_de_champ_id: type_de_champ.id).each do |champ|
|
||||||
|
dossier = Dossier.find(champ.dossier_id)
|
||||||
|
dossier.description = champ.value
|
||||||
|
dossier.save
|
||||||
|
|
||||||
|
champ.delete
|
||||||
|
end
|
||||||
|
|
||||||
|
procedure_id = type_de_champ.procedure_id
|
||||||
|
type_de_champ.delete
|
||||||
|
|
||||||
|
TypeDeChamp.where(procedure_id: procedure_id).each do |type_de_champ_2|
|
||||||
|
type_de_champ_2.order_place -= 1
|
||||||
|
type_de_champ_2.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# 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: 20160609125949) do
|
ActiveRecord::Schema.define(version: 20160609145737) 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"
|
||||||
|
@ -113,7 +113,6 @@ ActiveRecord::Schema.define(version: 20160609125949) do
|
||||||
add_index "commentaires", ["dossier_id"], name: "index_commentaires_on_dossier_id", using: :btree
|
add_index "commentaires", ["dossier_id"], name: "index_commentaires_on_dossier_id", using: :btree
|
||||||
|
|
||||||
create_table "dossiers", force: :cascade do |t|
|
create_table "dossiers", force: :cascade do |t|
|
||||||
t.string "description"
|
|
||||||
t.boolean "autorisation_donnees"
|
t.boolean "autorisation_donnees"
|
||||||
t.string "nom_projet"
|
t.string "nom_projet"
|
||||||
t.integer "procedure_id"
|
t.integer "procedure_id"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
class Github::Releases
|
class Github::Releases
|
||||||
|
|
||||||
def self.latest
|
def self.latest
|
||||||
release = Hashie::Mash.new JSON.parse(Github::API.latest_release)
|
latest_release = Github::API.latest_release
|
||||||
|
return nil if latest_release.nil?
|
||||||
return nil if release.nil?
|
|
||||||
|
|
||||||
|
release = Hashie::Mash.new JSON.parse(latest_release)
|
||||||
release.published_at = release.published_at.to_date.strftime('%d/%m/%Y')
|
release.published_at = release.published_at.to_date.strftime('%d/%m/%Y')
|
||||||
release
|
release
|
||||||
end
|
end
|
||||||
|
|
|
@ -116,7 +116,7 @@ describe API::V1::DossiersController do
|
||||||
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, procedure: procedure) } }
|
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, procedure: procedure) } }
|
||||||
let(:dossier_id) { dossier.id }
|
let(:dossier_id) { dossier.id }
|
||||||
let(:body) { JSON.parse(retour.body, symbolize_names: true) }
|
let(:body) { JSON.parse(retour.body, symbolize_names: true) }
|
||||||
let(:field_list) { [:id, :nom_projet, :created_at, :updated_at, :description, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :commentaires] }
|
let(:field_list) { [:id, :nom_projet, :created_at, :updated_at, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :commentaires] }
|
||||||
subject { body[:dossier] }
|
subject { body[:dossier] }
|
||||||
|
|
||||||
it 'return REST code 200', :show_in_doc do
|
it 'return REST code 200', :show_in_doc do
|
||||||
|
@ -126,7 +126,6 @@ describe API::V1::DossiersController do
|
||||||
it { expect(subject[:nom_projet]).to eq(dossier.nom_projet) }
|
it { expect(subject[:nom_projet]).to eq(dossier.nom_projet) }
|
||||||
it { expect(subject[:created_at]).to eq('2008-09-01T08:05:00.000Z') }
|
it { expect(subject[:created_at]).to eq('2008-09-01T08:05:00.000Z') }
|
||||||
it { expect(subject[:updated_at]).to eq('2008-09-01T08:05:00.000Z') }
|
it { expect(subject[:updated_at]).to eq('2008-09-01T08:05:00.000Z') }
|
||||||
it { expect(subject[:description]).to eq(dossier.description) }
|
|
||||||
it { expect(subject[:archived]).to eq(dossier.archived) }
|
it { expect(subject[:archived]).to eq(dossier.archived) }
|
||||||
it { expect(subject[:mandataire_social]).to eq(dossier.mandataire_social) }
|
it { expect(subject[:mandataire_social]).to eq(dossier.mandataire_social) }
|
||||||
|
|
||||||
|
|
|
@ -116,12 +116,6 @@ describe Users::DescriptionController, type: :controller, vcr: { cassette_name:
|
||||||
it { is_expected.to render_template(:show) }
|
it { is_expected.to render_template(:show) }
|
||||||
it { expect(flash[:alert]).to be_present }
|
it { expect(flash[:alert]).to be_present }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'description empty' do
|
|
||||||
let(:description) { '' }
|
|
||||||
it { is_expected.to render_template(:show) }
|
|
||||||
it { expect(flash[:alert]).to be_present }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'Quand la procédure accepte les CERFA' do
|
context 'Quand la procédure accepte les CERFA' do
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :dossier do
|
factory :dossier do
|
||||||
nom_projet "Demande de subvention dans le cadre d'accompagnement d'enfant à l'étranger"
|
nom_projet "Demande de subvention dans le cadre d'accompagnement d'enfant à l'étranger"
|
||||||
description "Ma super description"
|
|
||||||
state 'draft'
|
state 'draft'
|
||||||
association :user, factory: [:user]
|
association :user, factory: [:user]
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ feature 'user is on description page' do
|
||||||
context 'he fill description fields' do
|
context 'he fill description fields' do
|
||||||
before do
|
before do
|
||||||
find_by_id('nom_projet').set 'mon nom'
|
find_by_id('nom_projet').set 'mon nom'
|
||||||
find_by_id('description').set 'ma description'
|
|
||||||
end
|
end
|
||||||
context 'before submit' do
|
context 'before submit' do
|
||||||
it 'dossier cerfa is empty' do
|
it 'dossier cerfa is empty' do
|
||||||
|
|
|
@ -55,7 +55,6 @@ feature 'user path for dossier creation' do
|
||||||
context 'user fill and validate description page' do
|
context 'user fill and validate description page' do
|
||||||
before do
|
before do
|
||||||
page.find_by_id('nom_projet').set 'Mon super projet'
|
page.find_by_id('nom_projet').set 'Mon super projet'
|
||||||
page.find_by_id('description').set 'Ma super description'
|
|
||||||
page.click_on 'Soumettre mon dossier'
|
page.click_on 'Soumettre mon dossier'
|
||||||
end
|
end
|
||||||
scenario 'user is on recap page' do
|
scenario 'user is on recap page' do
|
||||||
|
|
|
@ -3,7 +3,6 @@ require 'spec_helper'
|
||||||
describe Dossier do
|
describe Dossier do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
describe 'database columns' do
|
describe 'database columns' do
|
||||||
it { is_expected.to have_db_column(:description) }
|
|
||||||
it { is_expected.to have_db_column(:autorisation_donnees) }
|
it { is_expected.to have_db_column(:autorisation_donnees) }
|
||||||
it { is_expected.to have_db_column(:nom_projet) }
|
it { is_expected.to have_db_column(:nom_projet) }
|
||||||
it { is_expected.to have_db_column(:created_at) }
|
it { is_expected.to have_db_column(:created_at) }
|
||||||
|
@ -40,11 +39,6 @@ describe Dossier do
|
||||||
it { is_expected.not_to allow_value('').for(:nom_projet) }
|
it { is_expected.not_to allow_value('').for(:nom_projet) }
|
||||||
it { is_expected.to allow_value('mon super projet').for(:nom_projet) }
|
it { is_expected.to allow_value('mon super projet').for(:nom_projet) }
|
||||||
end
|
end
|
||||||
context 'description' do
|
|
||||||
it { is_expected.to allow_value(nil).for(:description) }
|
|
||||||
it { is_expected.not_to allow_value('').for(:description) }
|
|
||||||
it { is_expected.to allow_value('ma superbe description').for(:description) }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'methods' do
|
describe 'methods' do
|
||||||
|
@ -115,6 +109,7 @@ describe Dossier do
|
||||||
describe '#save' do
|
describe '#save' do
|
||||||
subject { build(:dossier, procedure: procedure, user: user) }
|
subject { build(:dossier, procedure: procedure, user: user) }
|
||||||
let!(:procedure) { create(:procedure) }
|
let!(:procedure) { create(:procedure) }
|
||||||
|
|
||||||
context 'when is linked to a procedure' do
|
context 'when is linked to a procedure' do
|
||||||
it 'creates default champs' do
|
it 'creates default champs' do
|
||||||
expect(subject).to receive(:build_default_champs)
|
expect(subject).to receive(:build_default_champs)
|
||||||
|
@ -122,11 +117,11 @@ describe Dossier do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
context 'when is not linked to a procedure' do
|
context 'when is not linked to a procedure' do
|
||||||
subject { create(:dossier, procedure: procedure, user: user) }
|
subject { create(:dossier, procedure: nil, user: user) }
|
||||||
|
|
||||||
it 'does not create default champs' do
|
it 'does not create default champs' do
|
||||||
expect(subject).not_to receive(:build_default_champs)
|
expect(subject).not_to receive(:build_default_champs)
|
||||||
subject.update_attributes(description: 'plop')
|
subject.update_attributes(nom_projet: 'plop')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -541,7 +536,6 @@ describe Dossier do
|
||||||
subject { dossier.as_csv }
|
subject { dossier.as_csv }
|
||||||
|
|
||||||
it { expect(subject[:nom_projet]).to eq("Demande de subvention dans le cadre d'accompagnement d'enfant à l'étranger") }
|
it { expect(subject[:nom_projet]).to eq("Demande de subvention dans le cadre d'accompagnement d'enfant à l'étranger") }
|
||||||
it { expect(subject[:description]).to eq("Ma super description") }
|
|
||||||
it { expect(subject[:archived]).to be_falsey }
|
it { expect(subject[:archived]).to be_falsey }
|
||||||
it { expect(subject['etablissement.siret']).to eq('44011762001530') }
|
it { expect(subject['etablissement.siret']).to eq('44011762001530') }
|
||||||
it { expect(subject['etablissement.siege_social']).to be_truthy }
|
it { expect(subject['etablissement.siege_social']).to be_truthy }
|
||||||
|
|
|
@ -25,10 +25,6 @@ describe 'admin/previsualisations/show.html.haml', type: :view do
|
||||||
expect(rendered).to have_selector('input[id=nom_projet][name=nom_projet]')
|
expect(rendered).to have_selector('input[id=nom_projet][name=nom_projet]')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Description du projet' do
|
|
||||||
expect(rendered).to have_selector('textarea[id=description][name=description]')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'Charger votre CERFA (PDF)' do
|
it 'Charger votre CERFA (PDF)' do
|
||||||
expect(rendered).to have_selector('input[type=file][name=cerfa_pdf][id=cerfa_pdf]')
|
expect(rendered).to have_selector('input[type=file][name=cerfa_pdf][id=cerfa_pdf]')
|
||||||
end
|
end
|
||||||
|
@ -71,7 +67,6 @@ describe 'admin/previsualisations/show.html.haml', type: :view do
|
||||||
let!(:dossier) do
|
let!(:dossier) do
|
||||||
create(:dossier,
|
create(:dossier,
|
||||||
nom_projet: 'Projet de test',
|
nom_projet: 'Projet de test',
|
||||||
description: 'Description de test',
|
|
||||||
user: user)
|
user: user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -82,10 +77,6 @@ describe 'admin/previsualisations/show.html.haml', type: :view do
|
||||||
it 'Nom du projet' do
|
it 'Nom du projet' do
|
||||||
expect(rendered).to have_selector("input[id=nom_projet][value='#{dossier.nom_projet}']")
|
expect(rendered).to have_selector("input[id=nom_projet][value='#{dossier.nom_projet}']")
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Description du projet' do
|
|
||||||
expect(rendered).to have_content("#{dossier.description}")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'Champs' do
|
context 'Champs' do
|
||||||
|
|
|
@ -26,10 +26,6 @@ describe 'users/description/show.html.haml', type: :view do
|
||||||
expect(rendered).to have_selector('input[id=nom_projet][name=nom_projet]')
|
expect(rendered).to have_selector('input[id=nom_projet][name=nom_projet]')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Description du projet' do
|
|
||||||
expect(rendered).to have_selector('textarea[id=description][name=description]')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'Charger votre CERFA (PDF)' do
|
it 'Charger votre CERFA (PDF)' do
|
||||||
expect(rendered).to have_selector('input[type=file][name=cerfa_pdf][id=cerfa_pdf]')
|
expect(rendered).to have_selector('input[type=file][name=cerfa_pdf][id=cerfa_pdf]')
|
||||||
end
|
end
|
||||||
|
@ -72,7 +68,6 @@ describe 'users/description/show.html.haml', type: :view do
|
||||||
let!(:dossier) do
|
let!(:dossier) do
|
||||||
create(:dossier,
|
create(:dossier,
|
||||||
nom_projet: 'Projet de test',
|
nom_projet: 'Projet de test',
|
||||||
description: 'Description de test',
|
|
||||||
user: user)
|
user: user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -83,10 +78,6 @@ describe 'users/description/show.html.haml', type: :view do
|
||||||
it 'Nom du projet' do
|
it 'Nom du projet' do
|
||||||
expect(rendered).to have_selector("input[id=nom_projet][value='#{dossier.nom_projet}']")
|
expect(rendered).to have_selector("input[id=nom_projet][value='#{dossier.nom_projet}']")
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Description du projet' do
|
|
||||||
expect(rendered).to have_content("#{dossier.description}")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'Champs' do
|
context 'Champs' do
|
||||||
|
|
Loading…
Reference in a new issue